Example #1
0
function check_code($code)
{
    $setting = setting_module_load('report_set');
    if ($setting['multiQueryCode'] == 1) {
        if (empty($code)) {
            message('请输入查询码');
        }
        $validCode = $setting['multiValidCode'];
        $validArray = preg_split('/[\\s|,]+/', $validCode);
        if (!in_array($code, $validArray)) {
            $record = pdo_fetch("SELECT * FROM " . tablename('query_code') . " WHERE count=0 AND code=:code", array('code' => $code));
            if (!$record) {
                message('查询码错误');
            } else {
                $record['count']++;
                $record['last_time'] = time();
                $data = cly_array_filter(array('count', 'last_time'), $record);
                pdo_update('query_code', $data, array('id' => $record['id']));
            }
        }
    }
}
Example #2
0
<?php

$table = 'report';
$url = 'member/report_list';
$_GPC['do'] = $_GPC['do'];
$_GPC['id'] = $_GPC['id'];
if (checksubmit('token')) {
    $newData = cly_array_filter(array('type_id', 'account', 'account_type', 'image'));
    if ($_GPC['do'] == 'modify' && $_GPC['id']) {
        /*pdo_update($table, $newData, array(
              'id' => $id
          ));*/
    }
    if ($_GPC['do'] == 'add') {
        if ($_W['user']['status'] == 1) {
            message('您还未审核通过,请审核通过后再发布信息');
        }
        if (empty($_GPC['account'])) {
            message('举报账号不为空');
        }
        if (empty($_GPC['account_type'])) {
            message('举报账号类型不为空');
        }
        if (empty($_GPC['type_id'])) {
            message('举报类型不为空');
        }
        if (empty($_GPC['image'])) {
            message('请提交图片作为证据,图片小于300k');
        }
        $newData['user_id'] = $_W['uid'];
        $newData['time'] = time();
<?php

$table = 'query_code';
$url = 'admin/multi_search_list';
$filter = array();
function validate()
{
    global $_GPC;
    return true;
}
if (checksubmit('token') && validate()) {
    $newData = cly_array_filter($filter);
    if ($_GPC['do'] == 'modify' && $_GPC['id']) {
        pdo_update($table, $newData, array('id' => $_GPC['id']));
    }
    if ($_GPC['do'] == 'add') {
        $newData['code'] = md5(microtime(true));
        $newData['create_time'] = time();
        pdo_insert($table, $newData);
    }
}
if ($_GPC['do'] == 'delete' && $_GPC['id']) {
    pdo_delete($table, array('id' => $_GPC['id']));
}
$psize = 20;
$pindex = max(1, intval($_GPC['page']));
$start = ($pindex - 1) * $psize;
$select = "SELECT * FROM ";
$count = "SELECT count(*) FROM ";
$where = ' WHERE 1 AND count=0';
$order = '';
Example #4
0
<?php

$table = 'article';
$url = 'admin/article';
$actionUrl = url('admin/article/add');
$do = isset($_GPC['do']) ? $_GPC['do'] : 'add';
$type = pdo_fetchall("SELECT * FROM " . tablename('article_type'), array(), 'id');
$filter = array('title', 'type', 'author', 'create_time', 'content', 'remark');
$newData = cly_array_filter($filter, $_POST);
if (!$newData['author']) {
    $newData['author'] = $_W['username'];
}
if (!$newData['create_time']) {
    $newData['create_time'] = time();
} else {
    $newData['create_time'] = strtotime($newData['create_time']);
}
function validate()
{
    global $_GPC;
    return true;
}
if ($_GPC['do'] == 'delete' && $_GPC['id']) {
    pdo_delete($table, array('id' => $_GPC['id']));
} elseif ($_GPC['do'] == 'add') {
    if (checksubmit('token') && validate()) {
        pdo_insert($table, $newData, true);
        $id = pdo_insertid();
        if ($id) {
            message('成功', url($url), 'success');
        }
Example #5
0
}
$psize = 20;
$pindex = max(1, intval($_GPC['page']));
$start = ($pindex - 1) * $psize;
$select = "SELECT * FROM ";
$count = "SELECT count(*) FROM ";
$where = ' WHERE 1 ';
$order = ' ORDER BY create_time DESC';
$limit = " LIMIT {$start},{$psize}";
$params = array();
if (!empty($_GPC['s_qq'])) {
    $where .= " AND qq = :qq";
    $params['qq'] = intval($_GPC['s_qq']);
}
if (!empty($_GPC['s_username'])) {
    $where .= " AND username = :username";
    $params['username'] = $_GPC['s_username'];
}
if (!empty($_GPC['s_mobile'])) {
    $where .= " AND mobile = :mobile";
    $params['mobile'] = $_GPC['s_mobile'];
}
if (!empty($_GPC['s_admin_remark'])) {
    $where .= " AND admin_remark like :admin_remark";
    $params['admin_remark'] = "%{$_GPC['s_admin_remark']}%";
}
$sParams = cly_array_filter(array('s_qq', 's_username', 's_mobile', 's_admin_remark'));
$total = pdo_fetchcolumn($count . tablename($table) . $where, $params);
$pager = pagination($total, $pindex, $psize);
$data = pdo_fetchall($select . tablename($table) . $where . $order . $limit, $params);
template('admin/member');