Файл: billing/_rootbill/_settings.inc.php
Строк: 204
<?
        if ($sub == 'edit') {
        if (!valid_email($email)) {$error="<font color=red>".$_lang[ProfileErrorBadEmail]."</font>";}
        else if ($email2 and !valid_email($email2)) {$error="<font color=red>".$_lang[ProfileErrorBadEmail2]."</font>";}
        else {
                    if($passwd) {
                            mysql_query("UPDATE users SET password = '".crypt($passwd)."' WHERE id = '".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                    }
                    if($codeWord) {
                            mysql_query("UPDATE users SET codeWord = '$codeWord' WHERE id = '".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                    }
                    if($newlang) {
                            mysql_query("UPDATE users SET lang = '$newlang' WHERE id = '".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                    }
            if ($userCurrency != $oldCurrency) {
                            @mysql_query("UPDATE users SET currency = '$userCurrency' WHERE id = '".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                $_SESSION["userCurrency"]=$userCurrency;
            }
                    if ($news) {$newstomysql="1";}
                    else {$newstomysql="0";}
                    
                        @mysql_query("UPDATE users SET email = '$email', email2='$email2', news='$newstomysql', icq='$icq', skype='$skype', wmz='$wmz', wmr='$wmr',autoRenew='$autoRenew' WHERE id = '".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                        $error=$_lang[ProfileChangeSuccess];
        }
        }
        _head('utf-8',$_lang[SettinsTitle]);
//    print "<H1 class=pagetitle>".$_lang[SettinsTitle]."</H1><hr class=hr>";
        if ($error) {print "$error<BR><BR>";}
        $s=@mysql_query("select * from users where id = '".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
        $t=mysql_fetch_object($s);
    if ($sub != "edit") {
        $email = $t->email;
        $email2 = $t->email2;
        $icq = $t->icq;
        $skype = $t->skype;
        $wmz = $t->wmz;
        $wmr = $t->wmr;
        $autoRenew = $t->autoRenew;
    }
        
        if ($t->news) {$newscheckbox = "checked";}
        else {$newscheckbox = "";}
        echo "
        <table class='rpTable' border=1 width=449 align=center><form method=post>
        <input type=hidden name=do value=$do>
        <input type=hidden name=sub value=edit>
    <input type=hidden name=oldCurrency value='".$t->currency."'>
    ";
        print "<tr><th colspan=2 align=center><B>".$_lang[ProfileUserSettings]."</b></th></tr>";
        print "<tr><td width=160>".$_lang[ProfileCurrency].":</td><td><select class=input name=userCurrency><option>".$_lang[ProfileDefaultCurrency]."</option>";
    if (GetSetting("usersChangeCurrency")) {
        $r = GetCurrencys();
        while ($rr = mysql_fetch_object($r)) {
            if ($rr->code == $t->currency) { $selected = "selected"; } else { $selected = ""; }
            print "<option value='$rr->code' $selected>$rr->name</option>";
        }
    }
    print "</select></td></tr>";
    if (GetSetting("lngUsersCanChange") and GetSetting("lngSelectAtProfile")) {
        print "<tr><td>".$_lang[Language].":</td><td>"; printLanguagesSelet($t->lang); print "</td></tr>";
    }
        print "<tr><td>".$_lang[ProfileNewSubscribe].":</td><td><input class=input type=checkbox $newscheckbox name=news size=40> ".$_lang[Yes]."</td></tr>";
    if (GetSetting("autoRenewClientChange")) {
        $autoRenewEnable=GetSetting("autoRenewEnable");
        if ($autoRenew == "1" or ($autoRenew == "0" and $autoRenewEnable)) {$yescheck = "checked";}
        if ($autoRenew == "2" or ($autoRenew == "0" and !$autoRenewEnable)) {$nocheck = "checked";}
            print "<tr><td>".$_lang[ProfileAutoRenew].":</td><td><input class=input type=radio name=autoRenew value=1 $yescheck> ".$_lang[ProfileAutoRenewYes]." <input class=input type=radio name=autoRenew value=2 $nocheck> ".$_lang[ProfileAutoRenewNo]."</td></tr>";
    }
        print "<tr><td>".$_lang[ProfileWMZ].":</td><td><input class=input type=text name=wmz value="$wmz" size=40></td></tr>";
        print "<tr><td>".$_lang[ProfileWMR].":</td><td><input class=input type=text name=wmr value="$wmr" size=40></td></tr>";
    if (!$t->codeWord) {
        print "
            <tr><th colspan=2 align=center><B>".$_lang[ProfileCodeWord]."</b></th></tr>
            <tr><td valign=top>".$_lang[ProfileCodeWord].":</td><td><input class=input type=text name=codeWord value="" size=40><p style="$styleHelp">".$_lang[ProfileCodeWordComment]."</td></tr>
        ";
    }
        print "<tr><th colspan=2 align=center><B>".$_lang[ProfileContactInfo]."</b></th></tr>
        <tr><td>".$_lang[ProfileEmail].":</td><td><input class=input type=text name=email value="$email" size=40></td></tr>
        <tr><td>".$_lang[ProfileEmail2].":</td><td><input class=input type=text name=email2 value="$email2" size=40></td></tr>
        <tr><td>".$_lang[ProfileICQ].":</td><td><input class=input type=text name=icq value="$icq" size=40></td></tr>
        <tr><td>".$_lang[ProfileSKYPE].":</td><td><input class=input type=text name=skype value="$skype" size=40></td></tr>";
    print "<tr><th colspan=2 align=center><B>".$_lang[ProfileChangePassword]."</b></th></tr>
        <tr><td>".$_lang[ProfileNewPassword].":</td><td><input class=input type=password name=passwd size=40></td></tr>";
        print "<tr><th colspan=2 align=center><input class=button type=Submit value='".$_lang[Save]."'></th></tr></table></form>";
       
        _foot('utf-8');
?>