9cbdbe87 by Kevin Burton

updates for the Usermanager

1 parent 869ee77d
Showing 39 changed files with 1508 additions and 0 deletions
...@@ -12,6 +12,14 @@ class Actions { ...@@ -12,6 +12,14 @@ class Actions {
12 public static function admin_print_styles() { 12 public static function admin_print_styles() {
13 _enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__)); 13 _enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__));
14 } 14 }
15
16 public static function admin_print_scripts() {
17 _enqueue_script('jquery-alerts', Tools\url('jquery_alerts/jquery.alerts.js', __FILE__), Array('jquery'), '1.1');
18 _enqueue_script('colorbox', Tools\url('scripts/jquery.colorbox.js', __FILE__), Array('jquery'));
19
20 _enqueue_script('date', Tools\url('scripts/date.js', __FILE__));
21 _enqueue_script('jquery-datepicker', Tools\url('scripts/jquery.datePicker.js', __FILE__), Array('jquery','date'));
22 }
15 23
16 public static function admin_head() { 24 public static function admin_head() {
17 25
......
1 // jQuery Alert Dialogs Plugin
2 //
3 // Version 1.1
4 //
5 // Cory S.N. LaViska
6 // A Beautiful Site (http://abeautifulsite.net/)
7 // 14 May 2009
8 //
9 // Visit http://abeautifulsite.net/notebook/87 for more information
10 //
11 // Usage:
12 // jAlert( message, [title, callback] )
13 // jConfirm( message, [title, callback] )
14 // jPrompt( message, [value, title, callback] )
15 //
16 // History:
17 //
18 // 1.00 - Released (29 December 2008)
19 //
20 // 1.01 - Fixed bug where unbinding would destroy all resize events
21 //
22 // License:
23 //
24 // This plugin is dual-licensed under the GNU General Public License and the MIT License and
25 // is copyright 2008 A Beautiful Site, LLC.
26 //
27 (function($) {
28
29 $.alerts = {
30
31 // These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time
32
33 verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels
34 horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/
35 repositionOnResize: true, // re-centers the dialog on window resize
36 overlayOpacity: .01, // transparency level of overlay
37 overlayColor: '#FFF', // base color of overlay
38 draggable: true, // make the dialogs draggable (requires UI Draggables plugin)
39 okButton: ' OK ', // text for the OK button
40 cancelButton: ' Cancel ', // text for the Cancel button
41 dialogClass: null, // if specified, this class will be applied to all dialogs
42
43 // Public methods
44
45 alert: function(message, title, callback) {
46 if( title == null ) title = 'Alert';
47 $.alerts._show(title, message, null, 'alert', function(result) {
48 if( callback ) callback(result);
49 });
50 },
51
52 confirm: function(message, title, callback) {
53 if( title == null ) title = 'Confirm';
54 $.alerts._show(title, message, null, 'confirm', function(result) {
55 if( callback ) callback(result);
56 });
57 },
58
59 prompt: function(message, value, title, callback) {
60 if( title == null ) title = 'Prompt';
61 $.alerts._show(title, message, value, 'prompt', function(result) {
62 if( callback ) callback(result);
63 });
64 },
65
66 // Private methods
67
68 _show: function(title, msg, value, type, callback) {
69
70 $.alerts._hide();
71 $.alerts._overlay('show');
72
73 $("BODY").append(
74 '<div id="popup_container">' +
75 '<h1 id="popup_title"></h1>' +
76 '<div id="popup_content">' +
77 '<div id="popup_message"></div>' +
78 '</div>' +
79 '</div>');
80
81 if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
82
83 // IE6 Fix
84 var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed';
85
86 $("#popup_container").css({
87 position: pos,
88 zIndex: 99999,
89 padding: 0,
90 margin: 0
91 });
92
93 $("#popup_title").text(title);
94 $("#popup_content").addClass(type);
95 $("#popup_message").text(msg);
96 $("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') );
97
98 $("#popup_container").css({
99 minWidth: $("#popup_container").outerWidth(),
100 maxWidth: $("#popup_container").outerWidth()
101 });
102
103 $.alerts._reposition();
104 $.alerts._maintainPosition(true);
105
106 switch( type ) {
107 case 'alert':
108 $("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>');
109 $("#popup_ok").click( function() {
110 $.alerts._hide();
111 callback(true);
112 });
113 $("#popup_ok").focus().keypress( function(e) {
114 if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click');
115 });
116 break;
117 case 'confirm':
118 $("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
119 $("#popup_ok").click( function() {
120 $.alerts._hide();
121 if( callback ) callback(true);
122 });
123 $("#popup_cancel").click( function() {
124 $.alerts._hide();
125 if( callback ) callback(false);
126 });
127 $("#popup_ok").focus();
128 $("#popup_ok, #popup_cancel").keypress( function(e) {
129 if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
130 if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
131 });
132 break;
133 case 'prompt':
134 $("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>');
135 $("#popup_prompt").width( $("#popup_message").width() );
136 $("#popup_ok").click( function() {
137 var val = $("#popup_prompt").val();
138 $.alerts._hide();
139 if( callback ) callback( val );
140 });
141 $("#popup_cancel").click( function() {
142 $.alerts._hide();
143 if( callback ) callback( null );
144 });
145 $("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) {
146 if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
147 if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
148 });
149 if( value ) $("#popup_prompt").val(value);
150 $("#popup_prompt").focus().select();
151 break;
152 }
153
154 // Make draggable
155 if( $.alerts.draggable ) {
156 try {
157 $("#popup_container").draggable({ handle: $("#popup_title") });
158 $("#popup_title").css({ cursor: 'move' });
159 } catch(e) { /* requires jQuery UI draggables */ }
160 }
161 },
162
163 _hide: function() {
164 $("#popup_container").remove();
165 $.alerts._overlay('hide');
166 $.alerts._maintainPosition(false);
167 },
168
169 _overlay: function(status) {
170 switch( status ) {
171 case 'show':
172 $.alerts._overlay('hide');
173 $("BODY").append('<div id="popup_overlay"></div>');
174 $("#popup_overlay").css({
175 position: 'absolute',
176 zIndex: 99998,
177 top: '0px',
178 left: '0px',
179 width: '100%',
180 height: $(document).height(),
181 background: $.alerts.overlayColor,
182 opacity: $.alerts.overlayOpacity
183 });
184 break;
185 case 'hide':
186 $("#popup_overlay").remove();
187 break;
188 }
189 },
190
191 _reposition: function() {
192 var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset;
193 var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset;
194 if( top < 0 ) top = 0;
195 if( left < 0 ) left = 0;
196
197 // IE6 fix
198 if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop();
199
200 $("#popup_container").css({
201 top: top + 'px',
202 left: left + 'px'
203 });
204 $("#popup_overlay").height( $(document).height() );
205 },
206
207 _maintainPosition: function(status) {
208 if( $.alerts.repositionOnResize ) {
209 switch(status) {
210 case true:
211 $(window).bind('resize', $.alerts._reposition);
212 break;
213 case false:
214 $(window).unbind('resize', $.alerts._reposition);
215 break;
216 }
217 }
218 }
219
220 }
221
222 // Shortuct functions
223 jAlert = function(message, title, callback) {
224 $.alerts.alert(message, title, callback);
225 }
226
227 jConfirm = function(message, title, callback) {
228 $.alerts.confirm(message, title, callback);
229 };
230
231 jPrompt = function(message, value, title, callback) {
232 $.alerts.prompt(message, value, title, callback);
233 };
234
235 })(jQuery);
...\ No newline at end of file ...\ No newline at end of file
1 jQuery(function() {
2
3 Date.firstDayOfWeek = 0;
4 Date.format = 'yyyy-mm-dd';
5
6 if (jQuery('.datepicker').length > 0) {
7 jQuery('.datepicker').datePicker(
8 {
9 startDate: '1920-01-01',
10 endDate: (new Date()).asString()
11 }
12 );
13 }
14
15 jQuery('#admin-edit-user-profile').ajaxForm({
16 url: '/wp-admin/admin-ajax.php'
17 , data: ({ajax:"yes", action: 'update_edit_profile'})
18 , dataType: 'json'
19 , type: 'post'
20 , beforeSubmit: function(formData, jqForm, options) {
21 var $error_container = jQuery('.validation-errors');
22 $error_container.hide();
23 }
24 , success: function(data) {
25 if (data.success == "true") {
26 jQuery('.update-placeholder').html('Update Successful.');
27 } else {
28 //$('.register-form :input').removeAttr('disabled');
29 var $error_container = jQuery('.validation-errors');
30 jQuery('h6',$error_container).html("OOPS...");
31 jQuery('ul',$error_container).html(data.msg);
32 $error_container.show();
33 }
34 }
35 , error: function(XMLHttpRequest, textStatus, errorThrown) {
36 var $error_container = jQuery('.validation-errors');
37 jQuery('h6',$error_container).html("A server error has occurred.");
38 jQuery('ul',$error_container).html("<li>"+errorThrown+"</li>");
39 $error_container.show();
40 }
41 });
42
43 // overview ajaxForm...
44 jQuery('#overview_form').ajaxForm({
45 url: '/wp-admin/admin-ajax.php'
46 , data: ({ajax:"yes", action: 'update_account'})
47 , dataType: 'json'
48 , type: 'post'
49 , beforeSubmit: function(formData, jqForm, options) {
50 var $error_container = jQuery('.validation-errors');
51 $error_container.hide();
52 }
53 , success: function(data) {
54
55 if (data.success == "true") {
56 jQuery('.update-placeholder').html('Update Successful.');
57 } else {
58 //$('.register-form :input').removeAttr('disabled');
59 var $error_container = jQuery('.validation-errors');
60 jQuery('h6',$error_container).html("OOPS...");
61 jQuery('ul',$error_container).html(data.msg);
62 $error_container.show();
63 }
64 }
65 , error: function(XMLHttpRequest, textStatus, errorThrown) {
66 var $error_container = jQuery('.validation-errors');
67 jQuery('h6',$error_container).html("A server error has occurred.");
68 jQuery('ul',$error_container).html("<li>"+errorThrown+"</li>");
69 $error_container.show();
70 }
71 });
72
73 jQuery('.event-edit').colorbox({onComplete: function() {
74 var cb = this;
75 var options = {
76 beforeSubmit: function() {}
77 , success: function(data) {
78
79 if (data.refresh == "true") {
80 document.location.href = document.location.href;
81 } else {
82 jQuery.colorbox.close();
83 }
84
85 }
86 , data: ({ajax:"yes", action: 'update_registration'})
87 , dataType: 'json'
88 , url: '/wp-admin/admin-ajax.php'
89 };
90 jQuery('#edit-event-form').ajaxForm(options);
91 }});
92
93 jQuery('#admin_add_new_cehours').colorbox({onComplete: function() {
94 jQuery('.datepicker').datePicker(
95 {
96 startDate: '1920-01-01',
97 endDate: (new Date()).asString()
98 }
99 );
100
101 var options = {
102 success: function(data) {
103 document.location.href = document.location.href;
104 }
105 , data: ({ajax:"yes", action: 'admin_update_cehours'})
106 , dataType: 'json'
107 , url: '/wp-admin/admin-ajax.php'
108 };
109 jQuery('#edit-cehours-form').ajaxForm(options);
110
111 }});
112
113
114 jQuery('.cehours-edit').colorbox({onComplete: function() {
115 jQuery('.datepicker').datePicker(
116 {
117 startDate: '1920-01-01',
118 endDate: (new Date()).asString()
119 }
120 );
121
122 var options = {
123 success: function(data) {
124 document.location.href = document.location.href;
125 }
126 , data: ({ajax:"yes", action: 'admin_update_cehours'})
127 , dataType: 'json'
128 , url: '/wp-admin/admin-ajax.php'
129 };
130 jQuery('#edit-cehours-form').ajaxForm(options);
131
132 }});
133
134
135 jQuery('.cehours-remove').click(function(e) {
136
137 var ds = jQuery(this).attr('rel');
138
139 jConfirm('Are you sure?', 'Remove CE Hours?', function(c) {
140 if (c) {
141 jQuery.ajax({
142 url: '/wp-admin/admin-ajax.php'
143 , data: ({ajax:"yes", action: 'admin_remove_cehours', uid:user_id, indexed: ds})
144 , type: 'post'
145 , dataType: 'json'
146 , success: function(data) {
147 document.location.href = document.location.href;
148 }
149 });
150 }
151 });
152
153 e.preventDefault();
154 return false;
155
156 });
157
158 jQuery('.event-cancel').click(function(e) {
159 var eventcontainer = jQuery(this).parent();
160 var link = jQuery(this);
161
162 jConfirm('Are you sure?', 'Cancel Registration', function(c) {
163
164 if (c) {
165 eventcontainer.empty().addClass('spinner');
166
167 jQuery.ajax({
168 url: '/wp-admin/admin-ajax.php'
169 , data: ({ajax:"yes", action: 'cancel_registration', uid: user_id, eid: link.attr('rel')})
170 , type: 'post'
171 , success: function(data) {
172
173 if (data.ask_credit=="true") {
174 // ask if they want to credit....
175 jPrompt('How much (if any) would you like to credit their account?', '0.00', 'Registration has been cancelled', function(r) {
176 if( r ) {
177 jQuery.ajax({
178 url: '/wp-admin/admin-ajax.php'
179 , data: ({ajax:"yes", action: 'post_credit', uid:user_id, post_id: link.attr('rel'), amount:r})
180 , type: 'POST'
181 , dataType: 'json'
182 });
183 }
184 document.location.href = document.location.href;
185 });
186 } else {
187 document.location.href = document.location.href;
188 }
189
190 }
191 , dataType: 'json'
192 });
193
194 }
195
196 });
197
198 e.preventDefault();
199 return false;
200 });
201
202
203
204 });
...\ 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>Email:</th>
64 <td><input type="text" name="email" required /></td>
65 </tr>
66 <tr>
67 <th>First Name:</th>
68 <td><input type="text" name="first_name" required /></td>
69 </tr>
70 <tr>
71 <th>Last Name:</th>
72 <td><input type="text" name="last_name" id="create_last_name" required /></td>
73 </tr>
74 <tr>
75 <th>Country:</th>
76 <td>
77 <select name="country">
78 <?php HTML\select_opts_countries(); ?>
79 </select>
80 </td>
81 </tr>
82 <tr>
83 <th>Province:</th>
84 <td>
85 <select name="province">
86 <option disabled value="">Select a State/Province</option>
87 <optgroup label="Canada">
88 <?php HTML\select_opts_provinces(); ?>
89 </optgroup>
90
91 <optgroup label="United States">
92 <?php HTML\select_opts_states(); ?>
93 </optgroup>
94 </select>
95 </td>
96 </tr>
97 </tbody>
98 </table>
99
100 <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table" style="float:left; width:350px;">
101 <tbody>
102 <tr>
103 <th>User Type:</th>
104 <td>
105 <select name="user_role" id="create_user_role">
106 <?php foreach($roles as $roled=>$name):?>
107 <option value="<?php echo $roled;?>"><?php echo $name;?></option>
108 <?php endforeach;?>
109 </select>
110 </td>
111 </tr>
112 <tr id="create_member_id">
113 <th>Member ID:</th>
114 <td><input type="text" name="member_id" id="member_id" readonly="readonly" /></td>
115 </tr>
116 <tr><td colspan="2">&nbsp;</td></tr>
117 <tr>
118 <th>Password (twice):</th>
119 <td><input type="password" name="password" required /></td>
120 </tr>
121 <tr>
122 <th>&nbsp;</th>
123 <td><input type="password" name="password2" required /></td>
124 </tr>
125 </tbody>
126 </table>
127
128 <div style="clear:both;"></div>
129
130 <div class="validation-errors" style="display:none;margin-top:10px;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
131
132 <div style="margin-top:10px;padding-top:5px; border-top:1px solid #e8e8e8;">
133 <input type="submit" value="Create User" />
134 </div>
135
136 </form>
137 </div>
138
139 </div>
140
141 </div>
142
143 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
144 <script type="text/javascript">
145 var $ = jQuery;
146
147 var $role_selector = $('#create_user_role');
148 var $member_id_container = $('#create_member_id');
149 var $member_id_field = $('#member_id');
150 var $form = $('#admin-new-user-form');
151 var $last_name_field = $('#create_last_name');
152
153 function changedUserRole() {
154 if ($role_selector.val() == "member") {
155 updateMemberID();
156 $member_id_container.show();
157 } else {
158 $member_id_container.hide();
159 }
160 }
161
162 function updateMemberID() {
163 var lname = $last_name_field.val();
164 if ($role_selector.val() == "member") {
165 $.ajax({
166 url: '/wp-admin/admin-ajax.php'
167 , data: ({ajax:"yes", action: 'admin_create_member_id', last_name: lname})
168 , dataType: 'json'
169 , type: 'post'
170 , success: function(data) {
171 $member_id_field.val(data.member_id);
172 }
173 });
174 }
175 }
176
177 $(function() {
178 changedUserRole();
179
180 $('#create_last_name').blur(function() {
181 updateMemberID();
182 });
183
184 $role_selector.change(function() {
185 changedUserRole();
186 });
187
188 var options = {
189 url: '/wp-admin/admin-ajax.php'
190 , dataType: 'json'
191 , type: 'post'
192 , data: ({ajax:"yes", action: 'admin_create_user', section: 'create'})
193 , beforeSubmit: function(formData, jqForm, options) {
194 var $error_container = jQuery('.validation-errors');
195 $error_container.hide();
196 }
197 , success: function(data) {
198 if (data.success == "true") {
199 document.location.href=data.edit_profile
200 } else {
201 var $error_container = jQuery('.validation-errors');
202 jQuery('h6',$error_container).html("OOPS...");
203 jQuery('ul',$error_container).html(data.msg);
204 $error_container.show();
205 }
206
207 }
208 };
209 $form.ajaxForm(options);
210
211 });
212
213
214 </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 <div id="" class="wrap">
17 <div id="icon-users" class="icon32"><br /></div>
18 <h2>CBV User Manager <a href="/wp-admin/admin.php?page=cbv_users_create" class="button add-new-h2">Add New</a></h2>
19 <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>
20
21
22 <table cellspacing="0" class="widefat post fixed" style="margin-top:15px;">
23 <thead>
24 <tr>
25 <th scope="col" width="180" class="manage-column">Username</th>
26 <th scope="col" class="manage-column">Name</th>
27 <th scope="col" width="250" class="manage-column">Email</th>
28 <th scope="col" width="200" class="manage-column">Role</th>
29 </tr>
30 </thead>
31 <tbody>
32 <?php $users = get_users();
33
34 foreach($users as $user):
35
36 reset($user->roles);
37 $role = current($user->roles);
38
39
40 ?>
41 <tr>
42 <td><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $user['uid']?>"><?php echo $user['user_login']?></a></td>
43 <td><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $user['uid']?>"><?php echo $user['name']?></a></td>
44 <td><?php echo $user['email']?></td>
45 <td><?php echo $user['role']?></td>
46 </tr>
47 <?php endforeach; ?>
48 </body>
49 </table>
50
51
52
53
54 </div>
55 <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
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 $user = new WP_User($_GET['uid']);
16 reset($user->roles);
17 $role = current($user->roles);
18
19 $fname = get_user_meta($user->ID, 'first_name', true);
20 $lname = get_user_meta($user->ID, 'last_name', true);
21
22 if (empty($fname) || empty($lname)) {
23 $name = $user->user_login;
24 } else {
25 $name = $fname . " " . $lname;
26 }
27
28 $section = isset($_GET['section']) ? $_GET['section'] : "overview";
29
30
31 call_user_func(function() {
32 CBV\load('Events');
33 });
34
35 $member_id = get_user_meta($user->ID, 'member_id', true);
36 ?>
37 <style>
38
39 #post-body {
40 -moz-border-radius-bottomleft:6px;
41 -moz-border-radius-bottomright:6px;
42 -moz-border-radius-topright:6px;
43 background:none repeat scroll 0 0 #FFFFFF;
44 border-width:1px 1px 1px;
45 padding:10px;
46 }
47 #nav-menu-header, #post-body,#post-header {
48 border-color:#CCCCCC;
49 border-style:solid;
50 }
51
52 #menu-management .nav-tab {
53 background:none repeat scroll 0 0 #F4F4F4;
54 }
55
56 #menu-management .nav-tab-active {
57 background:none repeat scroll 0 0 #fff;
58 border-bottom-color:#fff;
59 }
60
61 </style>
62
63 <script type="text/javascript">var user_id = <?php echo $_GET['uid'];?>;</script>
64
65 <div id="" class="wrap">
66 <div id="icon-users" class="icon32"><br /></div>
67 <h2>Editing: <?php echo $name; ?>
68 <?php if ($role=="member" && !empty($member_id)) { echo '<span class="admin-member-id"> ('.$member_id.')</span>'; }?>
69 </h2>
70 <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>
71
72 <div id="menu-management" style="margin-top:25px;">
73 <div class="nav-tabs-nav">
74 <div class="nav-tabs-wrapper" class="section-<?php echo $_GET['section'];?>">
75 <div class="nav-tabs" style="padding: 0px; margin-left: 0px;">
76 <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>
77 <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>
78 <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>
79 <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>
80 <?php if ($role=="member"): ?>
81 <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>
82 <?php endif; ?>
83 <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">Payment History</a>
84 </div>
85 </div>
86 </div>
87
88 <div id="post-body" style="padding:0px 10px 15px 10px;">
89 <?php require_once('edit_user_' . $section . '.php'); ?>
90 </div>
91
92 </div>
93
94 </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 ?>
22 <div style="padding:10px 10px 0px 10px; min-width:760px;">
23 <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>
24
25 <?php
26 if (empty($cehours)) :
27 print "<p>No CE Hours recorded.</p>";
28 else:
29
30 ?>
31
32 <table cellspacing="0" class="widefat post fixed" style="margin-top:0px;">
33 <thead>
34 <tr>
35 <th scope="col" width="150">Date Recorded</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 $ce):
44 $ce_date = date('F j, Y',$ce['date']);
45 ?>
46 <tr>
47 <td><?php echo $ce_date; ?></td>
48 <td><?php echo $ce['activity']; ?></td>
49 <td><?php echo ($ce['type']=="structured") ? $ce['hours'] : 0;?></td>
50 <td><?php echo ($ce['type']=="unstructured") ? $ce['hours'] : 0;?></td>
51 <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 $ce['date'];?>" class="cehours-edit" rel="<?php echo $ce['date'];?>">edit</a> | <a href="#" class="cehours-remove" rel="<?php echo $ce['date'];?>">remove</a></td>
52 </tr>
53 <?php endforeach; ?>
54 </tbody>
55 </table>
56 <?php
57 endif;
58
59 ?>
60 </div>
61 <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 <div style="padding:10px 10px 0px 10px; min-width:760px;">
17 <h2 style="margin-bottom:10px;padding-bottom:0px;">Registered for Courses...</h2>
18 <em>Will be implemented when Courses is complete.</em>
19 </div>
20 <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 $event_date = get_post_meta($e->ID, 'event_date', true);
42 ?>
43 <tr>
44 <td><?php echo $e->post_title;?></td>
45 <td><?php echo date('F j, Y',$event_date);?></td>
46 <td><?php echo date('F j, Y',$event['register_date']);?></td>
47 <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>
48 </tr>
49 <?php endforeach; ?>
50 </tbody>
51 </table>
52
53 <h4 style="margin-bottom:5px;padding-bottom:0px; padding-left:10px;"><em>Not registered for...</em></h4>
54 <?php endif; ?>
55 <?php
56 $posts = query_posts(Array(
57 'post_type' => 'events'
58 , 'posts_per_page' => get_option('posts_per_page')
59 , 'paged' => (get_query_var('paged') ? get_query_var('paged') : 1)
60 , 'meta_key' => 'event_date'
61 , 'meta_compare' => '>'
62 , 'meta_value' => (time() + (60*60*24)) // event date + 1 day, so that they can register the day of...
63 , 'order' => 'DESC'
64 ));
65 ?>
66
67 <table cellspacing="0" class="widefat post fixed">
68 <thead>
69 <tr>
70 <th scope="col">Event Name</th>
71 <th scope="col" width="150">Event Date</th>
72 <th scope="col" width="150">Register By</th>
73 <th scope="col" width="100">Cost</th>
74 <th scope="col" width="100">&nbsp;</th>
75 </tr>
76 </thead>
77 <tbody>
78 <?php foreach($posts as $post):
79 if (!Events\is_attending($post->ID, $uid) && UAM\can_user_access($post->ID, $uid)):
80 $event_date = get_post_meta($post->ID, 'event_date', true);
81 $register_date = get_post_meta($post->ID, 'reg_deadline', true);
82 $cost = get_post_meta($post->ID,'cost',true);
83 if (empty($cost) || $cost < 1 || strtolower($cost)=="free") { $cost = 0; }
84 ?>
85 <tr>
86 <td><?php echo $post->post_title;?></td>
87 <td><?php echo date('F j, Y',$event_date);?></td>
88 <td><?php echo date('F j, Y',$register_date);?></td>
89 <td>$<?php echo number_format($cost,2);?></td>
90 <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>
91 </tr>
92 <?php endif; endforeach; ?>
93 </tbody>
94 </table>
95
96 </div>
97 <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, WP_Roles;
15
16 $uid = $user->ID;
17
18 $first_name = get_user_meta($uid, 'first_name', true);
19 $last_name = get_user_meta($uid, 'last_name', true);
20 $description = get_user_meta($uid, 'description', true);
21
22 // contact info.
23 $address = get_user_meta($uid, 'address', true);
24 $address2 = get_user_meta($uid, 'address2', true);
25 $city = get_user_meta($uid, 'city', true);
26 $province = get_user_meta($uid, 'province', true);
27 $postal = get_user_meta($uid, 'postal', true);
28 $country = get_user_meta($uid, 'country', true);
29 $phone = get_user_meta($uid, 'phone', true);
30 $fax = get_user_meta($uid, 'fax', true);
31 $mobile = get_user_meta($uid, 'mobile', true);
32 $email = get_user_meta($uid, 'email', true);
33
34 // professional stuff
35 $title = get_user_meta($uid, 'title', true);
36 $company = get_user_meta($uid, 'company', true);
37 $website = get_user_meta($uid, 'website', true);
38
39 // status
40 $status = get_user_meta($uid, 'status', true);
41
42 // membership
43 $member_id = get_user_meta($uid, 'member_id', true);
44
45 $notify_me = get_user_meta($uid, 'notify_me', true);
46
47
48 $rc = new WP_Roles();
49 $roles = $rc->role_names;
50 ksort($roles);
51 unset($rc, $roles['administrator']);
52
53
54 ?>
55
56 <div style="padding:10px 10px 0px 10px; min-width:760px;">
57 <h2 style="margin-bottom:10px;padding-bottom:0px;">Overview of Users' Account...</h2>
58 <div style="float:left; width:300px;margin-right:50px;">
59
60 <table cellspacing="0" class="widefat post fixed" style="border:none;">
61 <tbody>
62 <?php if (!empty($first_name)): ?>
63 <tr>
64 <th>First Name:</th>
65 <td><?php echo $first_name; ?></td>
66 </tr>
67 <?php endif; ?>
68
69 <?php if (!empty($last_name)): ?>
70 <tr>
71 <th>Last Name:</th>
72 <td><?php echo $last_name; ?></td>
73 </tr>
74 <?php endif; ?>
75
76 <?php if (!empty($company)): ?>
77 <tr>
78 <th>Company:</th>
79 <td><?php echo $company; ?></td>
80 </tr>
81 <?php endif; ?>
82
83 <?php if (!empty($title)): ?>
84 <tr>
85 <th>Title:</th>
86 <td><?php echo $title; ?></td>
87 </tr>
88 <?php endif; ?>
89
90 <?php if (!empty($address)): ?>
91 <tr>
92 <th>Address:</th>
93 <td><?php echo $address; if (!empty($address2)) { echo "<br />".$address2; }?></td>
94 </tr>
95 <?php endif; ?>
96
97 <?php if (!empty($city)): ?>
98 <tr>
99 <th>City:</th>
100 <td><?php echo $city; ?></td>
101 </tr>
102 <?php endif; ?>
103
104 <?php if (!empty($province)): ?>
105 <tr>
106 <th>Province:</th>
107 <td><?php echo $province; ?></td>
108 </tr>
109 <?php endif; ?>
110
111 <?php if (!empty($country)): ?>
112 <tr>
113 <th>Country:</th>
114 <td><?php echo $country; ?></td>
115 </tr>
116 <?php endif; ?>
117
118 <?php if (!empty($phone)): ?>
119 <tr>
120 <th>Phone:</th>
121 <td><?php echo $phone; ?></td>
122 </tr>
123 <?php endif; ?>
124
125 <?php if (!empty($fax)): ?>
126 <tr>
127 <th>Fax:</th>
128 <td><?php echo $fax; ?></td>
129 </tr>
130 <?php endif; ?>
131
132 <?php if (!empty($mobile)): ?>
133 <tr>
134 <th>Mobile:</th>
135 <td><?php echo $mobile; ?></td>
136 </tr>
137 <?php endif; ?>
138
139 <?php if (!empty($email)): ?>
140 <tr>
141 <th>Email:</th>
142 <td><?php echo $email; ?></td>
143 </tr>
144 <?php endif; ?>
145
146 <?php if (!empty($website)): ?>
147 <tr>
148 <th>Website:</th>
149 <td><?php echo $website; ?></td>
150 </tr>
151 <?php endif; ?>
152
153 </tbody>
154 </table>
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 <form method="post" id="overview_form">
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 Status:</h3>
169 <select name="status">
170 <option value="active" <?php echo ($status=="active") ? "selected" : ""; ?>>Active</option>
171 <option value="suspeneded" <?php echo ($status=="suspended") ? "selected" : ""; ?>>Suspended</option>
172 <option value="terminated" <?php echo ($status=="terminated") ? "selected" : ""; ?>>Terminated</option>
173 </select>
174
175 <div style="clear:both;"></div>
176
177 <?php if($role!="administrator"):?>
178 <h3 style="margin-bottom:5px; padding-bottom:0px;">Account Type:</h3>
179 <select name="user_role">
180 <?php foreach($roles as $roled=>$name):?>
181 <option value="<?php echo $roled;?>" <?php echo ($roled==$role) ? "selected" : "";?>><?php echo $name;?></option>
182 <?php endforeach;?>
183 </select>
184 <div style="clear:both;"></div>
185 <?php endif; ?>
186
187 <h3 style="margin-bottom:5px; padding-bottom:0px;">Change User Password:</h3>
188 <table cellpadding="0" cellspacing="0" border="0">
189 <tbody>
190 <tr>
191 <td width="150">New Password (twice)</td>
192 <td><input type="password" name="password1" value="" /></td>
193 </tr>
194 <tr>
195 <td>&nbsp;</td>
196 <td><input type="password" name="password2" value="" /></td>
197 </tr>
198 <tr><td colspan="2" style="font-size:11px;"><em>(leave them blank to not change their password)</em></td></tr>
199 </tbody>
200 </table>
201
202 <div style="clear:both;"></div>
203
204 <?php if ($role=="member"): ?>
205 <h3 style="margin-bottom:5px; padding-bottom:0px;">Special Status:</h3>
206 <input type="hidden" name="special_status_active" value="true" />
207 <table cellpadding="0" cellspacing="0" border="0">
208 <tbody>
209 <tr>
210 <td width="20"><input type="checkbox" id="status_retired" name="special_status[]" value="status_retired" <?php search_special_status('status_retired');?> /></td>
211 <td><label for="status_retired">Retired status</label></td>
212 </tr>
213 <tr>
214 <td width="20"><input type="checkbox" id="status_disability" name="special_status[]" value="status_disability" <?php search_special_status('status_disability');?> /></td>
215 <td><label for="status_disability">Disability status</label></td>
216 </tr>
217 <tr>
218 <td width="20"><input type="checkbox" id="status_parental" name="special_status[]" value="status_parental" <?php search_special_status('status_parental');?> /></td>
219 <td><label for="status_parental">Parental status</label></td>
220 </tr>
221 <tr>
222 <td width="20"><input type="checkbox" id="status_educational" name="special_status[]" value="status_educational" <?php search_special_status('status_educational');?> /></td>
223 <td><label for="status_educational">Educational status</label></td>
224 </tr>
225 </tbody>
226 </table>
227 <div style="clear:both;"></div>
228 <?php endif; ?>
229
230
231
232 <div class="validation-errors" style="display:none;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
233 <br />
234 <input type="submit" value="Update Account" /><span class="update-placeholder"></span>
235
236 </form>
237
238
239 </div>
240 </div>
241 <div style="clear:both;"></div>
242 </div>
243
244 <script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
245
246
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 <div style="padding:10px 10px 0px 10px; min-width:760px;">
17 <h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Invoices and Receipts...</h2>
18 <em>Will be implemented when Beanstream Integration is complete.</em>
19 </div>
20 <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\User;
7 use Tz\WordPress\CBV\CEHours;
8 use Tz\WordPress\CBV\Events;
9 use Tz\WordPress\UAM;
10 use Tz\WordPress\Tools\HTML;
11
12 use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
13 use Tz\WordPress\Tools\Notifications;
14
15 use Exception, StdClass;
16 use WP_User;
17
18 $user = new WP_User($_GET['uid']);
19
20 Tools\import('HTML');
21
22
23
24 $profile_preference = get_user_meta($user->ID, 'profile_preference', true);
25 $preference = get_user_meta($user->ID, 'email_address_preference', true);
26
27 ?>
28 <div style="padding:10px 10px 0px 10px; min-width:800px;" class="my-profile-edit">
29 <h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Profile...</h2>
30 <form name="admin-edit-user-profile" id="admin-edit-user-profile" style="margin-top:0;padding-top:0;">
31 <input type="hidden" name="section" value="profile" />
32 <input type="hidden" name="uid" value="<?php echo $user->ID;?>" />
33 <div style="float:left; width:400px;margin-right:20px;">
34
35 <h4>Personal Information</h4>
36 <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
37 <tbody>
38 <tr>
39 <th width="150">Prefix:</th>
40 <td>
41 <select name="prefix">
42 <?php HTML\select_opts_prefixes(get_user_meta($_GET['uid'], 'prefix', true)); ?>
43 </select>
44 </td>
45 </tr>
46 <tr>
47 <th width="150">First Name:</th>
48 <td><input type="text" name="first_name" value="<?php echo get_user_meta($_GET['uid'], 'first_name', true);?>" /></td>
49 </tr>
50 <tr>
51 <th>Last Name:</th>
52 <td><input type="text" name="last_name" value="<?php echo get_user_meta($_GET['uid'], 'last_name', true);?>" /></td>
53 </tr>
54 <tr>
55 <th>Degrees:</th>
56 <td><input type="text" name="degrees" value="<?php echo get_user_meta($_GET['uid'], 'degrees', true);?>" /></td>
57 </tr>
58 <tr>
59 <th>Biography:</th>
60 <td><textarea name="description"><?php echo get_user_meta($_GET['uid'], 'description', true);?></textarea></td>
61 </tr>
62 <tr>
63 <th>Date of Birth:</th>
64 <td><input type="text" name="date_of_birth" class="datepicker" value="<?php echo get_user_meta($_GET['uid'], 'date_of_birth', true);?>" /></td>
65 </tr>
66 </tbody>
67 </table>
68
69 <h4>Contact Information</h4>
70 <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
71 <tbody>
72 <tr>
73 <th width="150">&nbsp;</th>
74 <td><select name="profile_preference"><option value="Home" <?php echo ($profile_preference=="Home") ? "selected" : ""; ?>>Home&nbsp;</option><option value="Work" <?php echo ($profile_preference=="Work") ? "selected" : ""; ?>>Work&nbsp;</option></select></td>
75 </tr>
76 <tr>
77 <th>Address:</th>
78 <td><input type="text" name="address" value="<?php echo get_user_meta($_GET['uid'], 'address', true);?>" /></td>
79 </tr>
80 <tr>
81 <th>Suite:</th>
82 <td><input type="text" name="address2" value="<?php echo get_user_meta($_GET['uid'], 'address2', true);?>" /></td>
83 </tr>
84 <tr>
85 <th>City:</th>
86 <td><input type="text" name="city" value="<?php echo get_user_meta($_GET['uid'], 'city', true);?>" /></td>
87 </tr>
88 <tr>
89 <th>State/Province:</th>
90 <td>
91 <select name="province">
92 <option disabled value="">Select a State/Province</option>
93 <optgroup label="Canada">
94 <?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'province', true)); ?>
95 </optgroup>
96
97 <optgroup label="United States">
98 <?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'province', true)); ?>
99 </optgroup>
100 </select>
101 </td>
102 </tr>
103 <tr>
104 <th>Postal:</th>
105 <td><input type="text" name="postal" value="<?php echo get_user_meta($_GET['uid'], 'postal', true); ?>" /></td>
106 </tr>
107 <tr>
108 <th>Country:</th>
109 <td>
110 <select name="country">
111 <?php HTML\select_opts_countries(get_user_meta($_GET['uid'], 'country', true)); ?>
112 </select>
113 </td>
114 </tr>
115 <tr>
116 <th>Phone:</th>
117 <td><input type="text" name="phone" value="<?php echo get_user_meta($_GET['uid'], 'phone', true);?>" /></td>
118 </tr>
119 <tr>
120 <th>Fax:</th>
121 <td><input type="text" name="fax" value="<?php echo get_user_meta($_GET['uid'], 'fax', true);?>" /></td>
122 </tr>
123 <tr>
124 <th>Email:</th>
125 <td><input type="text" name="email" value="<?php echo get_user_meta($_GET['uid'], 'email', true);?>" /></td>
126 </tr>
127 <tr>
128 <th>Mobile:</th>
129 <td><input type="text" name="mobile" value="<?php echo get_user_meta($_GET['uid'], 'mobile', true);?>" /></td>
130 </tr>
131 </tbody>
132 </table>
133
134 </div>
135 <div style="float:left; width:350px;">
136 <h4>Notification Settings</h4>
137 <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
138 <tbody>
139 <tr>
140 <th width="150">Email for Notifications:</th>
141 <td>
142 <select name="email_address_preference">
143 <?php
144 $email = get_user_meta($_GET['uid'],'email',true);
145 ?>
146 <option value="none" <?php echo ($preference=="none") ? "selected" : "";?>>None</option>
147 <?php if(!empty($email)): ?><option value="email" <?php echo ($preference=="email") ? "selected" : "";?>><?php echo $email;?></option><?php endif;?>
148 </select>
149 </td>
150 </tr>
151 </tbody>
152 </table>
153 </div>
154
155
156
157 <div style="clear:both;"></div>
158 <div class="validation-errors" style="display:none;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
159 <br />
160 <input type="submit" value="Update Profile" /><span class="update-placeholder"></span>
161
162
163 </form>
164 </div>
165 <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 <!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 h3 {
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 5px 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 <h3>Edit <?php echo $name; ?>'s CE Hours:</h3>
38
39 <form method="post" action="" id="edit-cehours-form">
40 <input type="hidden" name="uid" value="<?php echo $uid; ?>" />
41 <input type="hidden" name="indexed" value="<?php echo $indexed; ?>" />
42 <input type="hidden" name="action" value="<?php echo $action; ?>" />
43
44
45 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
46 <div class="dashboard-section-links"></div>
47 <div class="dashboard-section-content small">
48 <table class="clean no-left-padding">
49 <tbody>
50 <tr>
51 <th width="100">Type:</th>
52 <td>
53 <select name="type">
54 <option value="structured" <?php echo ($type=="structured") ? "selected" : ""; ?>>Structured</option>
55 <option value="unstructured" <?php echo ($type=="unstructured") ? "selected" : ""; ?>>Unstructured</option>
56 </select>
57 </td>
58 </tr>
59 <tr>
60 <th>Date:</th>
61 <td><input type="text" class="datepicker" name="date" value="<?php echo $date;?>" /></td>
62 </tr>
63 <tr>
64 <th>Activity</th>
65 <td><input type="text" name="activity" value="<?php echo $activity;?>" /></td>
66 </tr>
67
68 <tr>
69 <th>Hours:</th>
70 <td><input type="text" name="hours" value="<?php echo $hours;?>" /></td>
71 </tr>
72 </tbody>
73 </table>
74
75 </div>
76 </div>
77
78 <div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
79 <div class="dashboard-section-title"></div>
80 <div class="dashboard-section-links"></div>
81 <div class="dashboard-section-content small">
82 <div><input type="submit" value="<?php echo ($action=="edit") ? "Update" : "Apply"; ?>" /></div>
83 </div>
84 </div>
85
86 </form>
87
88 </body>
89 </html>
...\ No newline at end of file ...\ No newline at end of file