$com_table_str = $idtype ? $idtype : "blog_comment"; $t_table = $tablePreStr . $com_table_str; $con_id = $com_type[$com_table_str]; $dbo = new dbex(); dbtarget('w', $dbServs); //当前页面参数 $page_num = trim(get_argg('page')); //变量区 $c_orderby = short_check(get_argg('order_by')); $c_ordersc = short_check(get_argg('order_sc')); $c_perpage = get_argg('perpage') ? intval(get_argg('perpage')) : 20; $eq_array = array('host_id', 'visitor_id', 'visitor_name', $con_id); $like_array = array('content'); $date_array = array("add_time"); $num_array = array(); $sql = spell_sql($t_table, $eq_array, $like_array, $date_array, $num_array, $c_orderby, $c_ordersc); $dbo->setPages($c_perpage, $page_num); //设置分页 $com_rs = $dbo->getRs($sql); $page_total = $dbo->totalPage; //分页总数 //按字段排序 $o_def = ''; $o_add_time = ''; if (get_argg('order_by') == '' || get_argg('order_by') == "com_id") { $o_def = "selected"; } if (get_argg('order_by') == "add_time") { $o_add_time = "selected"; } //显示控制
//数据表定义区 $t_table = $tablePreStr . "poll"; $dbo = new dbex(); dbtarget('w', $dbServs); //当前页面参数 $page_num = trim(get_argg('page')); //变量区 $c_expiration = short_check(get_argg('expiration')); $c_orderby = short_check(get_argg('order_by')); $c_ordersc = short_check(get_argg('order_sc')); $c_perpage = get_argg('perpage') ? intval(get_argg('perpage')) : 20; $eq_array = array('p_id', 'user_id', 'username', 'sex', 'noreply'); $like_array = array('subject'); $date_array = array("dateline"); $num_array = array('comments', 'voternum', 'credit'); $sql = spell_sql($t_table, $eq_array, $like_array, $date_array, $num_array, '', ''); if ($c_expiration != '') { if ($c_expiration == 1) { $sql .= " and expiration <= NOW() "; } if ($c_expiration == 2) { $sql .= " and expiration > NOW() "; } } if (!empty($c_orderby)) { $sql .= " order by {$c_orderby} "; } $sql .= " {$c_ordersc} "; $dbo->setPages($c_perpage, $page_num); $poll_rs = $dbo->getRs($sql); $page_total = $dbo->totalPage;
} } if (get_args("op") == 'upd') { $group = get_args('group'); $user_id = intval(get_args('user_id')); $sql = "update {$t_users} set user_group='{$group}' where user_id='{$user_id}'"; $dbo->exeUpdate($sql); } //当前页面参数 $page_num = trim(get_argg('page')); $sql = ''; $eq_array = array('user_id', 'user_group'); $like_array = array("user_name"); $date_array = array(); $num_array = array(); $sql = spell_sql($t_users, $eq_array, $like_array, $date_array, $num_array, '', '', ''); //设置分页 $dbo->setPages(20, $page_num); //取得数据 $member_rs = $dbo->getRs($sql); //分页总数 $page_total = $dbo->totalPage; //显示控制 $isNull = 0; $isset_data = ""; $none_data = "content_none"; if (empty($member_rs)) { $isset_data = "content_none"; $none_data = ""; $isNull = 1; }
$c_online = intval(get_argg('online')); $c_orderby = short_check(get_argg('order_by')); $c_ordersc = short_check(get_argg('order_sc')); $c_perpage = get_argg('perpage') ? intval(get_argg('perpage')) : 20; if ($c_online == 1) { $t_online = $tablePreStr . "online"; $t_table = $t_users . "," . $t_online; } else { $t_table = $t_users; } $eq_array = array('user_id', 'is_pass', 'user_sex', 'login_ip'); $like_array = array("user_name"); $date_array = array("user_add_time", "lastlogin_datetime"); $num_array = array("integral"); $join_cond = "user_id"; $sql = spell_sql($t_table, $eq_array, $like_array, $date_array, $num_array, '', '', $join_cond); if (!empty($c_city)) { $sql .= " and ({$t_users}.birth_city = '{$c_city}' or {$t_users}.reside_city = '{$c_city}') "; } if (!empty($c_province)) { $sql .= " and ({$t_users}.birth_province = '{$c_province}' or {$t_users}.reside_province ='{$c_province}') "; } if (!empty($c_orderby)) { $sql .= " order by {$t_users}.{$c_orderby} "; } $sql .= " {$c_ordersc} "; //设置分页 $dbo->setPages($c_perpage, $page_num); //取得数据 $member_rs = $dbo->getRs($sql); //分页总数