xwt.theme("xwt.standard", "org.xwt.themes.monopoly");
xwt.thread = function() {
$username.disabled = true;
$password.disabled = true;
$username.focused = true;
$username.disabled = false;
$password.disabled = false;
}
lastusername = "";
_checkusername = function(x) {
if(root.lastusername == $username.text)
return;
root.lastusername = $username.text;
if($username.text != "") {
xwt.thread = function() {
root.whocares = false;
$statusline.text = "Retrieving user information...";
var result =
xwt.xmlrpc('http://xmlrpc.geeksanon.ca/tc.php').timeclock.Info($username.text);
if(!root.whocares)
$statusline.text = result.message;
}
}
}
_fieldsoff = function(x) {
$clockin.disabled = x;
$clockout.disabled = x;
$report.disabled = x;
$username.disabled = x;
$password.disabled = x;
if(!x) {
xwt.thread = function() {
var removeuser = $username.text;
xwt.sleep(15000);
if(removeuser == $username.text) {
$username.text = "";
$password.text = "";
}
}
}
}
$clockin._click = function() {
if($username.text == "" || $password.text == "") {
$statusline.text = 'Username and password required.';
return;
}
xwt.thread = function() {
root.whocares = true;
root.fieldsoff = true;
$statusline.text = "Contacting server to clock in '" + $username.text + "'...";
var result = xwt.xmlrpc('http://xmlrpc.geeksanon.ca/tc.php').timeclock.Clock.In($username.text, $password.text);
$statusline.text = result.message;
$username.focused = true;
root.fieldsoff = false;
}
}
$clockout._click = function() {
if($username.text == "" || $password.text == "") {
$statusline.text = 'Username and password required.';
return;
}
xwt.thread = function() {
root.whocares = true;
root.fieldsoff = true;
$statusline.text = "Contacting server to clock out '" + $username.text + "'...";
var result = xwt.xmlrpc('http://xmlrpc.geeksanon.ca/tc.php').timeclock.Clock.Out($username.text, $password.text);
$statusline.text = result.message;
$username.focused = true;
root.fieldsoff = false;
}
}
$report._click = function() {
if($username.text == "" || $password.text == "") {
$statusline.text = 'Username and password required.';
return;
}
xwt.thread = function() {
root.whocares = true;
root.fieldsoff = true;
$statusline.text = "Retrieving report for '" + $username.text + "'...";
var result = xwt.xmlrpc('http://xmlrpc.geeksanon.ca/tc.php').timeclock.Info($username.text);
$statusline.text = result.message;
$username.focused = true;
root.fieldsoff = false;
}
}
$exit._click = function() { root.Close = true; }
_focused = function(x) {
root.checkusername = true;
}
_focused = function(x) {
root.checkusername = true;
}