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 {
public static function admin_print_styles() {
_enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__));
}
public static function admin_print_scripts() {
_enqueue_script('jquery-alerts', Tools\url('jquery_alerts/jquery.alerts.js', __FILE__), Array('jquery'), '1.1');
_enqueue_script('colorbox', Tools\url('scripts/jquery.colorbox.js', __FILE__), Array('jquery'));
_enqueue_script('date', Tools\url('scripts/date.js', __FILE__));
_enqueue_script('jquery-datepicker', Tools\url('scripts/jquery.datePicker.js', __FILE__), Array('jquery','date'));
}
public static function admin_head() {
......
// jQuery Alert Dialogs Plugin
//
// Version 1.1
//
// Cory S.N. LaViska
// A Beautiful Site (http://abeautifulsite.net/)
// 14 May 2009
//
// Visit http://abeautifulsite.net/notebook/87 for more information
//
// Usage:
// jAlert( message, [title, callback] )
// jConfirm( message, [title, callback] )
// jPrompt( message, [value, title, callback] )
//
// History:
//
// 1.00 - Released (29 December 2008)
//
// 1.01 - Fixed bug where unbinding would destroy all resize events
//
// License:
//
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
// is copyright 2008 A Beautiful Site, LLC.
//
(function($) {
$.alerts = {
// These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time
verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels
horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/
repositionOnResize: true, // re-centers the dialog on window resize
overlayOpacity: .01, // transparency level of overlay
overlayColor: '#FFF', // base color of overlay
draggable: true, // make the dialogs draggable (requires UI Draggables plugin)
okButton: ' OK ', // text for the OK button
cancelButton: ' Cancel ', // text for the Cancel button
dialogClass: null, // if specified, this class will be applied to all dialogs
// Public methods
alert: function(message, title, callback) {
if( title == null ) title = 'Alert';
$.alerts._show(title, message, null, 'alert', function(result) {
if( callback ) callback(result);
});
},
confirm: function(message, title, callback) {
if( title == null ) title = 'Confirm';
$.alerts._show(title, message, null, 'confirm', function(result) {
if( callback ) callback(result);
});
},
prompt: function(message, value, title, callback) {
if( title == null ) title = 'Prompt';
$.alerts._show(title, message, value, 'prompt', function(result) {
if( callback ) callback(result);
});
},
// Private methods
_show: function(title, msg, value, type, callback) {
$.alerts._hide();
$.alerts._overlay('show');
$("BODY").append(
'<div id="popup_container">' +
'<h1 id="popup_title"></h1>' +
'<div id="popup_content">' +
'<div id="popup_message"></div>' +
'</div>' +
'</div>');
if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
// IE6 Fix
var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed';
$("#popup_container").css({
position: pos,
zIndex: 99999,
padding: 0,
margin: 0
});
$("#popup_title").text(title);
$("#popup_content").addClass(type);
$("#popup_message").text(msg);
$("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') );
$("#popup_container").css({
minWidth: $("#popup_container").outerWidth(),
maxWidth: $("#popup_container").outerWidth()
});
$.alerts._reposition();
$.alerts._maintainPosition(true);
switch( type ) {
case 'alert':
$("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>');
$("#popup_ok").click( function() {
$.alerts._hide();
callback(true);
});
$("#popup_ok").focus().keypress( function(e) {
if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click');
});
break;
case 'confirm':
$("#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>');
$("#popup_ok").click( function() {
$.alerts._hide();
if( callback ) callback(true);
});
$("#popup_cancel").click( function() {
$.alerts._hide();
if( callback ) callback(false);
});
$("#popup_ok").focus();
$("#popup_ok, #popup_cancel").keypress( function(e) {
if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
});
break;
case 'prompt':
$("#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>');
$("#popup_prompt").width( $("#popup_message").width() );
$("#popup_ok").click( function() {
var val = $("#popup_prompt").val();
$.alerts._hide();
if( callback ) callback( val );
});
$("#popup_cancel").click( function() {
$.alerts._hide();
if( callback ) callback( null );
});
$("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) {
if( e.keyCode == 13 ) $("#popup_ok").trigger('click');
if( e.keyCode == 27 ) $("#popup_cancel").trigger('click');
});
if( value ) $("#popup_prompt").val(value);
$("#popup_prompt").focus().select();
break;
}
// Make draggable
if( $.alerts.draggable ) {
try {
$("#popup_container").draggable({ handle: $("#popup_title") });
$("#popup_title").css({ cursor: 'move' });
} catch(e) { /* requires jQuery UI draggables */ }
}
},
_hide: function() {
$("#popup_container").remove();
$.alerts._overlay('hide');
$.alerts._maintainPosition(false);
},
_overlay: function(status) {
switch( status ) {
case 'show':
$.alerts._overlay('hide');
$("BODY").append('<div id="popup_overlay"></div>');
$("#popup_overlay").css({
position: 'absolute',
zIndex: 99998,
top: '0px',
left: '0px',
width: '100%',
height: $(document).height(),
background: $.alerts.overlayColor,
opacity: $.alerts.overlayOpacity
});
break;
case 'hide':
$("#popup_overlay").remove();
break;
}
},
_reposition: function() {
var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset;
var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset;
if( top < 0 ) top = 0;
if( left < 0 ) left = 0;
// IE6 fix
if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop();
$("#popup_container").css({
top: top + 'px',
left: left + 'px'
});
$("#popup_overlay").height( $(document).height() );
},
_maintainPosition: function(status) {
if( $.alerts.repositionOnResize ) {
switch(status) {
case true:
$(window).bind('resize', $.alerts._reposition);
break;
case false:
$(window).unbind('resize', $.alerts._reposition);
break;
}
}
}
}
// Shortuct functions
jAlert = function(message, title, callback) {
$.alerts.alert(message, title, callback);
}
jConfirm = function(message, title, callback) {
$.alerts.confirm(message, title, callback);
};
jPrompt = function(message, value, title, callback) {
$.alerts.prompt(message, value, title, callback);
};
})(jQuery);
\ No newline at end of file
jQuery(function() {
Date.firstDayOfWeek = 0;
Date.format = 'yyyy-mm-dd';
if (jQuery('.datepicker').length > 0) {
jQuery('.datepicker').datePicker(
{
startDate: '1920-01-01',
endDate: (new Date()).asString()
}
);
}
jQuery('#admin-edit-user-profile').ajaxForm({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'update_edit_profile'})
, dataType: 'json'
, type: 'post'
, beforeSubmit: function(formData, jqForm, options) {
var $error_container = jQuery('.validation-errors');
$error_container.hide();
}
, success: function(data) {
if (data.success == "true") {
jQuery('.update-placeholder').html('Update Successful.');
} else {
//$('.register-form :input').removeAttr('disabled');
var $error_container = jQuery('.validation-errors');
jQuery('h6',$error_container).html("OOPS...");
jQuery('ul',$error_container).html(data.msg);
$error_container.show();
}
}
, error: function(XMLHttpRequest, textStatus, errorThrown) {
var $error_container = jQuery('.validation-errors');
jQuery('h6',$error_container).html("A server error has occurred.");
jQuery('ul',$error_container).html("<li>"+errorThrown+"</li>");
$error_container.show();
}
});
// overview ajaxForm...
jQuery('#overview_form').ajaxForm({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'update_account'})
, dataType: 'json'
, type: 'post'
, beforeSubmit: function(formData, jqForm, options) {
var $error_container = jQuery('.validation-errors');
$error_container.hide();
}
, success: function(data) {
if (data.success == "true") {
jQuery('.update-placeholder').html('Update Successful.');
} else {
//$('.register-form :input').removeAttr('disabled');
var $error_container = jQuery('.validation-errors');
jQuery('h6',$error_container).html("OOPS...");
jQuery('ul',$error_container).html(data.msg);
$error_container.show();
}
}
, error: function(XMLHttpRequest, textStatus, errorThrown) {
var $error_container = jQuery('.validation-errors');
jQuery('h6',$error_container).html("A server error has occurred.");
jQuery('ul',$error_container).html("<li>"+errorThrown+"</li>");
$error_container.show();
}
});
jQuery('.event-edit').colorbox({onComplete: function() {
var cb = this;
var options = {
beforeSubmit: function() {}
, success: function(data) {
if (data.refresh == "true") {
document.location.href = document.location.href;
} else {
jQuery.colorbox.close();
}
}
, data: ({ajax:"yes", action: 'update_registration'})
, dataType: 'json'
, url: '/wp-admin/admin-ajax.php'
};
jQuery('#edit-event-form').ajaxForm(options);
}});
jQuery('#admin_add_new_cehours').colorbox({onComplete: function() {
jQuery('.datepicker').datePicker(
{
startDate: '1920-01-01',
endDate: (new Date()).asString()
}
);
var options = {
success: function(data) {
document.location.href = document.location.href;
}
, data: ({ajax:"yes", action: 'admin_update_cehours'})
, dataType: 'json'
, url: '/wp-admin/admin-ajax.php'
};
jQuery('#edit-cehours-form').ajaxForm(options);
}});
jQuery('.cehours-edit').colorbox({onComplete: function() {
jQuery('.datepicker').datePicker(
{
startDate: '1920-01-01',
endDate: (new Date()).asString()
}
);
var options = {
success: function(data) {
document.location.href = document.location.href;
}
, data: ({ajax:"yes", action: 'admin_update_cehours'})
, dataType: 'json'
, url: '/wp-admin/admin-ajax.php'
};
jQuery('#edit-cehours-form').ajaxForm(options);
}});
jQuery('.cehours-remove').click(function(e) {
var ds = jQuery(this).attr('rel');
jConfirm('Are you sure?', 'Remove CE Hours?', function(c) {
if (c) {
jQuery.ajax({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'admin_remove_cehours', uid:user_id, indexed: ds})
, type: 'post'
, dataType: 'json'
, success: function(data) {
document.location.href = document.location.href;
}
});
}
});
e.preventDefault();
return false;
});
jQuery('.event-cancel').click(function(e) {
var eventcontainer = jQuery(this).parent();
var link = jQuery(this);
jConfirm('Are you sure?', 'Cancel Registration', function(c) {
if (c) {
eventcontainer.empty().addClass('spinner');
jQuery.ajax({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'cancel_registration', uid: user_id, eid: link.attr('rel')})
, type: 'post'
, success: function(data) {
if (data.ask_credit=="true") {
// ask if they want to credit....
jPrompt('How much (if any) would you like to credit their account?', '0.00', 'Registration has been cancelled', function(r) {
if( r ) {
jQuery.ajax({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'post_credit', uid:user_id, post_id: link.attr('rel'), amount:r})
, type: 'POST'
, dataType: 'json'
});
}
document.location.href = document.location.href;
});
} else {
document.location.href = document.location.href;
}
}
, dataType: 'json'
});
}
});
e.preventDefault();
return false;
});
});
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools;
use Tz\WordPress\Tools\HTML;
use Exception, StdClass;
use WP_User, WP_Roles;
Tools\import('HTML');
$rc = new WP_Roles();
$roles = $rc->role_names;
ksort($roles);
unset($rc, $roles['administrator']);
?>
<style>
#post-body {
-moz-border-radius-bottomleft:6px;
-moz-border-radius-bottomright:6px;
-moz-border-radius-topright:6px;
-moz-border-radius-topleft:6px;
background:none repeat scroll 0 0 #FFFFFF;
border-width:1px 1px 1px 1px;
padding:10px;
margin-top:20px;
}
#nav-menu-header, #post-body,#post-header {
border-color:#CCCCCC;
border-style:solid;
}
#menu-management .nav-tab {
background:none repeat scroll 0 0 #F4F4F4;
}
#menu-management .nav-tab-active {
background:none repeat scroll 0 0 #fff;
border-bottom-color:#fff;
}
</style>
<div id="" class="wrap">
<div id="icon-users" class="icon32"><br /></div>
<h2>Creating a new CBV User...</h2>
<div id="post-body">
<div style="padding:10px 10px 0px 10px; min-width:760px;">
<form method="post" id="admin-new-user-form">
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table" style="float:left; width:350px;">
<tbody>
<tr>
<th width="120px;">Username:</th>
<td><input type="text" name="username" required /></td>
</tr>
<tr>
<th>Email:</th>
<td><input type="text" name="email" required /></td>
</tr>
<tr>
<th>First Name:</th>
<td><input type="text" name="first_name" required /></td>
</tr>
<tr>
<th>Last Name:</th>
<td><input type="text" name="last_name" id="create_last_name" required /></td>
</tr>
<tr>
<th>Country:</th>
<td>
<select name="country">
<?php HTML\select_opts_countries(); ?>
</select>
</td>
</tr>
<tr>
<th>Province:</th>
<td>
<select name="province">
<option disabled value="">Select a State/Province</option>
<optgroup label="Canada">
<?php HTML\select_opts_provinces(); ?>
</optgroup>
<optgroup label="United States">
<?php HTML\select_opts_states(); ?>
</optgroup>
</select>
</td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table" style="float:left; width:350px;">
<tbody>
<tr>
<th>User Type:</th>
<td>
<select name="user_role" id="create_user_role">
<?php foreach($roles as $roled=>$name):?>
<option value="<?php echo $roled;?>"><?php echo $name;?></option>
<?php endforeach;?>
</select>
</td>
</tr>
<tr id="create_member_id">
<th>Member ID:</th>
<td><input type="text" name="member_id" id="member_id" readonly="readonly" /></td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<th>Password (twice):</th>
<td><input type="password" name="password" required /></td>
</tr>
<tr>
<th>&nbsp;</th>
<td><input type="password" name="password2" required /></td>
</tr>
</tbody>
</table>
<div style="clear:both;"></div>
<div class="validation-errors" style="display:none;margin-top:10px;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
<div style="margin-top:10px;padding-top:5px; border-top:1px solid #e8e8e8;">
<input type="submit" value="Create User" />
</div>
</form>
</div>
</div>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
<script type="text/javascript">
var $ = jQuery;
var $role_selector = $('#create_user_role');
var $member_id_container = $('#create_member_id');
var $member_id_field = $('#member_id');
var $form = $('#admin-new-user-form');
var $last_name_field = $('#create_last_name');
function changedUserRole() {
if ($role_selector.val() == "member") {
updateMemberID();
$member_id_container.show();
} else {
$member_id_container.hide();
}
}
function updateMemberID() {
var lname = $last_name_field.val();
if ($role_selector.val() == "member") {
$.ajax({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'admin_create_member_id', last_name: lname})
, dataType: 'json'
, type: 'post'
, success: function(data) {
$member_id_field.val(data.member_id);
}
});
}
}
$(function() {
changedUserRole();
$('#create_last_name').blur(function() {
updateMemberID();
});
$role_selector.change(function() {
changedUserRole();
});
var options = {
url: '/wp-admin/admin-ajax.php'
, dataType: 'json'
, type: 'post'
, data: ({ajax:"yes", action: 'admin_create_user', section: 'create'})
, beforeSubmit: function(formData, jqForm, options) {
var $error_container = jQuery('.validation-errors');
$error_container.hide();
}
, success: function(data) {
if (data.success == "true") {
document.location.href=data.edit_profile
} else {
var $error_container = jQuery('.validation-errors');
jQuery('h6',$error_container).html("OOPS...");
jQuery('ul',$error_container).html(data.msg);
$error_container.show();
}
}
};
$form.ajaxForm(options);
});
</script>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
?>
<div id="" class="wrap">
<div id="icon-users" class="icon32"><br /></div>
<h2>CBV User Manager <a href="/wp-admin/admin.php?page=cbv_users_create" class="button add-new-h2">Add New</a></h2>
<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>
<table cellspacing="0" class="widefat post fixed" style="margin-top:15px;">
<thead>
<tr>
<th scope="col" width="180" class="manage-column">Username</th>
<th scope="col" class="manage-column">Name</th>
<th scope="col" width="250" class="manage-column">Email</th>
<th scope="col" width="200" class="manage-column">Role</th>
</tr>
</thead>
<tbody>
<?php $users = get_users();
foreach($users as $user):
reset($user->roles);
$role = current($user->roles);
?>
<tr>
<td><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $user['uid']?>"><?php echo $user['user_login']?></a></td>
<td><a href="/wp-admin/admin.php?page=cbv_users&action=edit&uid=<?php echo $user['uid']?>"><?php echo $user['name']?></a></td>
<td><?php echo $user['email']?></td>
<td><?php echo $user['role']?></td>
</tr>
<?php endforeach; ?>
</body>
</table>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
$user = new WP_User($_GET['uid']);
reset($user->roles);
$role = current($user->roles);
$fname = get_user_meta($user->ID, 'first_name', true);
$lname = get_user_meta($user->ID, 'last_name', true);
if (empty($fname) || empty($lname)) {
$name = $user->user_login;
} else {
$name = $fname . " " . $lname;
}
$section = isset($_GET['section']) ? $_GET['section'] : "overview";
call_user_func(function() {
CBV\load('Events');
});
$member_id = get_user_meta($user->ID, 'member_id', true);
?>
<style>
#post-body {
-moz-border-radius-bottomleft:6px;
-moz-border-radius-bottomright:6px;
-moz-border-radius-topright:6px;
background:none repeat scroll 0 0 #FFFFFF;
border-width:1px 1px 1px;
padding:10px;
}
#nav-menu-header, #post-body,#post-header {
border-color:#CCCCCC;
border-style:solid;
}
#menu-management .nav-tab {
background:none repeat scroll 0 0 #F4F4F4;
}
#menu-management .nav-tab-active {
background:none repeat scroll 0 0 #fff;
border-bottom-color:#fff;
}
</style>
<script type="text/javascript">var user_id = <?php echo $_GET['uid'];?>;</script>
<div id="" class="wrap">
<div id="icon-users" class="icon32"><br /></div>
<h2>Editing: <?php echo $name; ?>
<?php if ($role=="member" && !empty($member_id)) { echo '<span class="admin-member-id"> ('.$member_id.')</span>'; }?>
</h2>
<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>
<div id="menu-management" style="margin-top:25px;">
<div class="nav-tabs-nav">
<div class="nav-tabs-wrapper" class="section-<?php echo $_GET['section'];?>">
<div class="nav-tabs" style="padding: 0px; margin-left: 0px;">
<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>
<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>
<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>
<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>
<?php if ($role=="member"): ?>
<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>
<?php endif; ?>
<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>
</div>
</div>
</div>
<div id="post-body" style="padding:0px 10px 15px 10px;">
<?php require_once('edit_user_' . $section . '.php'); ?>
</div>
</div>
</div>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
$uid = $_GET['uid'];
CBV\load('CEHours');
$cehours = CEHours\get_user_cehours($uid);
?>
<div style="padding:10px 10px 0px 10px; min-width:760px;">
<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>
<?php
if (empty($cehours)) :
print "<p>No CE Hours recorded.</p>";
else:
?>
<table cellspacing="0" class="widefat post fixed" style="margin-top:0px;">
<thead>
<tr>
<th scope="col" width="150">Date Recorded</th>
<th scope="col">Activity</th>
<th scope="col" width="150">Structured</th>
<th scope="col" width="100">Unstructured</th>
<th scope="col" width="100">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php foreach($cehours as $ce):
$ce_date = date('F j, Y',$ce['date']);
?>
<tr>
<td><?php echo $ce_date; ?></td>
<td><?php echo $ce['activity']; ?></td>
<td><?php echo ($ce['type']=="structured") ? $ce['hours'] : 0;?></td>
<td><?php echo ($ce['type']=="unstructured") ? $ce['hours'] : 0;?></td>
<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>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
endif;
?>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
?>
<div style="padding:10px 10px 0px 10px; min-width:760px;">
<h2 style="margin-bottom:10px;padding-bottom:0px;">Registered for Courses...</h2>
<em>Will be implemented when Courses is complete.</em>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
$uid = $_GET['uid'];
CBV\load('Events');
$events = get_user_meta($user->ID, 'events', true);
?>
<div style="padding:10px 10px 0px 10px; min-width:760px;">
<?php
if (empty($events) || count($events) < 1):
echo '<h2 style="margin-bottom:10px;padding-bottom:0px;">'.$name.' is not registered for any events...</h2>';
else: ?>
<h2 style="margin-bottom:10px;padding-bottom:0px;">Registered for Events...</h2>
<table cellspacing="0" class="widefat post fixed">
<thead>
<tr>
<th scope="col">Event Name</th>
<th scope="col" width="150">Event Date</th>
<th scope="col" width="150">Registered</th>
<th scope="col" width="100">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php foreach($user->events as $event):
$e = Events\get_event($event['event_id']);
$event_date = get_post_meta($e->ID, 'event_date', true);
?>
<tr>
<td><?php echo $e->post_title;?></td>
<td><?php echo date('F j, Y',$event_date);?></td>
<td><?php echo date('F j, Y',$event['register_date']);?></td>
<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>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<h4 style="margin-bottom:5px;padding-bottom:0px; padding-left:10px;"><em>Not registered for...</em></h4>
<?php endif; ?>
<?php
$posts = query_posts(Array(
'post_type' => 'events'
, 'posts_per_page' => get_option('posts_per_page')
, 'paged' => (get_query_var('paged') ? get_query_var('paged') : 1)
, 'meta_key' => 'event_date'
, 'meta_compare' => '>'
, 'meta_value' => (time() + (60*60*24)) // event date + 1 day, so that they can register the day of...
, 'order' => 'DESC'
));
?>
<table cellspacing="0" class="widefat post fixed">
<thead>
<tr>
<th scope="col">Event Name</th>
<th scope="col" width="150">Event Date</th>
<th scope="col" width="150">Register By</th>
<th scope="col" width="100">Cost</th>
<th scope="col" width="100">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php foreach($posts as $post):
if (!Events\is_attending($post->ID, $uid) && UAM\can_user_access($post->ID, $uid)):
$event_date = get_post_meta($post->ID, 'event_date', true);
$register_date = get_post_meta($post->ID, 'reg_deadline', true);
$cost = get_post_meta($post->ID,'cost',true);
if (empty($cost) || $cost < 1 || strtolower($cost)=="free") { $cost = 0; }
?>
<tr>
<td><?php echo $post->post_title;?></td>
<td><?php echo date('F j, Y',$event_date);?></td>
<td><?php echo date('F j, Y',$register_date);?></td>
<td>$<?php echo number_format($cost,2);?></td>
<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>
</tr>
<?php endif; endforeach; ?>
</tbody>
</table>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User, WP_Roles;
$uid = $user->ID;
$first_name = get_user_meta($uid, 'first_name', true);
$last_name = get_user_meta($uid, 'last_name', true);
$description = get_user_meta($uid, 'description', true);
// contact info.
$address = get_user_meta($uid, 'address', true);
$address2 = get_user_meta($uid, 'address2', true);
$city = get_user_meta($uid, 'city', true);
$province = get_user_meta($uid, 'province', true);
$postal = get_user_meta($uid, 'postal', true);
$country = get_user_meta($uid, 'country', true);
$phone = get_user_meta($uid, 'phone', true);
$fax = get_user_meta($uid, 'fax', true);
$mobile = get_user_meta($uid, 'mobile', true);
$email = get_user_meta($uid, 'email', true);
// professional stuff
$title = get_user_meta($uid, 'title', true);
$company = get_user_meta($uid, 'company', true);
$website = get_user_meta($uid, 'website', true);
// status
$status = get_user_meta($uid, 'status', true);
// membership
$member_id = get_user_meta($uid, 'member_id', true);
$notify_me = get_user_meta($uid, 'notify_me', true);
$rc = new WP_Roles();
$roles = $rc->role_names;
ksort($roles);
unset($rc, $roles['administrator']);
?>
<div style="padding:10px 10px 0px 10px; min-width:760px;">
<h2 style="margin-bottom:10px;padding-bottom:0px;">Overview of Users' Account...</h2>
<div style="float:left; width:300px;margin-right:50px;">
<table cellspacing="0" class="widefat post fixed" style="border:none;">
<tbody>
<?php if (!empty($first_name)): ?>
<tr>
<th>First Name:</th>
<td><?php echo $first_name; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($last_name)): ?>
<tr>
<th>Last Name:</th>
<td><?php echo $last_name; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($company)): ?>
<tr>
<th>Company:</th>
<td><?php echo $company; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($title)): ?>
<tr>
<th>Title:</th>
<td><?php echo $title; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($address)): ?>
<tr>
<th>Address:</th>
<td><?php echo $address; if (!empty($address2)) { echo "<br />".$address2; }?></td>
</tr>
<?php endif; ?>
<?php if (!empty($city)): ?>
<tr>
<th>City:</th>
<td><?php echo $city; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($province)): ?>
<tr>
<th>Province:</th>
<td><?php echo $province; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($country)): ?>
<tr>
<th>Country:</th>
<td><?php echo $country; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($phone)): ?>
<tr>
<th>Phone:</th>
<td><?php echo $phone; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($fax)): ?>
<tr>
<th>Fax:</th>
<td><?php echo $fax; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($mobile)): ?>
<tr>
<th>Mobile:</th>
<td><?php echo $mobile; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($email)): ?>
<tr>
<th>Email:</th>
<td><?php echo $email; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($website)): ?>
<tr>
<th>Website:</th>
<td><?php echo $website; ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<div style="float:left; width:360px; border-left: 1px solid #ccc;">
<div style="margin-left:20px; margin-bottom:20px;">
<!-- coming soon...
<h3 style="margin-bottom:5px; padding-bottom:0px;">Account Balance:</h3>
<div style="color:red; font-size:18px;">-$130.00</div>
-->
<form method="post" id="overview_form">
<input type="hidden" name="uid" value="<?php echo $uid; ?>" />
<input type="hidden" name="section" value="account" />
<h3 style="margin-bottom:5px; padding-bottom:0px;">Account Status:</h3>
<select name="status">
<option value="active" <?php echo ($status=="active") ? "selected" : ""; ?>>Active</option>
<option value="suspeneded" <?php echo ($status=="suspended") ? "selected" : ""; ?>>Suspended</option>
<option value="terminated" <?php echo ($status=="terminated") ? "selected" : ""; ?>>Terminated</option>
</select>
<div style="clear:both;"></div>
<?php if($role!="administrator"):?>
<h3 style="margin-bottom:5px; padding-bottom:0px;">Account Type:</h3>
<select name="user_role">
<?php foreach($roles as $roled=>$name):?>
<option value="<?php echo $roled;?>" <?php echo ($roled==$role) ? "selected" : "";?>><?php echo $name;?></option>
<?php endforeach;?>
</select>
<div style="clear:both;"></div>
<?php endif; ?>
<h3 style="margin-bottom:5px; padding-bottom:0px;">Change User Password:</h3>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td width="150">New Password (twice)</td>
<td><input type="password" name="password1" value="" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="password" name="password2" value="" /></td>
</tr>
<tr><td colspan="2" style="font-size:11px;"><em>(leave them blank to not change their password)</em></td></tr>
</tbody>
</table>
<div style="clear:both;"></div>
<?php if ($role=="member"): ?>
<h3 style="margin-bottom:5px; padding-bottom:0px;">Special Status:</h3>
<input type="hidden" name="special_status_active" value="true" />
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td width="20"><input type="checkbox" id="status_retired" name="special_status[]" value="status_retired" <?php search_special_status('status_retired');?> /></td>
<td><label for="status_retired">Retired status</label></td>
</tr>
<tr>
<td width="20"><input type="checkbox" id="status_disability" name="special_status[]" value="status_disability" <?php search_special_status('status_disability');?> /></td>
<td><label for="status_disability">Disability status</label></td>
</tr>
<tr>
<td width="20"><input type="checkbox" id="status_parental" name="special_status[]" value="status_parental" <?php search_special_status('status_parental');?> /></td>
<td><label for="status_parental">Parental status</label></td>
</tr>
<tr>
<td width="20"><input type="checkbox" id="status_educational" name="special_status[]" value="status_educational" <?php search_special_status('status_educational');?> /></td>
<td><label for="status_educational">Educational status</label></td>
</tr>
</tbody>
</table>
<div style="clear:both;"></div>
<?php endif; ?>
<div class="validation-errors" style="display:none;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
<br />
<input type="submit" value="Update Account" /><span class="update-placeholder"></span>
</form>
</div>
</div>
<div style="clear:both;"></div>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
?>
<div style="padding:10px 10px 0px 10px; min-width:760px;">
<h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Invoices and Receipts...</h2>
<em>Will be implemented when Beanstream Integration is complete.</em>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
\ No newline at end of file
<?php
namespace Tz\WordPress\Tools\UserManager;
use Tz, Tz\Common;
use Tz\WordPress\CBV;
use Tz\WordPress\CBV\User;
use Tz\WordPress\CBV\CEHours;
use Tz\WordPress\CBV\Events;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools\HTML;
use Tz\WordPress\Tools, Tz\WordPress\Tools\UserDetails as UD;
use Tz\WordPress\Tools\Notifications;
use Exception, StdClass;
use WP_User;
$user = new WP_User($_GET['uid']);
Tools\import('HTML');
$profile_preference = get_user_meta($user->ID, 'profile_preference', true);
$preference = get_user_meta($user->ID, 'email_address_preference', true);
?>
<div style="padding:10px 10px 0px 10px; min-width:800px;" class="my-profile-edit">
<h2 style="margin-bottom:10px;padding-bottom:0px;">Users' Profile...</h2>
<form name="admin-edit-user-profile" id="admin-edit-user-profile" style="margin-top:0;padding-top:0;">
<input type="hidden" name="section" value="profile" />
<input type="hidden" name="uid" value="<?php echo $user->ID;?>" />
<div style="float:left; width:400px;margin-right:20px;">
<h4>Personal Information</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th width="150">Prefix:</th>
<td>
<select name="prefix">
<?php HTML\select_opts_prefixes(get_user_meta($_GET['uid'], 'prefix', true)); ?>
</select>
</td>
</tr>
<tr>
<th width="150">First Name:</th>
<td><input type="text" name="first_name" value="<?php echo get_user_meta($_GET['uid'], 'first_name', true);?>" /></td>
</tr>
<tr>
<th>Last Name:</th>
<td><input type="text" name="last_name" value="<?php echo get_user_meta($_GET['uid'], 'last_name', true);?>" /></td>
</tr>
<tr>
<th>Degrees:</th>
<td><input type="text" name="degrees" value="<?php echo get_user_meta($_GET['uid'], 'degrees', true);?>" /></td>
</tr>
<tr>
<th>Biography:</th>
<td><textarea name="description"><?php echo get_user_meta($_GET['uid'], 'description', true);?></textarea></td>
</tr>
<tr>
<th>Date of Birth:</th>
<td><input type="text" name="date_of_birth" class="datepicker" value="<?php echo get_user_meta($_GET['uid'], 'date_of_birth', true);?>" /></td>
</tr>
</tbody>
</table>
<h4>Contact Information</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th width="150">&nbsp;</th>
<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>
</tr>
<tr>
<th>Address:</th>
<td><input type="text" name="address" value="<?php echo get_user_meta($_GET['uid'], 'address', true);?>" /></td>
</tr>
<tr>
<th>Suite:</th>
<td><input type="text" name="address2" value="<?php echo get_user_meta($_GET['uid'], 'address2', true);?>" /></td>
</tr>
<tr>
<th>City:</th>
<td><input type="text" name="city" value="<?php echo get_user_meta($_GET['uid'], 'city', true);?>" /></td>
</tr>
<tr>
<th>State/Province:</th>
<td>
<select name="province">
<option disabled value="">Select a State/Province</option>
<optgroup label="Canada">
<?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'province', true)); ?>
</optgroup>
<optgroup label="United States">
<?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'province', true)); ?>
</optgroup>
</select>
</td>
</tr>
<tr>
<th>Postal:</th>
<td><input type="text" name="postal" value="<?php echo get_user_meta($_GET['uid'], 'postal', true); ?>" /></td>
</tr>
<tr>
<th>Country:</th>
<td>
<select name="country">
<?php HTML\select_opts_countries(get_user_meta($_GET['uid'], 'country', true)); ?>
</select>
</td>
</tr>
<tr>
<th>Phone:</th>
<td><input type="text" name="phone" value="<?php echo get_user_meta($_GET['uid'], 'phone', true);?>" /></td>
</tr>
<tr>
<th>Fax:</th>
<td><input type="text" name="fax" value="<?php echo get_user_meta($_GET['uid'], 'fax', true);?>" /></td>
</tr>
<tr>
<th>Email:</th>
<td><input type="text" name="email" value="<?php echo get_user_meta($_GET['uid'], 'email', true);?>" /></td>
</tr>
<tr>
<th>Mobile:</th>
<td><input type="text" name="mobile" value="<?php echo get_user_meta($_GET['uid'], 'mobile', true);?>" /></td>
</tr>
</tbody>
</table>
</div>
<div style="float:left; width:350px;">
<h4>Notification Settings</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th width="150">Email for Notifications:</th>
<td>
<select name="email_address_preference">
<?php
$email = get_user_meta($_GET['uid'],'email',true);
?>
<option value="none" <?php echo ($preference=="none") ? "selected" : "";?>>None</option>
<?php if(!empty($email)): ?><option value="email" <?php echo ($preference=="email") ? "selected" : "";?>><?php echo $email;?></option><?php endif;?>
</select>
</td>
</tr>
</tbody>
</table>
</div>
<div style="clear:both;"></div>
<div class="validation-errors" style="display:none;"><div class="error-wrap"><h6>OOPS...</h6><ul></ul></div></div>
<br />
<input type="submit" value="Update Profile" /><span class="update-placeholder"></span>
</form>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Edit CE Hours</title>
<style type="text/css">
html, body { margin:0px; padding:0;}
h3 {
color:#f7bd55;
font-size: 12px;
font-weight: bold;
text-align: left;
line-height: 1.75em;
background: #3b0d32;
border: solid 1px #FFF;
border-bottom: solid 1px #999;
cursor: default;
padding: 0em; padding:3px 5px 3px 10px;
margin: 0em;
}
form {
display: block;
margin-right:20px;
}
.dashboard-section-title { font-weight:bold; color:#3b0d32; }
</style>
</head>
<body>
<h3>Edit <?php echo $name; ?>'s CE Hours:</h3>
<form method="post" action="" id="edit-cehours-form">
<input type="hidden" name="uid" value="<?php echo $uid; ?>" />
<input type="hidden" name="indexed" value="<?php echo $indexed; ?>" />
<input type="hidden" name="action" value="<?php echo $action; ?>" />
<div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
<div class="dashboard-section-links"></div>
<div class="dashboard-section-content small">
<table class="clean no-left-padding">
<tbody>
<tr>
<th width="100">Type:</th>
<td>
<select name="type">
<option value="structured" <?php echo ($type=="structured") ? "selected" : ""; ?>>Structured</option>
<option value="unstructured" <?php echo ($type=="unstructured") ? "selected" : ""; ?>>Unstructured</option>
</select>
</td>
</tr>
<tr>
<th>Date:</th>
<td><input type="text" class="datepicker" name="date" value="<?php echo $date;?>" /></td>
</tr>
<tr>
<th>Activity</th>
<td><input type="text" name="activity" value="<?php echo $activity;?>" /></td>
</tr>
<tr>
<th>Hours:</th>
<td><input type="text" name="hours" value="<?php echo $hours;?>" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="dashboard-section" style="margin-left:20px;margin-top:10px;">
<div class="dashboard-section-title"></div>
<div class="dashboard-section-links"></div>
<div class="dashboard-section-content small">
<div><input type="submit" value="<?php echo ($action=="edit") ? "Update" : "Apply"; ?>" /></div>
</div>
</div>
</form>
</body>
</html>
\ No newline at end of file