Вход Регистрация
Файл: Application/themes/default/js/js_d_myinformation.js
Строк: 357
<?php
function updatePersonalInfo(diverror,divok,bsubmit)
{
    $(
bsubmit).attr('disabled','true');

    
firstname=$.trim($('#firstname').val());
    if (
firstname == '') {
        $(
'#firstname').val(firstname);
        
openandclose(diverror,mi_pi_msg1,1700);
        $(
'#firstname').focus();
        
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 2000);
        return;
    }

    
lastname=$.trim($('#lastname').val());
    if (
lastname == '') {
        $(
'#lastname').val(lastname);
        
openandclose(diverror,mi_pi_msg2,1700);
        $(
'#lastname').focus();
        
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 2000);
        return;
    }


    
gender = $('#gender').val();
    if (
gender == 0) {
        
openandclose(diverror,mi_pi_msg3,1700);
        $(
'#gender').focus();
        
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 2000); 
        return;
    }
    
    
day = $('#day').val();
    
month = $('#month').val();    
    
year = $('#year').val();
    if (
day == || month == || year == 0) {
        
openandclose(diverror,mi_pi_msg4,1700);
        $(
'#year').focus();
        
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 2000); 
        return;
    }

    
    
xday day;
    
xmonth month;
    if (
day<10xday='0' day;
    if (
month<10xmonth='0' month;
    
caddate xday '/' xmonth '/' year;
    if (!
validatedate(caddate)) {
        
openandclose(diverror,mi_pi_msg5,1700);
        $(
'#year').focus();
        
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 2000); 
        return;
    }
    
    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=1&fn=' encodeURIComponent(firstname) + '&ln=' encodeURIComponent(lastname) + '&g=' gender '&b=' year '-' xmonth '-'xday,
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    
openandclose(divok,resp.substring(3),2000);
                    
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    
}

/**************************************************************************/

function updateAboutMe(diverror,divok,bsubmit)
{
    $(
bsubmit).attr('disabled','true');

    
aboutme=$.trim($('#aboutme').val());
    if (
aboutme == '') {
        $(
'#aboutme').val(aboutme);
        
openandclose(diverror,mi_am_msg1,1700);
        $(
'#aboutme').focus();
        
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 2000);
        return;
    }

    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=2&am=' encodeURIComponent(aboutme),
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    
openandclose(divok,resp.substring(3),2000);
                    
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    
}

/***********************************************************************/

function updateInfoAccess(diverror,divok,bsubmit)
{
    $(
bsubmit).attr('disabled','true');

    
currentpass = $('#currentpass').val();
    if (
currentpass == '') {
        
openandclose(diverror,mi_ia_msg1,1700);
        $(
'#currentpass').focus();
        
setTimeout(function() { $(bsubmit).removeAttr('disabled'); }, 2000);
        return;
    }

    
newpass = $('#newpass').val();
    if (
newpass == '') {
        
openandclose(diverror,mi_ia_msg2,1700);
        $(
'#newpass').focus();
        
setTimeout(function() { $(bsubmit).removeAttr('disabled'); }, 2000);
        return;
    }
    
    
newpass2 = $('#newpass2').val();
    if (
newpass2 == '') {
        
openandclose(diverror,mi_ia_msg3,1700);
        $(
'#newpass2').focus();
        
setTimeout(function() { $(bsubmit).removeAttr('disabled'); }, 2000);
        return;
    }
    
    if (
newpass != newpass2) {
        
openandclose(diverror,mi_ia_msg4,1700);
        $(
'#newpass2').focus();
        
setTimeout(function() { $(bsubmit).removeAttr('disabled'); }, 2000);
        return;
    }

    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=4&cp=' CryptoJS.MD5(currentpass) + '&np=' CryptoJS.MD5(newpass),
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    
openandclose(divok,resp.substring(3),2000);
                    $(
'#currentpass').val('');
                    $(
'#newpass').val('');
                    $(
'#newpass2').val('');
                    
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsubmit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    
}

/***********************************************************************/

function updateMyAvatar(diverrordivokbsumbit)
{
    $(
bsumbit).attr('disabled','true');

    
loadedimage=$.trim($('#loadedimage').val());
    if (
loadedimage == '') {
        
openandclose(diverror,mi_mav_msg3,1700);
        
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 2000); 
        return;
    }
    
    
didchanges=$('#didchanges').val();

    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=3&dch=' didchanges '&limg=' loadedimage,
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    $(
'#loadedimage').val(loadedimage);
                    $(
'#didchanges').val(0);
                    
oneimage = new Image();
                    
oneimage.src siteurl folderphotos loadedimage;
                    
openandclose(divok,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    

}

/***********************************************************************/

function updateMyCover(diverrordivokbsumbit)
{
    $(
bsumbit).attr('disabled','true');

    
loadedcover=$.trim($('#loadedcover').val());
    if (
loadedcover == '') {
        
openandclose(diverror,mi_mcov_msg3,1700);
        
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 2000); 
        return;
    }
    
    
didchangescov=$('#didchangescov').val();

    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=7&dch=' didchangescov '&limg=' loadedcover,
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    $(
'#loadedcover').val(loadedimage);
                    $(
'#didchangescov').val(0);
                    
oneimage = new Image();
                    
oneimage.src siteurl foldercovers loadedcover;
                    
openandclose(divok,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    

}

/***********************************************************************/


function updateLocation(diverrordivokbsumbit)
{
    $(
bsumbit).attr('disabled','true');

    
country = $('#country').val();
    if (
country == '0') {
        
openandclose(diverror,mi_lo_msg1,1700);
        $(
'#country').focus();
        
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 2000);
        return;
    }

    
region = $('#region').val();
    if (
region == '0') {
        
openandclose(diverror,mi_lo_msg2,1700);
        $(
'#region').focus();
        
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 2000);
        return;
    }
    
    
city = $.trim($('#city').val());
    if (
city == '') {
        $(
'#city').val(city);
        
openandclose(diverror,mi_lo_msg3,1700);
        $(
'#city').focus();
        
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 2000);
        return;
    }

    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=5&cc=' country '&r=' region '&c=' encodeURIComponent(city),
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    
openandclose(divok,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    
}

/***********************************************************************/

function updatePrivacy(diverrordivokbsumbit)
{
    $(
bsumbit).attr('disabled','true');

    
privacy = $('#privacy').val();

    $.
ajax({
        
type'POST',
        
urlsiteurl 'ajax/dashboard-myinformation/r:' Math.round(Math.random()*1000),
        
data'todo=6&p=' privacy,
        
success: function(resp){
            switch(
resp.charAt(0)){
                case 
'0':
                    
openandclose(diverror,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
                case 
'1':
                    
openandclose(divok,resp.substring(3),2000);
                    
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
                    break;
            }
        },
        
error: function(){
            
openandclose(diverror,mi_norequest,2000);
            
setTimeout(function() {$(bsumbit).removeAttr('disabled');}, 3000); 
        } 
//end error
    
}); // end ajax    
}

/***********************************************************************/
?>
Онлайн: 1
Реклама