You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWebMobile/Scripts/UserInfo.js

151 lines
7.1 KiB
JavaScript

3 years ago
var u = "";
var w = "";
var UrlParam = "";
var cacheKey = "";
var gid = "";
var companyid = "";
var winWidth = 0;
var winHeight = 0;
var cacheKey = "";
var _display = false;
var _height = 0;
function fnChange() {
if (_display) {
$(".companyName").hide();
$(".employeeICO").hide();
$("#btnShow").hide();
$("#btnHide").show();
$("#top").removeClass("compendiaryBackground");
$("#top").addClass("detailBackground");
$(".topCollection").css("height", "10em");
$("[rel='userInfoCollection']").hide();
_height = winHeight - 210;
if (_height < 0) { _height = 0; }
$("#detail").height(_height);
$("#mainCollection").height(_height);
$("#layCollection").height("550");
$("#detail").show();
}
else if (!_display) {
$(".companyName").show();
$(".employeeICO").show();
$("#btnShow").show();
$("#btnHide").hide();
$("#top").removeClass("detailBackground");
$("#top").addClass("compendiaryBackground");
$(".topCollection").css("width", winWidth);
$(".topCollection").css("height", winWidth * 1.0889);
$("[rel='userInfoCollection']").hide();
_height = winHeight - 442;
if (_height < 0) { _height = 0; }
$("#compendiary").height(_height);
$("#mainCollection").height(_height);
$("#layCollection").height(_height);
$("#compendiary").show();
}
_display = !_display;
}
$(function () {
winWidth = document.documentElement.clientWidth;
winHeight = document.documentElement.clientHeight;
$("#btnShow").show();
$("#btnHide").hide();
fnChange();
_display = true;
u = UrlParm.parm("u");
w = UrlParm.parm("w");
$.ajax({
type: "post",
dataType: "json",
url: "../../Handler/UserInfo.ashx?action=3&u=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), decrypt(u, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"))) + "&w=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), decrypt(w, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"))),
cache: false,
success: function (msg) {
$.each(msg, function (i, item) {
if (item.GID != "" && item.GID != undefined) {
$("#employeeName").html(item.CODENAME);
$("#employeeDept").html(item.DEPTNAME);
$("#txtShowName1").val(item.SHOWNAME);
$("#txtPassword1").val(item.PASSWORD);
$("#txtShowName2").val(item.SHOWNAME);
$("#txtPassword2").val(item.PASSWORD);
$("#txtQQ").val(item.QQ);
$("#txtMSN").val(item.MSN);
$("#txtOfficePhone").val(item.OFFICEPHONE);
$("#txtHomePhone").val(item.HOMEPHONE);
$("#txtMobile").val(item.MOBILE);
$("#txtFax").val(item.FAX);
$("#txtEmail").val(item.EMAIL1);
$("#txtEmailBackup").val(item.EMAIL2);
$("#txtPostcode").val(item.POSTCODE);
$("#txtHomeAddress").val(item.HOMEADDRESS);
$("#txtRemark").val(item.REMARK);
$("#txtEmergUser").val(item.EMERGUSER);
$("#txtEmergPhone").val(item.EMERGPHONE);
$("#txtEmergEmail").val(item.EMERGEMAIL);
}
});
}
});
$("#txtShowName1").blur(function () {
$("#txtShowName2").val($("#txtShowName1").val());
});
$("#txtPassword1").blur(function () {
$("#txtPassword2").val($("#txtPassword1").val());
});
$("#txtShowName2").blur(function () {
$("#txtShowName1").val($("#txtShowName2").val());
});
$("#txtPassword2").blur(function () {
$("#txtPassword1").val($("#txtPassword2").val());
});
});
function fnModify() {
var showName = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtShowName1").val());
var newPassword = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtPassword1").val());
var qq = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtQQ").val());
var msn = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtMSN").val());
var officePhone = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtOfficePhone").val());
var homePhone = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtHomePhone").val());
var mobile = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtMobile").val());
var fax = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtFax").val());
var email = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtEmail").val());
var emailBackup = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtEmailBackup").val());
var postcode = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtPostcode").val());
var homeAddress = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtHomeAddress").val());
var remark = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtRemark").val());
var emergUser = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtEmergUser").val());
var emergPhone = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtEmergPhone").val());
var emergEmail = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtEmergEmail").val());
UrlParam = "codeName=" + escape(jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), decrypt(u, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs")))) +
"&password=" + escape(jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), decrypt(w, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs")))) +
"&showName=" + escape(showName) + "&newPassword=" + escape(newPassword) + "&qq=" + escape(qq) + "&msn=" + escape(msn) + "&officePhone=" + escape(officePhone) +
"&homePhone=" + escape(homePhone) + "&mobile=" + escape(mobile) + "&fax=" + escape(fax) + "&email=" + escape(email) + "&emailBackup=" + escape(emailBackup) +
"&homeAddress=" + escape(homeAddress) + "&remark=" + escape(remark) + "&emergUser=" + escape(emergUser) + "&emergPhone=" + escape(emergPhone) +
"&emergEmail=" + escape(emergEmail) + "&postcode=" + escape(postcode);
$.ajax({
type: "post",
dataType: "json",
data: UrlParam,
url: "../../Handler/UserInfo.ashx?action=1",
cache: false,
success: function (msg) { }
});
}
function fnReturn() {
window.location.href = "/Home/Index?u=" + u + "&w=" + w;
}