16b32285 by Kevin Burton

updated UserManager for home/work contact information; added Sequencer;

1 parent ac96527b
......@@ -3,6 +3,7 @@ namespace Tz\WordPress\Tools\Notifications;
use Tz\Common;
use Tz\WordPress\Tools;
use Tz\WordPress\Tools\Sequencer;
use Tz\WordPress\CBV;
use WP_User;
use Exception, StdClass;
......@@ -228,7 +229,10 @@ function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),
if(empty($notices)) {
$notices = array();
}
$notices[] = $insert;
$sequence = Sequencer\generate('NTC');
$notices[$sequence] = $insert;
update_user_meta($user->ID,'notices',$notices);
......
<?php
/**
* ID Sequencer
*
* Generates a unique ID, based on a prefix code and a 7 digit zero-filled number in sequencial order
*
* @package WordPress
* @subpackage Sequencer
* @author Tenzing Communications Inc.
* @link http://www.gotenzing.com
*/
namespace Tz\WordPress\Tools\Sequencer;
use Tz, Tz\Common, Tz\WordPress\Tools;
use Exception;
call_user_func(function() {
Tools\add_actions(__NAMESPACE__ . '\Actions');
});
/**
* Generate New ID
*
* @param (String) Prefix (EVT, NCE, GRP)
* @return (String) ID
*/
function generate($prefix = "") {
global $wpdb;
$row = $wpdb->get_row("SELECT `current`,`end` FROM `".$wpdb->prefix."sequencer` WHERE `prefix`='".$prefix."'");
if (!empty($row)) {
$current = (int) $row->current;
$end = (int) $row->end;
$next = ($current + 1);
$allowable_length = 7;
if ($next >= $end) {
throw new Exception("The prefix [$prefix] has reached it's limit of: ".$end);
} else {
$length = strlen($next);
$zeros = $allowable_length - $length;
$return = "";
if ($zeros > 0) {
for($i=0; $i < $zeros; $i++) {
$return .= "0";
}
} else {
$return = "";
}
$wpdb->query("UPDATE `".$wpdb->prefix."sequencer` SET `current`=$next WHERE `prefix`='$prefix' LIMIT 1");
return $prefix.$return.$next;
}
} else {
$wpdb->query("INSERT INTO `".$wpdb->prefix."sequencer` (`prefix`,`start`,`end`,`current`) VALUES ('$prefix',0,9999999,0)");
generate($prefix);
}
}
/**
* Standard Action Class for WordPress
*
* Checks to see if the table exists in the database, if not, creates it.
*/
class Actions {
// Does the Sequencer table exist? If not, create it.
public static function init() {
global $wpdb;
$create_table_statement = "
CREATE TABLE IF NOT EXISTS `".$wpdb->prefix."sequencer` (
`prefix` varchar(3) NOT NULL,
`start` int(7) unsigned zerofill NOT NULL DEFAULT '0000000',
`end` int(7) unsigned zerofill NOT NULL DEFAULT '9999999',
`current` int(7) unsigned zerofill DEFAULT '0000000',
`last_used` int(16) NOT NULL DEFAULT '0',
PRIMARY KEY (`prefix`),
UNIQUE KEY `prefix` (`prefix`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
";
$wpdb->query($create_table_statement);
//$wpdb->query("INSERT INTO `wp_sequencer` (`prefix`, `start`, `end`, `current`, `last_used`) VALUES ('EVT', 0000000, 9999999, 0000000, 0),('NTC', 0000000, 9999999, 0000000, 0),('CEH', 0000000, 9999999, 0000000, 0);");
}
}
?>
\ No newline at end of file
......@@ -11,6 +11,7 @@ namespace Tz\WordPress\Tools\UserManager;
use Tz\Common;
use Tz\WordPress\Tools;
use Tz\WordPress\Tools\Auth;
use Tz\WordPress\Tools\Sequencer;
use Tz\WordPress\UAM;
use Tz\WordPress\Tools\HTML;
use Tz\WordPress\CBV;
......@@ -194,62 +195,102 @@ class ProfileValidation extends Common\Validation {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function address($val) {
public function home_address($val) {
update_user_meta($_POST['uid'], __FUNCTION__, User\clean_string($val));
}
public function address2($val) {
public function home_address2($val) {
update_user_meta($_POST['uid'], __FUNCTION__, User\clean_string($val));
}
public function city($val) {
public function home_city($val) {
update_user_meta($_POST['uid'], __FUNCTION__, User\clean_string($val));
}
public function province($val) {
public function home_province($val) {
if (empty($val)) {
throw new Exception('Province field can not be empty');
}
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function postal($val) {
public function home_postal($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function country($val) {
public function home_country($val) {
if (empty($val)) {
throw new Exception('Country field can not be empty');
}
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function phone($val) {
public function home_phone($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function fax($val) {
public function home_mobile($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function mobile($val) {
public function home_email($val) {
if (!empty($val)) {
if (!(boolean)preg_match(CBV\VALID_EMAIL, (string)$val)) {
throw new Exception('An invalid email address was entered in Email');
}
}
update_user_meta($_POST['uid'], 'home_email', $val);
}
public function work_address($val) {
update_user_meta($_POST['uid'], __FUNCTION__, User\clean_string($val));
}
public function work_address2($val) {
update_user_meta($_POST['uid'], __FUNCTION__, User\clean_string($val));
}
public function work_city($val) {
update_user_meta($_POST['uid'], __FUNCTION__, User\clean_string($val));
}
public function work_province($val) {
if (empty($val)) {
throw new Exception('Province field can not be empty');
}
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function work_postal($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function email($val) {
public function work_country($val) {
if (empty($val)) {
throw new Exception('Country field can not be empty');
}
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function work_phone($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function work_mobile($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function work_email($val) {
if (!empty($val)) {
if (!(boolean)preg_match(CBV\VALID_EMAIL, (string)$val)) {
throw new Exception('An invalid email address was entered in Email');
}
} else {
throw new Exception('Email field can not be empty');
}
// update user email.
wp_update_user( Array ('ID'=>$_POST['uid'] , 'user_email'=>$val) );
//update_user_meta($_POST['uid'], 'email', $val);
}
}
update_user_meta($_POST['uid'], 'work_email', $val);
}
public function company($val) {
update_user_meta($_POST['uid'],'company', User\clean_string($val));
......@@ -258,7 +299,10 @@ class ProfileValidation extends Common\Validation {
public function title($val) {
update_user_meta($_POST['uid'], 'title', User\clean_string($val));
}
public function fax($val) {
update_user_meta($_POST['uid'], __FUNCTION__, $val);
}
public function website($val) {
......@@ -438,13 +482,15 @@ class Actions {
if ($user_role != "member") { unset($_POST['member_id']); }
$password = $_POST['password']; unset($_POST['password']); unset($_POST['password2']);
$fp = strtolower($_POST['profile_preference'])."_";
// register the user.
$user_details = Array(
'first_name' => User\clean_string($_POST['first_name'])
, 'last_name' => User\clean_string($_POST['last_name'])
, 'province' => $_POST['province']
, 'country' => $_POST['country']
, 'email' => $email
, $fp.'province' => $_POST['province']
, $fp.'country' => $_POST['country']
, $fp.'email' => $email
);
unset($user_details['email']);
......@@ -622,8 +668,12 @@ class Actions {
$timestamp = CEHours\mysqldatetime_to_timestamp($_POST['date']);
if ($_POST['indexed']=="") {
$_POST['indexed'] = Sequencer\generate('KCB');
}
$cehours[$timestamp] = Array(
$cehours[$_POST['indexed']] = Array(
'type' => $_POST['type']
, 'date' => $timestamp
, 'activity' => $_POST['activity']
......
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2010 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.2.3
*/
(function($) {
var pasteEventName = ($.browser.msie ? 'paste' : 'input') + ".mask";
var iPhone = (window.orientation != undefined);
$.mask = {
//Predefined character definitions
definitions: {
'9': "[0-9]",
'a': "[A-Za-z]",
'*': "[A-Za-z0-9]"
}
};
$.fn.extend({
//Helper Function for Caret positioning
caret: function(begin, end) {
if (this.length == 0) return;
if (typeof begin == 'number') {
end = (typeof end == 'number') ? end : begin;
return this.each(function() {
if (this.setSelectionRange) {
this.focus();
this.setSelectionRange(begin, end);
} else if (this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', begin);
range.select();
}
});
} else {
if (this[0].setSelectionRange) {
begin = this[0].selectionStart;
end = this[0].selectionEnd;
} else if (document.selection && document.selection.createRange) {
var range = document.selection.createRange();
begin = 0 - range.duplicate().moveStart('character', -100000);
end = begin + range.text.length;
}
return { begin: begin, end: end };
}
},
unmask: function() { return this.trigger("unmask"); },
mask: function(mask, settings) {
if (!mask && this.length > 0) {
var input = $(this[0]);
var tests = input.data("tests");
return $.map(input.data("buffer"), function(c, i) {
return tests[i] ? c : null;
}).join('');
}
settings = $.extend({
placeholder: "_",
completed: null
}, settings);
var defs = $.mask.definitions;
var tests = [];
var partialPosition = mask.length;
var firstNonMaskPos = null;
var len = mask.length;
$.each(mask.split(""), function(i, c) {
if (c == '?') {
len--;
partialPosition = i;
} else if (defs[c]) {
tests.push(new RegExp(defs[c]));
if(firstNonMaskPos==null)
firstNonMaskPos = tests.length - 1;
} else {
tests.push(null);
}
});
return this.each(function() {
var input = $(this);
var buffer = $.map(mask.split(""), function(c, i) { if (c != '?') return defs[c] ? settings.placeholder : c });
var ignore = false; //Variable for ignoring control keys
var focusText = input.val();
input.data("buffer", buffer).data("tests", tests);
function seekNext(pos) {
while (++pos <= len && !tests[pos]);
return pos;
};
function shiftL(pos) {
while (!tests[pos] && --pos >= 0);
for (var i = pos; i < len; i++) {
if (tests[i]) {
buffer[i] = settings.placeholder;
var j = seekNext(i);
if (j < len && tests[i].test(buffer[j])) {
buffer[i] = buffer[j];
} else
break;
}
}
writeBuffer();
input.caret(Math.max(firstNonMaskPos, pos));
};
function shiftR(pos) {
for (var i = pos, c = settings.placeholder; i < len; i++) {
if (tests[i]) {
var j = seekNext(i);
var t = buffer[i];
buffer[i] = c;
if (j < len && tests[j].test(t))
c = t;
else
break;
}
}
};
function keydownEvent(e) {
var pos = $(this).caret();
var k = e.keyCode;
ignore = (k < 16 || (k > 16 && k < 32) || (k > 32 && k < 41));
//delete selection before proceeding
if ((pos.begin - pos.end) != 0 && (!ignore || k == 8 || k == 46))
clearBuffer(pos.begin, pos.end);
//backspace, delete, and escape get special treatment
if (k == 8 || k == 46 || (iPhone && k == 127)) {//backspace/delete
shiftL(pos.begin + (k == 46 ? (tests[pos.begin]?0:1) : -1));
return false;
} else if (k == 27) {//escape
input.val(focusText);
input.caret(0, checkVal());
return false;
}
};
function keypressEvent(e) {
if (ignore) {
ignore = false;
//Fixes Mac FF bug on backspace
return (e.keyCode == 8) ? false : null;
}
e = e || window.event;
var k = e.charCode || e.keyCode || e.which;
var pos = $(this).caret();
if (e.ctrlKey || e.altKey || e.metaKey) {//Ignore
return true;
} else if ((k >= 32 && k <= 125) || k > 186) {//typeable characters
var p = seekNext(pos.begin - 1);
if (p < len) {
var c = String.fromCharCode(k);
if (tests[p].test(c)) {
shiftR(p);
buffer[p] = c;
writeBuffer();
var next = seekNext(p);
$(this).caret(next);
if (settings.completed && next >= len)
settings.completed.call(input);
}
}
}
return false;
};
function clearBuffer(start, end) {
for (var i = start; i < end && i < len; i++) {
if (tests[i])
buffer[i] = settings.placeholder;
}
};
function writeBuffer() { return input.val(buffer.join('')).val(); };
function checkVal(allow) {
//try to place characters where they belong
var test = input.val();
var lastMatch = -1;
for (var i = 0, pos = 0; i < len; i++) {
if (tests[i]) {
buffer[i] = settings.placeholder;
while (pos++ < test.length) {
var c = test.charAt(pos - 1);
if (tests[i].test(c)) {
buffer[i] = c;
lastMatch = i;
break;
}
}
if (pos > test.length)
break;
} else if (buffer[i] == test.charAt(pos) && i!=partialPosition) {
pos++;
lastMatch = i;
}
}
if (!allow && lastMatch + 1 < partialPosition) {
input.val("");
clearBuffer(0, len);
} else if (allow || lastMatch + 1 >= partialPosition) {
writeBuffer();
if (!allow) input.val(input.val().substring(0, lastMatch + 1));
}
return (partialPosition ? i : firstNonMaskPos);
};
if (!input.attr("readonly"))
input
.one("unmask", function() {
input
.unbind(".mask")
.removeData("buffer")
.removeData("tests");
})
.bind("focus.mask", function() {
focusText = input.val();
var pos = checkVal();
writeBuffer();
setTimeout(function() {
if (pos == mask.length)
input.caret(0, pos);
else
input.caret(pos);
}, 0);
})
.bind("blur.mask", function() {
checkVal();
if (input.val() != focusText)
input.change();
})
.bind("keydown.mask", keydownEvent)
.bind("keypress.mask", keypressEvent)
.bind(pasteEventName, function() {
setTimeout(function() { input.caret(checkVal(true)); }, 0);
});
checkVal(); //Perform initial check for existing values
});
}
});
})(jQuery);
\ No newline at end of file
......@@ -60,10 +60,6 @@ unset($rc, $roles['administrator']);
<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>
......@@ -71,6 +67,15 @@ unset($rc, $roles['administrator']);
<th>Last Name:</th>
<td><input type="text" name="last_name" id="create_last_name" required /></td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<th>&nbsp;</th>
<td><select name="profile_preference" id="profile_preference"><option value="Home">Home&nbsp;</option><option value="Work">Work&nbsp;</option></select></td>
</tr>
<tr>
<th>Email:</th>
<td><input type="text" name="email" required /></td>
</tr>
<tr>
<th>Country:</th>
<td>
......
......@@ -40,7 +40,7 @@ else:
</tr>
</thead>
<tbody>
<?php foreach($cehours as $ce):
<?php foreach($cehours as $index=>$ce):
$ce_date = date('F j, Y',$ce['date']);
?>
<tr>
......@@ -48,7 +48,7 @@ else:
<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>
<td class="cehours-remove-td"><a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_cehour_form&uid=<?php echo $uid?>&indexed=<?php echo $index;?>" class="cehours-edit" rel="<?php echo $index;?>">edit</a> | <a href="#" class="cehours-remove" rel="<?php echo $index;?>">remove</a></td>
</tr>
<?php endforeach; ?>
</tbody>
......
......@@ -65,18 +65,117 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
</tr>
<tr>
<th>Date of Birth:<br /><span style="font-size:10px;color:#999;font-weight:normal;">(Ex. YYYY-MM-DD)</span></th>
<td><input type="text" name="date_of_birth" class="datepicker" value="<?php echo get_user_meta($_GET['uid'], 'date_of_birth', true);?>" /></td>
<td><input type="text" name="date_of_birth" class="datepicker" value="<?php echo get_user_meta($_GET['uid'], 'date_of_birth', true);?>" rel="mask-birthdate" /></td>
</tr>
</tbody>
</table>
<h4>Contact Information</h4>
<h4>Notification & Settings</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th width="150">&nbsp;</th>
<th width="150">Profile Preference</th>
<td><select name="profile_preference" id="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 width="150">Email for Notifications:</th>
<td>
<select name="email_address_preference">
<?php
$preference = get_user_meta($_GET['uid'], 'email_address_preference',true);
$home_email = get_user_meta($_GET['uid'],'home_email',true);
$work_email = get_user_meta($_GET['uid'],'work_email',true);
?>
<option value="none" <?php echo ($preference=="none") ? "selected" : "";?>>None</option>
<?php if(!empty($home_email)):?><option value="Home" <?php echo ($preference=="Home") ? "selected" : "";?>>Home > <?php echo $home_email;?></option><?php endif;?>
<?php if(!empty($work_email)):?><option value="Work"<?php echo ($preference=="Work") ? "selected" : "";?>>Work > <?php echo $work_email;?></option><?php endif;?>
</select>
</td>
</tr>
</tbody>
</table>
<?php if ($role=="member") :?>
<h4>Membership</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th width="150">Member Since:</th>
<td><input type="text" name="member_since" value="<?php echo get_user_meta($_GET['uid'], 'member_since', true);?>" /></td>
</tr>
</tbody>
</table>
<?php endif;?>
</div>
<div style="float:left; width:350px;"> <!-- RIGHT SIDE -->
<h4>Home Contact Information</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th>Address:</th>
<td><input type="text" name="home_address" value="<?php echo get_user_meta($_GET['uid'], 'home_address', true);?>" /></td>
</tr>
<tr>
<th>Suite:</th>
<td><input type="text" name="home_address2" value="<?php echo get_user_meta($_GET['uid'], 'home_address2', true);?>" /></td>
</tr>
<tr>
<th>City:</th>
<td><input type="text" name="home_city" value="<?php echo get_user_meta($_GET['uid'], 'home_city', true);?>" /></td>
</tr>
<tr>
<th>State/Province:</th>
<td>
<select name="home_province">
<option disabled value="">Select a State/Province</option>
<optgroup label="Canada">
<?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'home_province', true)); ?>
</optgroup>
<optgroup label="United States">
<?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'home_province', true)); ?>
</optgroup>
</select>
</td>
</tr>
<tr>
<th>Postal:</th>
<td><input type="text" name="home_postal" value="<?php echo get_user_meta($_GET['uid'], 'home_postal', true); ?>" /></td>
</tr>
<tr>
<th>Country:</th>
<td>
<select name="home_country">
<?php HTML\select_opts_countries(get_user_meta($_GET['uid'], 'home_country', true)); ?>
</select>
</td>
</tr>
<tr>
<th>Phone:</th>
<td><input type="text" name="home_phone" value="<?php echo get_user_meta($_GET['uid'], 'home_phone', true);?>" rel="mask-phone" /></td>
</tr>
<tr>
<th>Email:</th>
<td><input type="text" name="home_email" value="<?php echo get_user_meta($_GET['uid'], 'home_email', true);?>" /></td>
</tr>
<tr>
<th>Mobile:</th>
<td><input type="text" name="home_mobile" value="<?php echo get_user_meta($_GET['uid'], 'home_mobile', true);?>" rel="mask-phone" /></td>
</tr>
</tbody>
</table>
<h4>Work Contact Information</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr class="work-only">
<th>Company:</th>
<td><input type="text" name="company" value="<?php echo get_user_meta($_GET['uid'], 'company', true);?>" /></td>
......@@ -87,58 +186,58 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
</tr>
<tr>
<th>Address:</th>
<td><input type="text" name="address" value="<?php echo get_user_meta($_GET['uid'], 'address', true);?>" /></td>
<td><input type="text" name="work_address" value="<?php echo get_user_meta($_GET['uid'], 'work_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>
<td><input type="text" name="work_address2" value="<?php echo get_user_meta($_GET['uid'], 'work_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>
<td><input type="text" name="work_city" value="<?php echo get_user_meta($_GET['uid'], 'work_city', true);?>" /></td>
</tr>
<tr>
<th>State/Province:</th>
<td>
<select name="province">
<select name="work_province">
<option disabled value="">Select a State/Province</option>
<optgroup label="Canada">
<?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'province', true)); ?>
<?php HTML\select_opts_provinces(get_user_meta($_GET['uid'], 'work_province', true)); ?>
</optgroup>
<optgroup label="United States">
<?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'province', true)); ?>
<?php HTML\select_opts_states(get_user_meta($_GET['uid'], 'work_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>
<td><input type="text" name="work_postal" value="<?php echo get_user_meta($_GET['uid'], 'work_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 name="work_country">
<?php HTML\select_opts_countries(get_user_meta($_GET['uid'], 'work_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>
<td><input type="text" name="work_phone" value="<?php echo get_user_meta($_GET['uid'], 'work_phone', true);?>" rel="mask-phone" /></td>
</tr>
<tr>
<th>Fax:</th>
<td><input type="text" name="fax" value="<?php echo get_user_meta($_GET['uid'], 'fax', true);?>" /></td>
<td><input type="text" name="work_fax" value="<?php echo get_user_meta($_GET['uid'], 'work_fax', true);?>" rel="mask-phone" /></td>
</tr>
<tr>
<th>Email:</th>
<td><input type="text" name="email" value="<?php echo $user->user_email;?>" /></td>
<td><input type="text" name="work_email" value="<?php echo get_user_meta($_GET['uid'], 'work_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>
<td><input type="text" name="work_mobile" value="<?php echo get_user_meta($_GET['uid'], 'work_mobile', true);?>" rel="mask-phone" /></td>
</tr>
<tr class="work-only">
<th>Website:</th>
......@@ -146,38 +245,7 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
</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 = $user->user_email;
?>
<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>
<?php if ($role=="member") :?>
<h4>Membership</h4>
<table cellpadding="0" cellspacing="0" border="0" class="my-profile-table">
<tbody>
<tr>
<th width="150">Member Since:</th>
<td><input type="text" name="member_since" value="<?php echo get_user_meta($_GET['uid'], 'member_since', true);?>" /></td>
</tr>
</tbody>
</table>
<?php endif;?>
</div>
......@@ -191,12 +259,18 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
</form>
</div>
<script src="<?php echo Tools\url('../UserManager.js', __FILE__);?>" type="text/javascript"></script>
<script src="<?php echo Tools\url('../');?>"></script>
<script>
jQuery(function() {
jQuery(function($) {
$('input[rel="mask-phone"]').mask("999-999-9999");
$('input[rel="mask-birthdate"]').mask("9999-99-99");
/*
update_listing_preference();
jQuery('#profile_preference').change(function() {
update_listing_preference();
});
*/
});
</script>
\ No newline at end of file
......
......@@ -21,8 +21,10 @@
cursor: default;
padding: 0em; padding:3px 10px 3px 10px;
margin: 0em;
}
form {
display: block;
margin-right:20px;
......@@ -34,6 +36,8 @@
<body>
<div style="display:block; width:500px;">
<div class="title-link" style="display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;">Edit <?php echo $name; ?>'s CE Hours:</div>
<form method="post" action="" id="edit-cehours-form">
......@@ -69,21 +73,19 @@
<th>Hours:</th>
<td><input type="text" name="hours" value="<?php echo $hours;?>" /></td>
</tr>
<tr>
<th>&nbsp;</th>
<td><div><input type="submit" value="<?php echo ($action=="edit") ? "Update" : "Apply"; ?>" /></div> </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>
</div>
</body>
</html>
\ No newline at end of file
......