本文整理汇总了PHP中GetNum函数的典型用法代码示例。如果您正苦于以下问题:PHP GetNum函数的具体用法?PHP GetNum怎么用?PHP GetNum使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetNum函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: del
function del($id)
{
global $_USERS;
$sendorders = $this->getone($id, "uname,oids,couponid,freight,serverfee,customsfee,totalfee,state");
if (is_array($sendorders)) {
if ($sendorders['state'] != 1) {
return lang('Not_allowcancel_sendorder');
}
if ($_USERS['uname'] != $sendorders['uname']) {
return lang('Permissions_not');
}
include_once INC_PATH . "/member.class.php";
$m = new memberclass();
$tempmoney = $sendorders['totalfee'];
$note = lang('cancel_sendorder_id') . $id;
$m->moneyedit($sendorders['uname'], $tempmoney, 3, $note);
$wheresqlo = "oid in(" . $sendorders['oids'] . ")";
editstate($this->tablepre . "order", "state", $wheresqlo, 4);
//更改订单状态操作
editstate($this->tablepre . "order", "sid", $wheresqlo, 0);
//更改订单对应运单ID操作
if (GetNum($sendorders['couponid'])) {
editstate($this->tablepre . "coupon", "state", "cid = " . GetNum($sendorders['couponid']), 1);
//更改优惠卷状态操作
}
} else {
return lang('sendOrderID_notexist');
}
$dataarray = array('state' => 4);
return $this->edit($id, $dataarray);
//return $this->table_sendorder->del($id);
}
示例2: helplist
function helplist($num, $id = '', $aids = "", $orderby = "aid asc")
{
if (is_numeric($id)) {
$wherestr[] = "typeid = " . $id;
} elseif (is_array($id)) {
$ids = getdotstring($id, 'int');
$wherestr[] = "typeid in ({$ids})";
} elseif (is_string($id) && (strexists($id, ',') || strexists($id, '|'))) {
if (strexists($id, ',')) {
$ids = getdotstring($id, 'int');
} else {
$ids = getdotstring(explode('|', $ids), 'int');
}
$wherestr[] = "typeid in ({$ids})";
} else {
$wherestr[] = "";
}
if (!empty($aids)) {
$aids = getdotstring($aids, 'int');
$wherestr[] = "aid in ({$ids})";
}
$num = GetNum($num);
$wheresql = implode(' AND ', $wherestr);
//条件汇总
$articleobj = new TableClass('article', 'aid');
$articlearray = $articleobj->getdata($num, $wheresql, $orderby, 'aid,typeid,title');
return $articlearray;
}
示例3: reply
function reply($mid, $subject, $message)
{
global $_USERS;
$mid = GetNum($mid);
$temparray = $this->getone($mid);
$addarray = array('fromuid' => $_USERS['uid'], 'fromuname' => $_USERS['uname'], 'touid' => $temparray['fromuid'], 'touname' => $temparray['fromuname'], 'type' => 2, 'subject' => Char_cv($subject), 'sendtime' => time(), 'writetime' => time(), 'hasview' => 0, 'isadmin' => 0, 'message' => Char_cv($message));
return $this->add($addarray);
}
示例4: paysuccess
/**
* 付款成功充值到账户
*
* @param unknown_type $sn
* @return 'OK'
*/
function paysuccess($sn, $money)
{
$sn = GetNum($sn);
$row = $this->getonebysn($sn, $field = "rid,uname,state,money,payname");
if (!is_array($row)) {
return lang('Renumber_notexist');
}
if ($row['state'] == 2) {
return lang('been_recharge');
}
//更新状态
$dataarray = array('money' => $money, 'successtime' => time(), 'state' => 2);
$this->rechargerecord->edit($row['rid'], $dataarray);
include_once INC_PATH . "/member.class.php";
$m = new memberclass();
$note = $row['payname'] . $money . lang('yuan') . lang('Serial_number') . $sn;
$m->moneyedit($row['uname'], $money, 9, $note);
return 'OK';
}
示例5: getone
/**
* 获取指定ID相关一条信息
*
* @param unknown_type $eid
* @return unknown
*/
function getone($gid, $field = "*")
{
if (GetNum($gid)) {
$gdata = $this->getdata(1, $this->idname . "='{$gid}'", '', $field);
if (is_array($gdata)) {
$value = $gdata[0];
} else {
$value = array();
}
}
return $value;
}
示例6: Char_cv
$wheresqlarr = "aid ={$ids}";
$value = Char_cv($value);
editstate($Table->table, "remark", $wheresqlarr, $value);
//更改状态操作
exit("1");
} elseif ($action == "changestate" && !empty($aid)) {
//更改状态
$aid = GetNum($aid);
$wheresqlarr = "aid ={$aid}";
editstate($Table->table, "state", $wheresqlarr, 1);
//更改状态操作
showmsg("修改状态成功!", "-1");
//成功提示!
} elseif ($action == "chargeback" && !empty($aid)) {
//更改状态
$aid = GetNum($aid);
$wheresqlarr = "aid ={$aid}";
$row = $Table->getone($aid);
$umoney = DB::result_first("Select money From `{$Table->table}` where uname like '{$row['uname']}' ");
if ($umoney < $row['money']) {
showmsg("用户帐户余额不足!扣费失败!", "-1");
}
//成功提示!
include_once INC_PATH . "/member.class.php";
$m = new memberclass();
$note = $row['name'] . ' 账户:' . $row['account'] . '充值扣费' . $row['money'] . "服务订单ID:" . $row['aid'];
$m->moneyedit($row['uname'], -$row['money'], 0, $note);
//扣去账户余额
editstate($Table->table, "state", $wheresqlarr, 2);
//更改状态操作
showmsg("修改状态并且扣费成功!", "-1");
示例7: json_decode
if ($action == 'cancelsell') {
$jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
$sn = Char_cv($jsondata->code);
$info = $coupon->cancelsell($sn, $_USERS['uname']);
echo json_encode($info);
exit;
} else {
if ($action == 'getcoupon') {
$jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
$price = GetNum($jsondata->price);
$num = GetNum($jsondata->num);
$info = $coupon->getcoupon($price, $num, $_USERS['uname']);
echo json_encode($info);
exit;
} else {
if ($action == 'buycoupon') {
$jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
$code = GetNum($jsondata->code);
if (empty($_USERS['uname'])) {
echo json_encode(lang('login_operate'));
exit;
}
$info = $coupon->buycoupon($code, $_USERS['uname']);
echo json_encode($info);
exit;
}
}
}
}
}
}
示例8: array
$arrayadd = array("adminname" => Char_cv($adminname), "adminpwd" => Char_cv($adminpwd), "adminmid" => $adminmid, "adminpurview" => $adminpurview);
$info = $Table->add($arrayadd);
if (GetNum($info)) {
exit("<script language='javascript'>alert('发布成功');parent.\$.fn.colorbox.close();</script>");
} else {
exit("<script language='javascript'>alert('发布失败');history.go(-1);</script>");
}
} else {
//print_r($evalue);
include "tpl/admin_add.htm";
}
} elseif ($action == "edit" && !empty($adminid)) {
InitGP(array("adminid", "adminname", "adminpwd", "mid"));
//初始化变量全局返回
if (!empty($_POST) and !empty($adminname) and !empty($adminid)) {
$adminid = GetNum($adminid);
if (empty($adminid)) {
showmsg("缺少ID参数!", "-1");
}
//出错!
if (empty($adminname)) {
showmsg("管理员名不能为空!", "-1");
}
//出错!
if (strlen($adminpwd) != 32) {
$adminpwd = md5($adminpwd);
}
//用户密码加密
if (is_array($mid)) {
$adminmid = getdotstring($mid, 'int');
}
示例9: showmsg
if (GetNum($info)) {
showmsg("发布成功!", PHP_SELF);
//出错!
} else {
showmsg("发布失败!", "-1");
//出错!
}
} else {
//print_r($evalue);
include "tpl/bankaccount_add.htm";
}
} elseif ($action == "edit" && !empty($bid)) {
InitGP(array("bid", "currency", "account", "accountname", "bankname", "remark"));
//初始化变量全局返回
if (!empty($_POST) and !empty($account) and !empty($bid)) {
$bid = GetNum($bid);
if (empty($bid)) {
showmsg("缺少ID参数!", PHP_SELF);
}
//出错!
if (empty($currency)) {
showmsg("币种不能为空!", PHP_SELF);
}
//出错!
if (empty($accountname)) {
showmsg("账户名不能为空!", PHP_SELF);
}
//出错!
$arrayadd = array("currency" => Char_cv($currency), "account" => Char_cv($account), "accountname" => Char_cv($accountname), "bankname" => Char_cv($bankname), "remark" => Char_cv($remark));
$info = $Table->edit($bid, $arrayadd);
if ($info == "OK") {
示例10: isset
//获取当前页码
$total = $goodsobj->getcount($wheresql);
//总信息数
$pagesize = 12;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$dataarray = $goodsobj->getdata("{$offset},{$pagesize}", $wheresql, 'listorder asc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
//获取数据
//print_r($dataarray);
include template('recommend_list');
//包含输出指定模板
} elseif ($action == 'view') {
$gid = GetNum($gid);
$value = $goodsobj->getone($gid);
$gtype = $typeobj->getone($value['gtypeid']);
if ($gtype['node'] == 0) {
$position = "<span>></span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
} else {
$cgtype = $typeobj->getone($gtype['node']);
$position = "<span>></span><a href='recommend.php?action=list&tid=" . $cgtype['typeid'] . "'>" . $cgtype['typename'] . "</a>";
$position .= "<span>></span><a href='recommend.php?action=list&tid=" . $gtype['typeid'] . "'>" . $gtype['typename'] . "</a>";
}
$leftarray = $goodsobj->getdata(10, "flag='c'", 'buynum desc,gid desc', 'gid,gtypeid,goodsurl,goodsname,goodsprice,goodsseller,goodsimg,sellerurl,shopname,rindex,views,buynum,listorder,flag,addtime');
addfield($goodsobj->table, 'views', "gid=" . $gid, 1);
//增加浏览次数
include template('recommend_view');
//包含输出指定模板
} else {
示例11: elseif
} else {
$evalue = $mange->getone($mid);
}
} elseif ($action == "del" && !empty($did)) {
//执行删除操作
$did = GetNum($did);
$info = $mange->del($did);
if ($info == "OK") {
showmsg("删除成功!", PHP_SELF);
} else {
showmsg($info, "article_list.php");
}
} elseif ($action == "dels") {
if (empty($delids)) {
showmsg("没有选择任何对象!", PHP_SELF);
exit;
}
//空选择
//执行删除多个操作
foreach ($delids as $id) {
$id = GetNum($id);
$info = $mange->del($id);
}
if ($info == "OK") {
showmsg("删除成功!", PHP_SELF);
} else {
showmsg($info, PHP_SELF);
}
}
//包含后台模板文件
include "tpl/mange.htm";
示例12: elseif
include "tpl/news_add.htm";
}
} elseif ($action == "edit" && !empty($nid)) {
InitGP(array("nid", "typeid", "title", "seokeywords", "seodescription", "listorder", "body"));
//初始化变量全局返回
if (!empty($_POST) and !empty($title) and !empty($nid)) {
$nid = GetNum($nid);
if (empty($nid)) {
showmsg("缺少ID参数!", PHP_SELF);
}
//出错!
if (empty($body)) {
showmsg("内容不能为空!", PHP_SELF);
}
//出错!
$arrayadd = array("title" => Char_cv($title), "seokeywords" => Char_cv($seokeywords), "seodescription" => Char_cv($seodescription), "listorder" => GetNum($listorder), "body" => HtmlReplace($body, -1), "addtime" => time());
$info = $Table->edit($nid, $arrayadd);
if ($info == "OK") {
showmsg("更新成功!", "news_list.php");
//出错!
} else {
showmsg("更新失败!", "news_list.php");
//出错!
}
} else {
$evalue = $Table->getone($nid);
//print_r($evalue);
include "tpl/news_add.htm";
}
} else {
showmsg("未知请求", "-1");
示例13: InitGP
<?php
include "common.inc.php";
InitGP(array("action", "type", "keyword", "aid", "page"));
//初始化变量全局返回
include_once INC_PATH . "/order.class.php";
$orderobj = OrderClass::init();
$keyword = FilterSearch(stripslashes($keyword));
//过滤搜索
if ($keyword != '' || strlen($keyword) > 2) {
$wherestr[] = "goodsname like '%" . $keyword . "%'";
}
$type = GetNum($type);
if ($type) {
$wherestr[] = "typeid='" . $type . "'";
}
//$wherestr[]="uname='".$_USERS['uname']."'";
if (!empty($wherestr)) {
$wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $orderobj->getcount($wheresql);
//总信息数
if ($total > 1000) {
$total = 1000;
}
//显示最大一千条
$pagesize = 10;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
示例14: getdotstring
$ids = getdotstring($oid, 'int');
$wherestr[] = "oid" . " in ({$ids})";
} elseif (is_string($oid) && (strexists($oid, ',') || strexists($oid, '|'))) {
if (strexists($oid, ',')) {
$ids = getdotstring($oid, 'int');
} else {
$ids = getdotstring(explode('|', $ids), 'int');
}
$wherestr[] = "oid" . " in ({$ids})";
} else {
exit("ID格式错误");
}
} elseif (!empty($type)) {
if ($type == "all") {
} elseif ($type == "idlist") {
if (GetNum($startid) and GetNum($endid)) {
$wherestr[] = "oid >={$startid}";
$wherestr[] = "oid <={$endid}";
} else {
showmsg("ID范围必须填写!", PHP_SELF);
}
} elseif ($type == "timelist") {
if (!empty($starttime) && !empty($endtime)) {
$starttimeunix = strtotime($starttime);
$endtimeunix = strtotime($endtime);
$wherestr[] = "addtime >{$starttimeunix}";
$wherestr[] = "addtime <{$endtimeunix}";
} else {
showmsg("时间范围必须填写!", PHP_SELF);
}
}
示例15: implode
$wheresql = implode(' AND ', $wherestr);
}
//条件汇总
//获取当前页码
$total = $specialobj->getcount($wheresql);
//总信息数
if ($total > 1000) {
$total = 1000;
}
//显示最大一千条
$pagesize = 6;
//一页显示信息数
$page = isset($page) ? max(1, intval($page)) : 1;
//处理页码变量
$offset = ($page - 1) * $pagesize;
//偏移量
$dataarray = $specialobj->getdata("{$offset},{$pagesize}", $wheresql, "", 'sid,title,flag,about,pic,listorder,addtime');
//获取数据
//获取头条和推荐
$topharray = $specialobj->getdata(1, "flag='hd'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
$topcarray = $specialobj->getdata(3, "flag='hd'", 'listorder asc,sid desc', 'sid,title,flag,about,pic,listorder,addtime');
include template('special');
//包含输出指定模板
} elseif ($action == "view") {
$sid = GetNum($sid);
$value = $specialobj->getone($sid);
include template('special_view');
//包含输出指定模板
} else {
exit(lang('Missing_parameter'));
}