Ejemplo n.º 1
0
<?php

$hq = new hq_framework();
if (!$hq->exists_table('qb')) {
    $hq->new_table('qb', 'user,text');
}
if (PROTECT != 1) {
    die;
}
if ($_SESSION['admin']) {
    $k = $hq->get_info('qb', 'user');
    if ($GET[2] == 'del') {
        if ($GET[3] != 'all') {
            $GET[3] = abs(intval($GET[3]));
            if ($GET[3] && $GET[3] <= $k) {
                $hq->set_record('qb', 'text', $GET[3], 'Сообщение удалено администратором!');
                header('location:' . href(THIS, 2));
            } else {
                header('location:' . href(THIS, 2));
            }
        } else {
            $hq->del_table('qb');
            header('location:' . href(THIS, 2));
        }
    }
    html('<h3>Управление модулем "' . $local['title'] . '"</h3>');
    $GET[2] = abs(intval($GET[2]));
    if (!$GET[2]) {
        $GET[2] = 1;
    }
    $on_page = 25;
Ejemplo n.º 2
0
            if (intval($GET[2]) && $GET[2] <= $count) {
                if (!$_POST) {
                    ?>
          <form action="" method="post">
          <b>Удалить пунк "<?php 
                    echo htmlspecialchars($hq->get_record('menu', 'name', $GET[2]));
                    ?>
"?</b>
          <br><br>
          <input name="ok" value="Да" type="submit"> 
          <input name="no" value="Нет" type="submit">
          </form>
          <?php 
                } else {
                    if ($_POST['ok']) {
                        $hq->set_record('menu', 'name', $GET[2], '');
                    }
                    header('location:' . href($GET[0]));
                }
            } else {
                header('location:' . href($GET[0]));
            }
            break;
        case 'edit':
            if (intval($GET[2]) && $GET[2] <= $count) {
                $name = $hq->get_record('menu', 'name', $GET[2]);
                if (!$name) {
                    header('location:' . href($GET[0]));
                }
                $link = $hq->get_record('menu', 'link', $GET[2]);
                ?>