Вход Регистрация
Файл: _modules/setting/anketa/index.php
Строк: 89
<?php

    
# mark core  v1.0
    # author Drk in
    # date 24.10.19     

    # core

    
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );

    
# user

    
system::access(true);

    
# meta

    
$title = 'Анкета :: '.domain;

    
# post

    
if (isset($_POST['CFMS'])): 

    
$name = system::check($_POST['name']);    
    
$sex = system::abs($_POST['sex']);
    
$country = system::check($_POST['country']);
    
$city = system::check($_POST['city']);
    
$about_me = system::check($_POST['about_me']);
    
$day = system::abs($_POST['day']);
    
$month = system::abs($_POST['month']);
    
$year = system::abs($_POST['year']);
    
$CK    = system::check($_POST['CK']);    

    if (
system::utf_strlen($name) < 51):
    if (
$sex == 0 || $sex == 1):
    if (
system::utf_strlen($country) < 101):        
    if (
system::utf_strlen($city) < 101):
    if (
system::utf_strlen($about_me) < 101):
    if (
$day > 0 && $day < 32):
    if (
$month > 0 && $month < 13):
    if (
$year > 1969 && $year < 2021):    

    if (
$CK == $user['CK']):    

    
DB :: $dbh -> query("UPDATE user SET name = ?,sex = ?,country = ?,city = ?,about_me = ?,`day` = ?,`month` = ?,`year` = ? WHERE id = ? LIMIT 1;",array($name,$sex,$country,$city,$about_me,$day,$month,$year,$user['id']));    
    
    
cache_user::save($user['id']);

    
system::header('?', 'Анкета успешно изменена!');

    
# error

    
else: system::header('?', 'Ошибка, возможно вам подкинули эту ссылку'); endif;        
    else: 
system::header('?', 'Ошибка, не верно указано дата рождения'); endif;    
    else: 
system::header('?', 'Ошибка, не верно указано дата рождения'); endif;    
    else: 
system::header('?', 'Ошибка, не верно указано дата рождения'); endif;    
    else: 
system::header('?', 'Ошибка, о себе до 100 символов'); endif;    
    else: 
system::header('?', 'Ошибка, город до 100 символов'); endif;    
    else: 
system::header('?', 'Ошибка, страна до 100 символов'); endif;
    else: 
system::header('?', 'Ошибка, не верно указан пол'); endif;    
    else: 
system::header('?', 'Ошибка, имя до 50 символов'); endif;
    endif;    

    
# head

    
require_once ( head );

    
# day

    
$day = null; for($i = 1; $i <= 31; $i++): $day.= '<option value="'.$i.'" '.($user['day'] == $i ? 'selected':null).'>'.$i.'</option>'; endfor;

    
# month

    
$month = null; $arr_month = ['1'=>'Январь','2' => 'Февраль','3' => 'Март','4' => 'Апрель','5' => 'Май','6' => 'Июнь','7' => 'Июль','8' => 'Август','9' => 'Сентябрь','10' => 'Октябрь','11' => 'Ноябрь','12' => 'Декабрь'];foreach ($arr_month as $key => $value):$month.= '<option value="'.$key.'" '.($user['month'] == $key ? 'selected':null).'>'.$value.'</option>'; endforeach;

    
# year

    
$year = null; for($i = 1970; $i <= 2020; $i++): $year.= '<option value="'.$i.'" '.($user['year'] == $i ? 'selected':null).'>'.$i.'</option>'; endfor;


    echo 
'
    '
.system::dis().'
    <div class="fights fights-about">
    <form method="post"> 
    <input type="hidden" name="CK" value="'
.$user['CK'].'">
    <small>Имя:</small>
    <input type="text" name="name" value="'
.system::check($user['name']).'" placeholder="Введите ваше имя..." style="width: 96%;">
    <small>Пол:</small><br>
    <select name="sex">
    <option value="0" '
.($user['sex'] == 0 ? 'selected':null).'>Мужской</option><br>
    <option value="1" '
.($user['sex'] == 1 ? 'selected':null).'>Женский</option><br>
    </select>
    <small>Cтрана:</small>
    <input type="text" name="country" value="'
.system::check($user['country']).'" placeholder="Введите вашу страну..." style="width: 96%;">    
    <small>Город:</small>
    <input type="text" name="city" value="'
.system::check($user['city']).'" placeholder="Введите ваш город..." style="width: 96%;">    
    <small>О себе:</small>
    <textarea name="about_me" placeholder="Расскажите о себе..." style="width: 96%;">'
.system::check($user['about_me']).'</textarea>
    <small>Дата рождения:</small><br>
    <select name="day">'
.$day.'</select>
    <select name="month">'
.$month.'</select>
    <select name="year">'
.$year.'</select>
    <input type="submit" name="CFMS" value="Изменить">
    </div>
    <div class="fights-link" style="margin: 5px;"><a href="/setting">Вернуться назад</a></div>
    <div class="line"></div>
    '
;

    
# foot

    
require_once ( foot );
?>
Онлайн: 3
Реклама