Файл: _modules/office/platforms/edit/index.php
Строк: 54
<?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);
    $id =  isset( $_GET['id'] ) ? system::abs($_GET['id']): 0;
    if (cache_pf::ch($id) === false)system::header('/office/platforms','Ошибка, ID не найден');
    $act = cache_pf::check($id);
    if ($act['user'] != $user['id'])system::header('/office/platforms','Ошибка, ID не найден');
    
    # meta
    $title = 'Мой кабинет » Мобильные WAP сайты';
    $description = system::check($config['description']);
    $keywords = system::check($config['keywords']);
    $tl = 'Изменение cайта - '.system::check($act['url']);
    # post
    if (isset($_POST['CFMS'])): 
    $message      = system::check($_POST['message']);    
    $cat          = system::abs($_POST['cat']);
    $big          = system::abs($_POST['big']);
    $small      = system::abs($_POST['small']);
    $hide         = (empty($_POST['hide'])) ? 0 : 1;
    $CK          = system::check($_POST['CK']);    
    if (system::utf_strlen($message) > 5 && system::utf_strlen($message)    < 81):    
    if (cache_cat::ch($cat) == true):
    if ($big > 0 && $big < 12):
    if ($small > 0 && $small < 12):
    if ($user['CK'] == $CK):
    
    DB :: $dbh -> query("UPDATE platforms SET message = ?, cat = ?, big = ?, small = ?, hide = ? WHERE id = ? LIMIT 1;", array($message,$cat,$big,$small,$hide,$act['id']));    
    
    cache_pf::save($act['id']);    
    system::header('/office/platforms','Успешно',1);        
        
    # error
    
    else: system::header('?','Ошибка, возможно вам подкинули эту ссылку'); endif;
    else: system::header('?','Не верно выбран счетчик для остальных страниц'); endif;
    else: system::header('?','Не верно выбран счетчик для главной страницы'); endif;
    else: system::header('?','Не верно выбрана категория'); endif;
    else: system::header('?','Описание от 5 до 80 символов'); endif;
    endif;    
    # head
    require_once ( head );
    echo '
    <div class="touch">
    <form method="post">
    <input type="hidden" name="CK" value = "'.$user['CK'].'">
    Описание сайта [max. 80]:<br>
    <textarea name="message" cols="38" rows="8">'.system::check($act['message']).'</textarea><br>
    Категория:<br>
    <select name="cat">
    ';
    # cat
    $query = DB :: $dbh -> query("SELECT id FROM cat ORDER BY id");    
    while ($cat = $query -> fetch()):
    $cat = cache_cat::check($cat['id']);    
    echo '<option value="'.$cat['id'].'" '.($act['cat'] == $cat['id'] ? 'selected="selected"':'').'>'.system::check($cat['name']).'</option>';        
    endwhile;    
    # coutn code
    $cn = [1,2,3,4,5,6,7,8,9,10,11];
    
    echo'
    </select>
    <hr>
    <small><strong>Для главной страницы сайта: <font size="2">*</font></strong></small>
    <br>';
    foreach ($cn as $big): # big
    echo '
    <input type="radio" name="big" value="'.$big.'" '.($big == $act['big'] ? 'checked="checked"':'').'>
    <img src="'.ico.'cn/big/'.$big.'.gif" alt="*">
    <br>';    
    endforeach;        
    echo '
    <hr>
    <small><strong>Для остальных страниц сайта: <font size="2">*</font></strong></small>
    <br>';
    
    foreach ($cn as $small): # small
    echo '
    <input type="radio" name="small" value="'.$small.'" '.($small == $act['small'] ? 'checked="checked"':'').'>
    <img src="'.ico.'cn/small/'.$small.'.gif" alt="*">
    <br>    
    ';    
    endforeach;    
    
    echo '
    <br>
    <input name="hide" type="checkbox" value="1" '.($act['hide'] == 1 ? 'checked="checked"':'').'> Скрыть статистику<br>
    <input name="CFMS" type="submit" value="Изменить">
    </form>
    <br><font size="2">*</font> - Все поля обязательные к заполнению.<br>
    <font size="2">**</font> - Описание сайта должно быть адекватное!
    </div>
    <a href="'.site.'office/platforms" class="touch">« Мои сайты</a>
    <a href="'.site.'" class="touch">« На главную</a>
    ';
    # foot
    require_once ( foot ) ;
?>