本文整理汇总了PHP中getcount函数的典型用法代码示例。如果您正苦于以下问题:PHP getcount函数的具体用法?PHP getcount怎么用?PHP getcount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getcount函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
global $_G;
if ($_GET['onsubmit'] && check()) {
foreach ($_GET[ids] as $k => $v) {
$id = intval($v);
if ($_GET[del][$k] == 0) {
continue;
}
if ($_GET['_del_all'] == 1 && $_GET['del'][$k]) {
DB::delete(__CLASS__, "id=" . intval($id));
}
}
cpmsg('操作成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__);
return false;
}
$size = 30;
$start = ($_G['page'] - 1) * $size;
$url = '';
$and = '';
if ($_GET['uid']) {
$uid = intval($_GET[uid]);
$and .= " AND uid =" . $uid;
$url .= "&uid=" . $uid;
}
if ($_GET['username']) {
$username = urldecode_utf8(trim($_GET[username]));
$and .= " AND username ='" . $username . "'";
$url .= "&username=" . urlencode_utf8($username);
}
if ($_GET['ip']) {
$ip = trim($_GET[ip]);
$and .= " AND ip ='" . $ip . "'";
$url .= "&ip=" . $ip;
}
if ($_GET['jf_down']) {
$jf_down = intval($_GET[jf_down]);
$and .= " AND org_jf >='" . $jf_down . "'";
$url .= "&jf_down=" . $jf_down;
}
if ($_GET['jf_up']) {
$jf_up = intval($_GET[jf_up]);
$and .= " AND org_jf <='" . $jf_up . "'";
$url .= "&jf_up=" . $jf_up;
}
if ($_GET[type] && array_key_exists($_GET[type], $_G['setting']['jf_type'])) {
$type = addslashes(trim($_GET[type]));
$and .= " AND type='{$type}'";
$url .= "&type=" . $type;
}
$sign_list = DB::fetch_all("SELECT * FROM " . DB::table(__CLASS__) . " where 1 {$and} ORDER BY id DESC LIMIT {$start},{$size}");
$count = getcount(__CLASS__, $and);
$showpage = multi($count, $size, $_G[page], URL . "m=sign&a=main" . $url);
foreach ($sign_list as $k => $v) {
$sign_list[$k][username_url] = urlencode_utf8($v[username]);
$sign_list[$k][dateline] = dgmdate($v[dateline], 'u');
}
$this->add(array('count' => $count, 'sign_list' => $sign_list, 'showpage' => $showpage));
$this->show('sign/main');
}
示例2: transfer_list
function transfer_list()
{
$page = max(1, MooGetGPC('page', 'integer', 'G'));
$limit = 16;
$offset = ($page - 1) * $limit;
$uid = MooGetGPC('uid', 'integer', 'P');
$sid = MooGetGPC('sid', 'integer', 'P');
$s_str = $and = '';
if ($uid > 0) {
$s_str .= 'uid like \'%' . $uid . '%\'';
$and = ' AND ';
}
if ($sid > 0) {
$s_str .= $and . 'sid=' . $sid;
}
if (!empty($s_str)) {
$s_str = ' WHERE ' . $s_str;
}
$sql = "SELECT * FROM {$GLOBALS['dbTablePre']}members_transfer {$s_str} ORDER BY id DESC LIMIT {$offset},{$limit}";
$transfer = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
$total = getcount('members_transfer', $s_str);
$currenturl = "index.php?action=other_members_transfer&h=list";
$pages = multipage($total, $limit, $page, $currenturl);
require_once adminTemplate('transfer_list');
}
示例3: GetInfo
function GetInfo()
{
$body = "<table><tr><td>";
$body .= "<img src='../images/rasp_title.gif' /></td>";
$body .= "<tr collspan='2'><td></td></tr></table>";
$body .= "<blockquote>";
$body .= "<font class='news_text'>В таблице \"Расписание\" базы данных содержится <b>" . getcount("select count(id) as sm from as_persones") . "</b> записей.<br /><br />В данную таблицу вносят данные по каждой учебной группе, указывая ее номер (1, 2, ...). Для того, чтобы внести информацию для повторно сдающих учащихся, создают специальную группу, с указанием в поле номера группы - \"Повторники\". Предусмотрена возможность внесения произвольной информации - поле \"Примечание\".</font><br><br>";
$body .= "</blockquote>";
$body .= "<table><tr><td>";
$body .= "<img src='../images/person_title.gif' /></td>";
$body .= "<tr collspan='2'><td></td></tr></table>";
$body .= "<blockquote>";
$body .= "<font class='news_text'>В таблице \"Персонал\" базы данных содержится <b>" . getcount("select count(id) as sm from as_persones") . "</b> записей.<br /><br />В данную таблицу вносят данные о преподавателях: фотография, Ф.И.О., звание/должность.</font><br><br>";
$body .= "</blockquote>";
$body .= "<table><tr><td>";
$body .= "<img src='../images/otz_title.gif' /></td>";
$body .= "<tr collspan='2'><td></td></tr></table>";
$body .= "<blockquote>";
$body .= "<font class='news_text'>Таблица отзывов содержит <b>" . getcount("select count(id) as sm from as_board") . " </b> записей </font>";
$body .= "<font class='news_text'>, из них не обработано <b>" . getcount("select count(id) as sm from as_board where visibled = 'N' or visibled is NULL") . "</b> записей.<br /><br />Эта таблица содержит отзывы о преподавателях, сделанные посетителями сайта. Данные из этой таблицы появяться на сайте для обозрения посетителей только после того, как администратор сайта установит соответствующий флаг. При необходимости, содержание отзыва можно отредактировать.</font>";
$body .= "</blockquote>";
$body .= "<br>";
$body .= "<div align='center'><font class='news_text'>Для управления содержанием разделов выберите необходимую Вам ссылку </font></div>";
return $body;
}
示例4: post
function post()
{
global $_G;
$type = trim_html($_GET['type'], 1);
$type_arr = array('message', 'feedback');
if (!$type || !in_array($type, $type_arr)) {
$type = 'message';
}
$arr = array();
$arr['type'] = $type;
$arr['content'] = trim_html($_GET['content'], 1);
$arr['name'] = trim_html($_GET['name'], 1);
$arr['contact'] = trim_html($_GET['contact'], 1);
$arr['company_name'] = trim_html($_GET['company_name'], 1);
$arr['url'] = trim_html($_GET['url'], 1);
$arr['check'] = 0;
$arr['dateline'] = TIMESTAMP;
if ($_G['uid'] > 0 && !$arr['name']) {
$arr['name'] = $_G['username'];
}
if ($arr['email'] && !is_email($arr['email'])) {
msg('邮箱格式不正确');
}
$count = getcount('message', "content = '" . $arr['content'] . "'");
if ($count > 0) {
msg('您的信息我们已收到,感谢提交');
}
DB::insert('message', $arr);
msg('提交成功', 'success');
}
示例5: csc
function csc($task = array())
{
global $_G;
if (getcount('home_blog', array('uid' => $_G['uid']))) {
return true;
}
return array('csc' => 0, 'remaintime' => 0);
}
示例6: existdomain
function existdomain($domain, $domainroot)
{
global $_G;
$exist = false;
if (getcount('common_domain', array('domain' => $domain, 'domainroot' => $domainroot))) {
$exist = true;
}
return $exist;
}
示例7: getFriendInfo
function getFriendInfo($uId, $num = MY_FRIEND_NUM_LIMIT, $isExtra = false)
{
$users = $this->getUsers(array($uId), false, true, $isExtra, true, $num, false, true);
$where = array('uId' => $uId, 'status' => 1);
$totalNum = getcount('friend', $where);
$friends = $users[0]['friends'];
unset($users[0]['friends']);
$result = array('totalNum' => $totalNum, 'friends' => $friends, 'me' => $users[0]);
return new APIResponse($result);
}
示例8: active_rightbottom_message
function active_rightbottom_message()
{
$type = MooGetGPC('type', 'string');
$sql_where = ' WHERE 1=1 ';
//note 显示全部
if (isset($_GET['type']) == 'all') {
$sql_where .= "";
//note 显示已处理过的
} else {
if ((isset($_GET['type']) ? $_GET['type'] : '') == 'dealed') {
$sql_where .= " AND dealstate = '1'";
//note 显示未处理过的
} else {
$sql_where .= " AND dealstate = '0'";
}
}
//分页
$page_per = 20;
$page = max(1, MooGetGPC('page', 'integer', 'G'));
$limit = 20;
$offset = ($page - 1) * $limit;
//所管理的客服id列表
$myservice_idlist = get_myservice_idlist();
if (empty($myservice_idlist)) {
$sql_where .= " AND sid IN({$GLOBALS['adminid']})";
} elseif ($myservice_idlist == 'all') {
//all为客服主管能查看所有的
} else {
$sql_where .= " AND sid IN({$myservice_idlist})";
}
if (isset($_GET['id'])) {
$id = MooGetGPC('id', 'integer', 'G');
$sql = "UPDATE {$GLOBALS['dbTablePre']}admin_remark SET status=1 WHERE id='{$id}'";
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
salert('操作成功', 'index.php?action=other_rightbottom&h=message');
}
$total = getcount('admin_remark', $sql_where);
$sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_remark {$sql_where} ORDER BY id DESC LIMIT {$offset},{$limit}";
$remark_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
//note 获得当前的url 去除多余的参数
/* $currenturl = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
$currenturl = preg_replace("/(&page=\d+)/","",$currenturl);
$currenturl = preg_replace("/(&type=undealed)/","",$currenturl);
$currenturl = preg_replace("/(&type=dealed)/","",$currenturl);
$currenturl = preg_replace("/(&type=all)/","",$currenturl);
$currenturl2 = $currenturl;
$currenturl = $currenturl."&type=$type";
echo $currenturl; */
$currenturl = "index.php?action=other_rightbottom&h=message&type={$type}";
//note 跳转到某一页
$page_num = ceil($total / $limit);
$page_links = multipage($total, $page_per, $page, $currenturl);
//note 调用模板
require adminTemplate('other_rightbottom_message');
}
示例9: generate_dropdown
function generate_dropdown($id, $gid, $pid)
{
$c = getcount("groups", "WHERE creator = '{$id}' AND group_id != '{$gid}'");
if ($c == 0) {
return false;
}
$e = '<select name="move_' . $pid . '"><option>Verschieben nach...</option>';
$h = get_group($id, $gid);
while (list($key, $val) = each($h)) {
$e .= '<option value="' . $val['group_id'] . '">' . $val['title'] . '</option>';
}
$e .= '</select>';
return $e;
}
示例10: getstatistics
function getstatistics()
{
global $_SGLOBAL, $_SC, $_SCONFIG;
$dbsize = 0;
$query = $_SGLOBAL['db']->query("SHOW TABLE STATUS LIKE '{$_SC['tablepre']}%'", 'SILENT');
while ($table = $_SGLOBAL['db']->fetch_array($query)) {
$dbsize += $table['Data_length'] + $table['Index_length'];
}
$sitekey = trim($_SCONFIG['sitekey']);
if (empty($sitekey)) {
$sitekey = mksitekey();
$_SGLOBAL['db']->query("REPLACE INTO " . tname('settings') . " (variable, value) VALUES ('sitekey', '{$sitekey}')");
include_once S_ROOT . './function/cache.func.php';
updatesettingcache();
}
$statistics = array('sitekey' => $sitekey, 'version' => S_VER, 'release' => S_RELEASE, 'php' => PHP_VERSION, 'mysql' => $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT VERSION()"), 0), 'dbsize' => $dbsize, 'charset' => $_SC['charset'], 'sitename' => preg_replace('/[\'\\"\\s]/s', '', $_SCONFIG['sitename']), 'adnum' => getcount('ads', array()), 'announcementnum' => getcount('announcements', array()), 'attachmentnum' => getcount('attachments', array()), 'forumnum' => getcount('forums', array()), 'categorynum' => getcount('categories', array()), 'channelnum' => getcount('channels', array()), 'friendlinknum' => getcount('friendlinks', array()), 'membernum' => getcount('members', array()), 'modelnum' => getcount('models', array()), 'pollnum' => getcount('polls', array()), 'reportnum' => getcount('reports', array()), 'robotnum' => getcount('robots', array()), 'spacecommentnum' => getcount('spacecomments', array()), 'spaceitemnum' => getcount('spaceitems', array()), 'tagnum' => getcount('tags', array()), 'usergroupnum' => getcount('usergroups', array()));
$statistics['update'] = rawurlencode(serialize($statistics)) . '&h=' . substr(md5($_SERVER['HTTP_USER_AGENT'] . '|' . implode('|', $statistics)), 8, 8);
return $statistics;
}
示例11: getAllUsers
function getAllUsers($from, $userNum, $friendNum = MY_FRIEND_NUM_LIMIT, $isExtra = false)
{
global $_SGLOBAL;
$totalNum = getcount('space', '');
// space
$sql = 'SELECT s.*
FROM %s s
ORDER BY s.uid
LIMIT %d, %d';
$sql = sprintf($sql, tname('space'), $from, $userNum);
$query = $_SGLOBAL['db']->query($sql);
$spaces = $uIds = array();
while ($row = $_SGLOBAL['db']->fetch_array($query)) {
$spaces[$row['uid']] = $row;
$uIds[] = $row['uid'];
}
$users = $this->getUsers($uIds, $spaces, true, $isExtra, true, $friendNum, true);
$result = array('totalNum' => $totalNum, 'users' => $users);
return new APIResponse($result);
}
示例12: getAllUsers
function getAllUsers($from, $num)
{
global $_SGLOBAL;
$totalNum = getcount('space', '');
$sql = 'SELECT s.*, sf.*
FROM %s s
LEFT JOIN %s sf ON s.uid = sf.uid
ORDER BY s.uid
LIMIT %d, %d';
$sql = sprintf($sql, tname('space'), tname('spacefield'), $from, $num);
$query = $_SGLOBAL['db']->query($sql);
$users = array();
while ($space = $_SGLOBAL['db']->fetch_array($query)) {
$user = $this->_space2user($space);
$user['friends'] = $this->_getFriends($space['uid']);
$user['action'] = 'add';
$users[] = $user;
}
$result = array('totalNum' => $totalNum, 'users' => $users);
return new APIResponse($result);
}
示例13: updatestat
function updatestat($type, $primary = 0)
{
global $_G;
if (empty($_G['uid']) || empty($_G['setting']['updatestat'])) {
return false;
}
$nowdaytime = dgmdate($_G['timestamp'], 'Ymd');
if ($primary) {
$setarr = array('uid' => $_G['uid'], 'daytime' => $nowdaytime, 'type' => $type);
if (getcount('common_statuser', $setarr)) {
return false;
} else {
DB::insert('common_statuser', $setarr);
}
}
if (getcount('common_stat', array('daytime' => $nowdaytime))) {
DB::query("UPDATE " . DB::table('common_stat') . " SET `{$type}`=`{$type}`+1 WHERE daytime='{$nowdaytime}'");
} else {
DB::query("DELETE FROM " . DB::table('common_statuser') . " WHERE daytime != '{$nowdaytime}'");
DB::insert('common_stat', array('daytime' => $nowdaytime, $type => '1'));
}
}
示例14: shop_list
function shop_list()
{
global $_G, $assign;
$shop_list = array();
foreach ($assign[goods] as $k => $v) {
$nick = $v['nick'];
if (!$nick) {
continue;
}
$and = "nick='{$nick}'" . ' AND hide = 0 AND `check`=1 ';
//$and_time .= " AND start_time < ".TIMESTAMP;
//$and_time .= " AND ( end_time = 0 or end_time > ".TIMESTAMP.")";
//$and .= ' AND `check` = 1 AND `hide`=0 AND num>0 ' .$and_time;
$count = getcount('goods', $and);
$arr = $v;
$arr[desc] = cutstr(trim_html($v[desc], 1), 150);
$arr[goods] = D(array('and' => $and, 'limit' => 4, 'all' => true));
$arr['count'] = $count;
$shop_list[] = $arr;
}
return array('shop_list' => $shop_list);
}
示例15: showmessage
showmessage('对不起,您的邀请码已经过期!');
}
}
if ($bp['isactive'] == 1) {
showmessage('users_have_actived', 'index.php', 2);
}
if (!@(include_once S_ROOT . './uc_client/client.php')) {
showmessage('system_error');
}
//邮箱
$email = isemail(trim($_POST['email'])) ? trim($_POST['email']) : '';
if (empty($email)) {
showmessage('email_format_is_wrong');
}
if ($_SCONFIG['checkemail']) {
if ($count = getcount('spacefield', array('email' => $email))) {
showmessage('email_has_been_registered');
}
}
$num = strpos($email, '@');
$num = $num > 15 ? 15 : $num;
$username = substr($email, 0, $num);
//创建新用户
$newuid = uc_user_register($username, $password, $email);
if ($newuid <= 0) {
if ($newuid == -1) {
showmessage('user_name_is_not_legitimate');
} elseif ($newuid == -2) {
showmessage('include_not_registered_words');
} elseif ($newuid == -3) {
showmessage('user_name_already_exists');