本文整理匯總了PHP中MooGetGPC函數的典型用法代碼示例。如果您正苦於以下問題:PHP MooGetGPC函數的具體用法?PHP MooGetGPC怎麽用?PHP MooGetGPC使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MooGetGPC函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: active_rightbottom_sitemail
function active_rightbottom_sitemail()
{
if ($_POST) {
$sid = MooGetGPC('msg_sid', 'integer', 'P');
if (empty($_POST['msg_sid']) && !empty($_POST['msg_username'])) {
$username = MooGetGPC('msg_username', 'string', 'P');
$sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}admin_user WHERE username='{$username}'";
$admin_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
if (empty($admin_user)) {
salert('此用戶不存在');
exit;
}
$sid = $admin_user['uid'];
}
$data['sid'] = $sid;
$data['title'] = "{$GLOBALS['adminid']}號客服:" . MooGetGPC('msg_title', 'string', 'P');
$data['content'] = MooGetGPC('msg_content', 'string', 'P');
$data['awoketime'] = time() + 120;
$data['dateline'] = time();
$data['send_id'] = $GLOBALS['adminid'];
inserttable('admin_remark', $data);
salert('發送成功');
exit;
}
$group_list = get_group_type();
require adminTemplate('other_rightbottom_sitemail');
}
示例2: system_adminaction_edit
function system_adminaction_edit()
{
global $menu_nav_arr, $dbTablePre;
$actionid = MooGetGPC('actionid', 'integer');
$ispost = MooGetGPC('ispost', 'integer');
if (empty($actionid)) {
MooMessageAdmin('參數錯誤', 'index.php?action=adminaction&h=list', 1);
}
if ($ispost) {
$actiondesc = MooGetGPC('actiondesc', 'string');
$actioncode = MooGetGPC('actioncode', 'string');
$navcode = MooGetGPC('navcode', 'string');
$navname = MooGetGPC('navname', 'string');
if (empty($actiondesc) || empty($actioncode) || empty($navcode) || empty($navname)) {
$admin->showMessage('請將信息填寫完整', 'index.php?action=adminaction&h=add', 1);
}
$sql = "UPDATE {$GLOBALS['dbTablePre']}admin_action SET navname='{$navname}',navcode='{$navcode}',actioncode='{$actioncode}',actiondesc='{$actiondesc}' WHERE id='{$actionid}'";
$result = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
if ($result) {
//note 插入日誌
serverlog(2, $GLOBALS['dbTablePre'] . 'admin_action', "{$GLOBALS['username']}修改操作{$actionid}", $GLOBALS['adminid']);
salert('修改成功', 'index.php?action=system_adminaction&h=list');
//MooMessageAdmin('修改成功','index.php?action=system_adminaction&h=list',1);
} else {
salert('修改失敗', 'index.php?action=system_adminaction&h=list');
//MooMessageAdmin('修改失敗','index.php?action=system_adminaction&h=list',1);
}
}
$sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_action WHERE id='{$actionid}'";
$adminaction = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
require_once adminTemplate('adminaction_edit');
}
示例3: transfer_del
function transfer_del()
{
$id = MooGetGPC('id', 'integer', 'G');
$sql = "DELETE FROM {$GLOBALS['dbTablePre']}members_transfer WHERE `id`=" . $id;
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
salert("刪除成功", "index.php?action=other_members_transfer&h=list");
}
示例4: site_media_edit
function site_media_edit()
{
$ispost = MooGetGPC('ispost', 'integer', 'P');
if ($ispost) {
$id = MooGetGPC('id', 'integer', 'P');
$title = MooGetGPC('title', 'string', 'P');
$type = MooGetGPC('type', 'string', 'P');
$addtime = strtotime(MooGetGPC('addtime', 'string', 'P'));
$source = MooGetGPC('source', 'string', 'P');
$content = MooGetGPC('content', 'string', 'P');
if (empty($content)) {
salert("內容不能為空");
}
$sql = "UPDATE {$GLOBALS['dbTablePre']}media SET sid = {$GLOBALS['adminid']},type = '{$type}', title = '{$title}', content = '{$content}', addtime = '{$addtime}', source = '{$source}' WHERE id={$id}";
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
//note 插入日誌
serverlog(2, $GLOBALS['dbTablePre'] . 'media', "{$GLOBALS['username']}編輯媒體報道", $GLOBALS['adminid']);
salert("編輯成功", "index.php?action=site_media&h=edit&id=" . $id);
}
$isedit = 1;
$id = MooGetGPC('id', 'integer', 'G');
$sql = "SELECT * FROM {$GLOBALS['dbTablePre']}media WHERE id = {$id}";
$news = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
require adminTemplate('site_media_add');
}
示例5: getone
function getone()
{
global $_MooClass, $dbTablePre, $userid, $memcached;
$sendid = MooGetGPC('sendid', 'integer', 'G');
//$sendid = '21691205';
$user = MooMembersData($sendid);
if ($user['uid'] != $sendid || $sendid == '') {
$error = '查無此人';
echo return_data($error, false);
exit;
}
if (MooGetphoto($user['uid'], 'com')) {
$mainimg = MooGetphoto($userid, 'com');
$user['mainimg'] = $mainimg;
}
$user['password'] = '';
$user['regip'] = '';
$user['qq'] = '';
$user['msn'] = '';
$user['telphone'] = '';
$user['username'] = '';
//print_r($user);
echo return_data($user, true);
exit;
}
示例6: getlatestvisitor
function getlatestvisitor()
{
global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
$pagesize = 4;
//note 獲取刪除提交的變量
$delvisitor = MooGetGPC('delvisitor', 'string');
$delvisitorid = MooGetGPC('delvisitorid', 'array');
//note 刪除提交的數據
if ($delvisitor && count($delvisitorid)) {
for ($i = 0; $i < count($delvisitorid); $i++) {
$result = $_MooClass['MooMySQL']->getOne("SELECT `who_del` FROM `" . $dbTablePre . "service_visitor` WHERE `vid`=" . $delvisitorid[$i], true);
if ($result['who_del'] != 0) {
$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_visitor WHERE vid = '{$delvisitorid[$i]}'");
} else {
$_MooClass['MooMySQL']->query("UPDATE `" . $dbTablePre . "service_visitor` SET `who_del`=2 WHERE `vid`=" . $delvisitorid[$i]);
}
}
MooMessage("刪除成功", 'index.php?n=service&h=mindme', '05');
}
//note 如果提交的數據不存在,或者是提交的時候沒有選中
if ($delvisitor && !count($delvisitorid)) {
MooMessage('請選擇要刪除選項', 'index.php?n=service&h=mindme', '01');
exit;
}
//note 獲得當前url
$currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
$currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
//note 獲得第幾頁
$page = empty($_GET['page']) ? '1' : $_GET['page'];
//note limit查詢開始位置
$start = ($page - 1) * $pagesize;
//note 多少個人訪問統計總數
$ret_c = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2");
$total = $ret_c['c'];
if ($total > 200) {
$total = 200;
}
//更改最近留意我的人最我顯示200個
$tomeArr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND who_del !=1");
$tome = $tomeArr['count(*)'];
//note 查詢出誰訪問過我相關信息
if ($total) {
$results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2 order by visitortime desc LIMIT {$start},{$pagesize}");
$visitors = array();
foreach ($results as $k => $v) {
$send_user1 = array();
$send_user2 = array();
$vistor = array();
$send_user1 = leer_send_user1($v['uid']);
$send_user2 = leer_send_user2($v['uid']);
$vistor['l'] = $v;
$vistor['l']['visitortime'] = $vistor['l']['visitortime'] ? $vistor['l']['visitortime'] : time();
$vistor['s'] = $send_user1;
$vistor['t'] = $send_user2;
$visitors[$k] = $vistor;
}
}
require MooTemplate('public/service_visitor_latestvisitor', 'module');
}
示例7: whoismyfriend
function whoismyfriend()
{
global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $memcached;
$userid = $memcached->get('uid');
//驗證登錄
$and_uuid = $_GET['uuid'];
$checkuuid = check_uuid($and_uuid);
if (!$checkuuid) {
$error = "uuid_error";
echo return_data($error, false);
exit;
}
$pagesize = 12;
//note 獲取刪除提交的變量
$delfriend = MooGetGPC('delfriend', 'string');
$delfriendid = MooGetGPC('delfriendid', 'array');
//note 刪除提交的數據
if ($delfriend && count($delfriendid)) {
foreach ($delfriendid as $v) {
$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_friend WHERE fid = '{$v}'");
}
$return = "刪除意中人成功";
echo return_data($return);
exit;
}
//note 如果提交的數據不存在,或者是提交的時候沒有選中
if ($delfriend && !count($delfriendid)) {
$error = "請選擇要刪除的意中人";
echo return_data($error, false);
exit;
exit;
}
//note 獲得當前url
$currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
$currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
//note 獲得第幾頁
$page = empty($_GET['page']) ? 1 : $_GET['page'];
//note limit查詢開始位置
$start = ($page - 1) * $pagesize;
//note 已收到的統計總數
$query = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_friend WHERE uid = '{$userid}'");
$total = $query['num'];
$total2Arr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}'");
$total2 = $total2Arr['count(*)'];
//note 查詢出意中人相關信息
if ($total) {
$friend = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_friend WHERE uid = '{$userid}' order by sendtime desc LIMIT {$start},{$pagesize}");
}
$friendid = array();
foreach ($friend as $k => $f) {
$friendid[] = $f['friendid'];
}
$frienduid = implode(',', $friendid);
$frienduser = $_MooClass['MooMySQL']->getAll("select s.uid,s.nickname,s.birthyear,s.height,s.salary,s.province,s.city,b.mainimg,s.gender from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where s.uid=b.uid and s.uid in({$frienduid})");
echo return_data($frienduser);
exit;
}
示例8: site_lovequestion_del
function site_lovequestion_del()
{
$tid = MooGetGPC('tid', 'integer', 'G');
$sql = "DELETE FROM {$GLOBALS['dbTablePre']}love_question WHERE lid = {$tid}";
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
//note 插入日誌
serverlog(4, $GLOBALS['dbTablePre'] . 'love_question', '刪除愛情測試題目', $GLOBALS['adminid']);
salert("刪除成功", 'index.php?action=site_lovequestion&h=list');
}
示例9: site_lovetype_del
function site_lovetype_del()
{
$id = MooGetGPC('id', 'integer', 'G');
$sql = "DELETE FROM {$GLOBALS['dbTablePre']}love_type WHERE id = {$id}";
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
//note 插入日誌
serverlog(4, $GLOBALS['dbTablePre'] . 'love_type', '刪除測試評分結果', $GLOBALS['adminid']);
salert("刪除成功", 'index.php?action=site_lovetype&h=list');
}
示例10: getComment
function getComment($type, $id)
{
global $dbTablePre, $user_arr;
$page_per = 15;
$page_now = MooGetGPC('page', 'integer', 'G');
$page_url = preg_replace('/&page=[^&]*/', '', $_SERVER['REQUEST_URI']);
$uid = empty($user_arr['uid']) ? 0 : $user_arr['uid'];
$from_where = "FROM {prefix}comment WHERE type = '{$type}' AND id= '{$id}' AND ( ischeck = 1 OR uid = '{$uid}' ) ";
return readTable($page_now, $page_per, $page_url, $from_where, $order_by = 'ORDER BY cid DESC', $fd_list = '*');
}
示例11: other_del_white
/**
* 刪除白名單
*/
function other_del_white()
{
$id = MooGetGPC('id', 'integer', 'P');
if (empty($id)) {
exit(json_encode(array('flag' => 0, 'msg' => '數據不完整')));
}
if ($GLOBALS['_MooClass']['MooMySQL']->query('DELETE FROM ' . $GLOBALS['dbTablePre'] . 'white_list WHERE id=' . $id)) {
exit(json_encode(array('flag' => 1, 'msg' => '白名單刪除成功')));
} else {
exit(json_encode(array('flag' => 0, 'msg' => '刪除失敗')));
}
}
示例12: login_login
function login_login()
{
global $_MooClass, $dbTablePre, $memcached;
/*
$seccode1 = strtolower(MooGetGPC('vertify_code','string','P'));
$seccode2 = MooGetGPC('seccode','string','C');
$session_seccode = $memcached->get($seccode2);
if($seccode1 != $session_seccode){
MooMessageAdmin("驗證碼填寫不正確,請確認。", "index.php?action=login",'','',3);
}
*/
$username = MooGetGPC('username', 'string', 'P');
$password = MooGetGPC('password', 'string', 'P');
$password = md5($password);
//判斷用戶名和密碼是否為空
if ($username == '' || $password == '') {
MooMessageAdmin('用戶名或密碼不能為空', 'index.php?n=login', 1);
}
$userinfo = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}admin_user WHERE `username`='{$username}' LIMIT 1 ", true);
if ($userinfo['uid'] && $userinfo['password'] == $password) {
MooSetCookie('admin', MooAuthCode("{$userinfo['uid']}\t{$userinfo['password']}", 'ENCODE'), 86400);
//note 寫入session表需要的字段值
$online_ip = GetIP();
$lastactive = $GLOBALS['timestamp'];
//note 提取快到期的高級用戶並加入備注中
$nowtime = time();
$endtime = $nowtime + 8 * 24 * 60 * 60;
$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}custom_remark WHERE `keyword`='會員到期' AND `cid`='{$userinfo['uid']}'");
$remark = $_MooClass['MooMySQL']->getAll("SELECT `uid`,`endtime` FROM {$dbTablePre}members_search WHERE `sid`={$userinfo['uid']} AND `s_cid`=30 AND `endtime`<{$endtime}", 0, 0, 0, true);
for ($i = 0; $i < count($remark); $i++) {
$content = "尊敬的客服,您的紅娘號為" . $remark[$i]['uid'] . "的會員將於" . date('Y-m-d', $remark[$i]['endtime']) . "到期,請盡快與該會員聯係";
$_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}custom_remark SET `cid`={$userinfo['uid']},`keyword`='會員到期',`content`='{$content}',`awoketime`='{$remark[$i]['endtime']}'");
}
//更新最後登錄相關記錄
$sql = "UPDATE {$dbTablePre}admin_user SET lastlogin='{$nowtime}',lastip='{$online_ip}' WHERE uid='{$userinfo['uid']}'";
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
$sid_list = '';
//得到我所管理的客服id列表
$sid_list = get_mymanage_serviceid_list($userinfo['uid'], $userinfo['groupid']);
$time = time();
$sql = "REPLACE INTO {$GLOBALS['dbTablePre']}admin_usersession SET uid='{$userinfo['uid']}',groupid='{$userinfo['groupid']}',dateline='{$time}',sid_list='{$sid_list}'";
$GLOBALS['_MooClass']['MooMySQL']->query($sql);
//添加操作日誌
serverlog(3, $dbTablePre . "admin_usersession", "{$userinfo['uid']}成功登陸後台", $userinfo['uid']);
MooMessageAdmin('登陸成功', 'index.php?n=main', 1);
} else {
MooMessageAdmin('用戶名或密碼錯誤', 'index.php?n=login', 1);
}
}
示例13: MooGetFromwhere
/**
*來源獲取(網站來源訪問和推薦用戶ID)
*@返回COOKIE值在注冊的時候寫入
*PHPYOU
*/
function MooGetFromwhere(){
global $_MooCookie;
$puid=$_MooCookie['puid'] ?$_MooCookie['puid'] :MooGetGPC('puid','integer','G');
if($puid){
MooSetCookie('puid', $puid, 24*3600);
}
$website=$_MooCookie['website']?$_MooCookie['website']:MooGetGPC('website','string','G');
if($website){
MooSetCookie('website', $puid, 24*3600);
}
if( isset($_GET['wf']) && isset($_GET['st']) ){
MooSetCookie('where_from', "http://www.7651.com/virtual/?".$_SERVER['QUERY_STRING'], 24*3600);
return;
}
if( preg_match("/\/virtual\//",$_MooCookie['where_from']) ) return;
$rf_url = $_SERVER['HTTP_REFERER'];
// 判斷是否有外來頁
if (empty($rf_url)) {
//error_log("rf error", 0);
return false;
}
$rf_arr = parse_url($rf_url);
$rf_hostname = $rf_arr["host"];
$rf_path = $rf_ar["path"];
//print_r($rf_arr);
// 判斷外來是否是本站
if ($rf_hostname == $_SERVER["HTTP_HOST"] && strstr($rf_url, "/pop/") === false && strstr($rf_url, "/reg/") === false) {
//error_log("rf error1", 0);
$where_from = $_MooCookie['where_from'];
$where_from_arr = parse_url($where_from);
if ($where_from_arr["host"] == $_SERVER["HTTP_HOST"]) {
MooSetCookie('where_from', "", -24*3600);
}
return false;
}
$where_from = $_MooCookie['where_from'];
// 判斷外來與cookie中記錄是否一致
if ($where_from == $rf_url) {
return false;
}
MooSetCookie('where_from', $_SERVER['HTTP_REFERER'], 24*3600);
return true;
}
示例14: system_adminlog_search
function system_adminlog_search()
{
$condition = array();
//客服sid搜索
if ($_GET['sid']) {
$sid = MooGetGPC('sid', 'integer', 'G');
$condition[] = " a.sid='{$sid}'";
}
if ($_GET['sid2']) {
$sid = MooGetGPC('sid2', 'integer', 'G');
$condition[] = " a.sid='{$sid}'";
}
//會員id搜索
if ($_GET['uid']) {
$uid = MooGetGPC('uid', 'integer', 'G');
$condition[] = " a.uid='{$uid}'";
}
if ($_GET['date1']) {
$date1 = strtotime(MooGetGPC('date1', 'string', 'G'));
$condition[] = " a.time>='{$date1}'";
}
if ($_GET['date2']) {
$date2 = strtotime(MooGetGPC('date2', 'string', 'G'));
$condition[] = " a.time<='{$date2}'";
}
$sql_where = '';
if (!empty($condition)) {
$sql_where = 'AND ' . implode('AND', $condition);
}
$page = max(1, MooGetGPC('page', 'integer'));
$limit = 15;
$offset = ($page - 1) * $limit;
$page_per = 15;
//note 得出總數
$sql = "SELECT count(1) as count FROM {$GLOBALS['dbTablePre']}server_log a JOIN {$GLOBALS['dbTablePre']}admin_user as b \n \t\tWHERE a.sid=b.uid {$sql_where}";
$query = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
$total = $query['count'];
$sql = "SELECT a.*,b.username FROM {$GLOBALS['dbTablePre']}server_log as a \n \t\tJOIN {$GLOBALS['dbTablePre']}admin_user as b \n \t\tWHERE a.sid=b.uid {$sql_where} ORDER BY a.slid DESC LIMIT {$offset},{$limit}";
$adminlogin_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
$currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
$currenturl = preg_replace("/www./", "", $currenturl);
$currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl);
$page_links = multipage($total, $page_per, $page, $currenturl);
// $page_links=str_replace('7651','7652',$page_links);
$sql = "SELECT uid,username FROM {$GLOBALS['dbTablePre']}admin_user";
$user_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql);
require_once adminTemplate('adminlog_list');
}
示例15: financial_ordertotal_list
function financial_ordertotal_list()
{
//note 處理搜索會員聊天
if ($_GET['action'] == 'financial_ordertotal') {
$bgtime = MooGetGPC('bgtime', 'string');
$endtime = MooGetGPC('endtime', 'string');
$where = ' WHERE 1=1 ';
if (!empty($bgtime) && !empty($endtime)) {
$bgtime_arr = explode("-", $bgtime);
$bgtime_mk = mktime(0, 0, 0, $bgtime_arr[1], $bgtime_arr[2], $bgtime_arr[0]);
$endtime_arr = explode("-", $endtime);
$endtime_mk = mktime(0, 0, 0, $endtime_arr[1], $endtime_arr[2], $endtime_arr[0]);
if ($endtime < $bgtime) {
echo "<script>alert('結束日期不能小於開始日期');window.location.href='index.php?action=financial_ordertotal&h=list'</script>";
exit;
}
$where .= " AND dateline >= '{$bgtime_mk}' AND dateline <= '{$endtime_mk}'";
}
}
//note 處理導出功能
$export = MooGetGPC('export', 'string', 'G');
//if($_GET['export']) {
if ($export) {
ob_clean();
if (empty($user_arr)) {
echo '沒有找到符合條件的財務報表';
exit;
}
$today = date("Y-m-d");
header("Content-type:application/vnd.ms-excel; charset=gbk");
header("Content-Disposition:attachment; filename={$today}.xls");
echo iconv('utf-8', 'gbk', '成功訂單總數') . "\t";
echo iconv('utf-8', 'gbk', '日期') . "\t\n";
foreach ($user_arr as $k => $v) {
echo iconv('utf-8', 'gbk', $v['name']) . "\t";
echo iconv('utf-8', 'gbk', date("Y-m-d", $v['dateline'])) . "\t\n";
}
exit;
}
//note 數據庫查詢
$sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}financial_orderok {$where}";
$total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
//note 插入日誌
serverlog(1, $GLOBALS['dbTablePre'] . 'financial_orderok', "{$GLOBALS['username']}查看成功訂單總數記錄列表", $GLOBALS['adminid']);
//note 調用模板
require adminTemplate('financial_ordertotal_list');
}