Вход Регистрация
Файл: modules/user/edit.php
Строк: 127
<?
/**********************************
*    @package: PerfCMS              *
*    @year: 2012                      *
*    @author: Artas                  *
*    @link: http://perfcms.pp.ua      *
**********************************/
if(isset($user)) {
if(isset(
$_POST['save']) && $_GET['act']== 'save') {
$name substr(input($_POST['name']), 035);
$surname substr(input($_POST['surname']), 035);
$day substr(abs(intval($_POST['day'])), 02);
$month substr(abs(intval($_POST['month'])), 02);
$year substr(abs(intval($_POST['year'])), 04);
$device substr(input($_POST['device']), 065);
$icq substr(abs(intval($_POST['icq'])), 09);
$skype substr(input($_POST['skype']), 050);
$mmail substr(input($_POST['mmail']), 050);
$wmid substr(input($_POST['wmid']), 012);
$wmr substr(input($_POST['wmr']), 012);
$tel substr(input($_POST['tel']), 050);
$gender = ($_POST['gender'] == || $_POST['gender'] == abs(intval($_POST['gender'])) : 1);
$city substr(input($_POST['city']), 065);
$country substr(input($_POST['country']), 055);
$site1 substr(input($_POST['site']), 040);
$site str_replace('http://'''$site1);
$about_me substr(input($_POST['about_me']), 01000);
$db->query("UPDATE `users` SET  `name` = '"$name."', `surname` = '"$surname."', `skype` = '"$skype."', `tel` = '"$tel."', `mmail` = '"$mmail."', `wmid` = '"$wmid."', `wmr` = '"$wmr."', `day` = '"$day."', `month` = '"$month."', `year` = '"$year."', `device` = '"$device."', `icq` = '"$icq."', `city` = '"$city."', `country` = '"$country."', `site` = '"$site."', `gender` = '"$gender."', `info` = '"$about_me."' WHERE `id` = '".$user['id'] ."'");
// print_r($db->errorInfo());
go('/user/edit/?act=edited');
    }
$locate 'in_edit';
$title $lang->word('edit_profile');
require_once(
SYS.'/view/header.php');
if(
$_GET['act']=='edited') {$tpl->div('block'$lang->word('succ_save'));}
$tpl->div('title',  $lang->word('edit_profile'));
echo 
'<div class="post">
        <form action="?act=save" method="post">
         <u>'
$lang->word('name') .'</u>: <br/>
         <input type="text" name="name" value="'
$user['name'] .'" /><br/>
         <u>'
$lang->word('surname') .'</u>: <br/>
         <input type="text" name="surname" value="'
$user['surname'] .'" /><br/>
         <u>'
$lang->word('birth') .'</u>: <br/>
         <select name="day">
         <option value="0" '
.($user['day'] == '0' 'selected="selected"' NULL).'>0</option>';
         for(
$d 1$d<=31$d++) {
         echo 
"<option value="". $d ."" ".($user['day'] == $d 'selected="selected"' NULL).">"$d ."</option>n";
         }
         echo 
'</select>
         <select name="month">
         <option value="0" '
.($user['day'] == '0' 'selected="selected"' NULL).'>0</option>';
         for(
$m 1$m<=12$m++) {
         echo 
"<option value="". $m ."" ".($user['month'] == $m 'selected="selected"' NULL).">"$m ."</option>n";
         }
         echo 
'</select>
         <select name="year">
         <option value="0" '
.($user['day'] == '0' 'selected="selected"' NULL).'>0</option>';
         for(
$y 1960$y<=(date('Y')-1); $y++) {
         echo 
"<option value="". $y ."" ".($user['year'] == $y 'selected="selected"' NULL).">"$y ."</option>n";
         }
         echo 
'</select><br/>
         <u>'
$lang->word('gender') .'</u>: <br/>
         <select name="gender">
         <option value="1" '
.($user['gender'] == '1' 'selected="selected"' NULL).'>'$lang->word('male') .'</option>
         <option value="2" '
.($user['gender'] == '2' 'selected="selected"' NULL).'>'$lang->word('female') .'</option>
         </select><br/>
        <u>ICQ</u>: <br/>
         <input type="text" name="icq" value="'
$user['icq'] .'" /><br/>
         
<u>Skype</u>: <br/>
         <input type="text" name="skype" value="'
$user['skype'] .'" /><br/>
         

<u>E-Mail</u>: <br/>
         <input type="text" name="mmail" value="'
$user['mmail'] .'" /><br/>
        


<u>Мобильный номер</u>: <br/>
         <input type="text" name="tel" value="'
$user['tel'] .'" /><br/>
         





<b>WMID</b>: <br/>
         <input type="text" name="wmid" value="'
$user['wmid'] .'" /><br/>
         <b>WMR</b>: <br/>
         <input type="text" name="wmr" value="'
$user['wmr'] .'" /><br/>



<u>'
$lang->word('city') .'</u>: <br/>
         <input type="text" name="city" value="'
$user['city'] .'" /><br/>
         <u>'
$lang->word('country') .'</u>: <br/>
         <input type="text" name="country" value="'
$user['country'] .'" /><br/>
         <u>'
$lang->word('site') .'</u>: <br/>
         <input type="text" name="site" value="'
. (empty($user['site']) ? 'http://' $user['site']).'" /><br/>
         <input name="save" type="submit" value="'
$lang->word('save') .'" />
         </form>
</div>
         '
;
$tpl->div('block'NAV.'<a href="/user/panel/">'.$lang->word('user_panel').'</a><br/>'HICO .'<a href="/">'$lang->word('home') .'</a>');
require_once(
SYS.'/view/footer.php');
} else { 
go('/'); }
?>
Онлайн: 0
Реклама