本文整理汇总了PHP中IReq::get方法的典型用法代码示例。如果您正苦于以下问题:PHP IReq::get方法的具体用法?PHP IReq::get怎么用?PHP IReq::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReq
的用法示例。
在下文中一共展示了IReq::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exchangcard
function exchangcard()
{
$this->checkmemberlogin();
$card = trim(IFilter::act(IReq::get('card')));
$password = trim(IFilter::act(IReq::get('password')));
if (empty($card)) {
$this->message('充值卡号不能为空');
}
if (empty($password)) {
$this->message('充值卡密码不能为空');
}
$checkinfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "card where card ='" . $card . "' and card_password = '" . $password . "' and uid =0 and status = 0");
if (empty($checkinfo)) {
$this->message('充值卡不存在或者已使用');
}
$arr['uid'] = $this->member['uid'];
$arr['status'] = 1;
$arr['username'] = $this->member['username'];
$this->mysql->update(Mysite::$app->config['tablepre'] . 'card', $arr, "card ='" . $card . "' and card_password = '" . $password . "' and uid =0 and status = 0");
//`$key`
$this->mysql->update(Mysite::$app->config['tablepre'] . 'member', '`cost`=`cost`+' . $checkinfo['cost'], "uid ='" . $this->member['uid'] . "' ");
$allcost = $this->member['cost'] + $checkinfo['cost'];
$this->memberCls->addlog($this->member['uid'], 2, 1, $checkinfo['cost'], '充值卡充值', '使用充值卡' . $checkinfo['card'] . '充值' . $checkinfo['cost'] . '元', $allcost);
$this->success('兑换成功');
}
示例2: onCreateController
/**
* @brief theme和skin进行选择
*/
public static function onCreateController()
{
$controller = func_num_args() > 0 && func_get_arg(0) ? func_get_arg(0) : IWeb::$app->controller;
/**
* 对于theme和skin的判断流程
* 1,直接从URL中获取是否已经设定了方案__theme,__skin
* 2,从cookie获取数据
*/
$urlTheme = IReq::get('__theme');
$urlSkin = IReq::get('__skin');
if ($urlTheme && $urlSkin && preg_match('|^\\w+$|', $urlTheme) && preg_match('|^\\w+$|', $urlSkin)) {
ISafe::set('__theme', $theme = $urlTheme);
ISafe::set('__skin', $skin = $urlSkin);
} elseif (ISafe::get('__theme') && ISafe::get('__skin')) {
$theme = ISafe::get('__theme');
$skin = ISafe::get('__skin');
}
if (isset($theme) && isset($skin)) {
$themePath = IWeb::$app->getViewPath() . $theme . "/" . IWeb::$app->controller->getId();
if (is_dir($themePath)) {
$controller->theme = $theme;
$controller->skin = $skin;
}
}
}
示例3: uploadFile
function uploadFile()
{
//上传状态
$state = false;
//规格索引值
$specIndex = IReq::get('specIndex');
if ($specIndex === null) {
$message = '没有找到规格索引值';
} else {
//本地上传方式
if (isset($_FILES['attach']) && $_FILES['attach']['name'][0] != '') {
$photoInfo = $this->upload();
if ($photoInfo['flag'] == 1) {
$fileName = $photoInfo['dir'] . $photoInfo['name'];
$state = true;
}
} else {
if ($fileName = IReq::get('outerSrc', 'post')) {
$state = true;
} else {
if ($fileName = IReq::get('selectPhoto', 'post')) {
$state = true;
}
}
}
}
//根据状态值进行
if ($state == true) {
$this->actJs($specIndex, $fileName);
} else {
$message = '添加图片失败';
$this->redirect('/block/pic', false);
Util::showMessage($message);
}
}
示例4: smarty_function_load_data
function smarty_function_load_data($params, &$smarty)
{
(!isset($params['table']) || empty($params['table'])) && exit('`table` is empty!');
// $Mconfig = include(hopedir."config/hopeconfig.php");
// print_r($Mconfig);
$type = isset($params['type']) ? $params['type'] : 'list';
//total 总数量 one list 3个分类
$fileds = isset($params['fileds']) ? $params['fileds'] : '*';
$where = isset($params['where']) ? $params['where'] : '';
$where = empty($where) ? '' : ' where ' . $where;
$orderby = isset($params['orderby']) ? 'order by ' . $params['orderby'] : '';
$limit = isset($params['limit']) ? 'LIMIT 0,' . $params['limit'] : 'LIMIT 0,1';
if (!class_exists('mysql_class')) {
include hopedir . "lib/core/extend/mysql_class.php";
//core\extend
$mysql = new mysql_class();
} else {
$mysql = new mysql_class();
}
$page = intval(IFilter::act(IReq::get('page')));
$pagesize = intval(IFilter::act(IReq::get('pagesize')));
$pagesize = isset($params['pagesize']) ? $params['pagesize'] : $pagesize;
$pagesize = empty($pagesize) ? 10 : $pagesize;
// $db = $class::factory(array('table' => $params['table']));
//var_dump($params);
if (!empty($params['assign'])) {
//把数据赋值给变量$params['assign'],这样前端就可以使用这个变量了(例如可以结合foreach输出一个列表等)
// $smarty->assign($params['assign'], $db->get_block_list(array($params['where']), $params['limit']));
if ($type == 'total') {
$result = $mysql->counts("select " . $fileds . " from " . Mysite::$app->config['tablepre'] . $params['table'] . " " . $where . " " . $orderby . " " . $limit . "");
} elseif ($type == 'one') {
$result = $mysql->select_one("select " . $fileds . " from " . Mysite::$app->config['tablepre'] . $params['table'] . " " . $where . " " . $orderby . " " . $limit . "");
} else {
if (isset($params['showpage']) && $params['showpage'] == true) {
if (!class_exists('page')) {
include hopedir . "lib/core/extend/page.php";
//core\extend
$pageclass = new page();
} else {
$pageclass = new page();
}
$pageclass->setpage($page, $pagesize);
$result['list'] = $mysql->getarr("select " . $fileds . " from " . Mysite::$app->config['tablepre'] . $params['table'] . " " . $where . " " . $orderby . " limit " . $pageclass->startnum() . ", " . $pageclass->getsize() . "");
$shuliang = $mysql->counts("select " . $fileds . " from " . Mysite::$app->config['tablepre'] . $params['table'] . " " . $where . " ");
$pageclass->setnum($shuliang);
if (isset($params['pagetype'])) {
$result['pagecontent'] = $pageclass->ajaxbar($params['pagetype']);
} else {
$result['pagecontent'] = $pageclass->getpagebar();
}
} else {
$result['list'] = $mysql->getarr("select " . $fileds . " from " . Mysite::$app->config['tablepre'] . $params['table'] . " " . $where . " " . $orderby . " " . $limit . "");
}
}
/*
$result['list'] = array();
$result['pagecontent'] = ''; */
$smarty->assign($params['assign'], $result);
}
}
示例5: getSendData
/**
* @see paymentplugin::getSendData()
*/
public function getSendData($payment)
{
$defaultbank = IFilter::act(IReq::get('defaultbank'));
$return = array();
//基本参数
$return['service'] = 'create_direct_pay_by_user';
$return['partner'] = $payment['M_PartnerId'];
$return['seller_email'] = $payment['M_Email'];
$return['_input_charset'] = 'utf-8';
$return['payment_type'] = 1;
$return['return_url'] = $this->callbackUrl;
$return['notify_url'] = $this->serverCallbackUrl;
$return['defaultbank'] = $defaultbank;
$return['paymethod'] = 'bankPay';
//业务参数
$return['subject'] = $payment['R_Name'];
$return['out_trade_no'] = $payment['M_OrderNO'];
$return['total_fee'] = number_format($payment['M_Amount'], 2, '.', '');
//除去待签名参数数组中的空值和签名参数
$para_filter = $this->paraFilter($return);
//对待签名参数数组排序
$para_sort = $this->argSort($para_filter);
//生成签名结果
$mysign = $this->buildMysign($para_sort, $payment['M_PartnerKey']);
//签名结果与签名方式加入请求提交参数组中
$return['sign'] = $mysign;
$return['sign_type'] = 'MD5';
return $return;
}
示例6: login
/**
* @brief 商家登录动作
*/
public function login()
{
$seller_name = IFilter::act(IReq::get('username'));
$password = IReq::get('password');
$message = '';
if ($seller_name == '') {
$message = '登录名不能为空';
} else {
if ($password == '') {
$message = '密码不能为空';
} else {
$sellerObj = new IModel('seller');
$sellerRow = $sellerObj->getObj('seller_name = "' . $seller_name . '" and is_del = 0 and is_lock = 0');
if ($sellerRow && $sellerRow['password'] == md5($password)) {
$dataArray = array('login_time' => ITime::getDateTime());
$sellerObj->setData($dataArray);
$where = 'id = ' . $sellerRow["id"];
$sellerObj->update($where);
//存入私密数据
ISafe::set('seller_id', $sellerRow['id']);
ISafe::set('seller_name', $sellerRow['seller_name']);
ISafe::set('seller_pwd', $sellerRow['password']);
$this->redirect('/seller/index');
} else {
$message = '用户名与密码不匹配';
}
}
}
if ($message != '') {
$this->redirect('index', false);
Util::showMessage($message);
}
}
示例7: ungift
function ungift()
{
$this->checkmemberlogin();
$id = intval(IReq::get('id'));
if (empty($id)) {
$this->message('获取兑换记录失败');
}
$info = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "giftlog where uid ='" . $this->member['uid'] . "' and id=" . $id . " ");
if (empty($info)) {
$this->message('获取兑换记录失败');
}
if ($info['status'] != 0) {
$this->message('兑换已处理不可取消');
}
$lipininfo = $this->mysql->select_one("select * from " . Mysite::$app->config['tablepre'] . "gift where id ='" . $info['giftid'] . "' order by id asc ");
$titles = isset($lipininfo['title']) ? $lipininfo['title'] : $info['id'];
$this->mysql->update(Mysite::$app->config['tablepre'] . 'giftlog', array('status' => '4'), "id='" . $id . "'");
$ndata['score'] = $this->member['score'] + $info['score'];
//更新用户积分
$this->mysql->update(Mysite::$app->config['tablepre'] . 'member', '`score` = `score`+' . $info['score'], "uid='" . $this->member['uid'] . "'");
//写消息
$this->memberCls->addlog($this->member['uid'], 1, 1, $info['score'], '取消兑换礼品', '取消兑换ID为:' . $id . '的礼品[' . $titles . '],帐号积分' . $ndata['score'], $ndata['score']);
$lidata['stock'] = $lipininfo['stock'] + $info['count'];
$lidata['sell_count'] = $lipininfo['sell_count'] - $info['count'];
$this->mysql->update(Mysite::$app->config['tablepre'] . 'gift', $lidata, "id='" . $info['giftid'] . "'");
$this->success('操作成功');
}
示例8: getNoticeList
public function getNoticeList()
{
$page = IReq::get('page') ? IFilter::act(IReq::get('page'), 'int') : 1;
$query = new IQuery('announcement');
$query->order = 'id desc';
$query->page = $page;
return $query;
}
示例9: getHelpListByCatId
public function getHelpListByCatId($catId)
{
$page = IReq::get('page') ? IFilter::act(IReq::get('page'), 'int') : 1;
$query = new IQuery('help');
$query->where = "cat_id = " . $catId;
$query->order = 'sort desc,id desc';
$query->page = $page;
return $query;
}
示例10: getArticleListByCatid
public function getArticleListByCatid($category_id)
{
$page = IReq::get('page') ? IFilter::act(IReq::get('page'), 'int') : 1;
$query = new IQuery('article');
$query->where = 'category_id = ' . $category_id . ' and visibility = 1';
$query->order = 'id desc';
$query->page = $page;
return $query;
}
示例11: getSellerList
public function getSellerList()
{
$page = IReq::get('page') ? IFilter::act(IReq::get('page'), 'int') : 1;
$query = new IQuery('seller');
$query->where = 'is_del = 0';
$query->order = 'id desc';
$query->page = $page;
return $query;
}
示例12: curd
/**
* @brief 处理curd动作
* @return String
*/
public function curd()
{
$action = $this->id;
$controller = $this->controller;
$curdinfo = $this->initinfo();
if (is_array($curdinfo)) {
$modelName = $curdinfo['model'];
$key = $curdinfo['key'];
$actions = $curdinfo['actions'];
switch ($action) {
case 'add':
case 'upd':
if (method_exists($controller, 'getValidate')) {
$validate = $controller->getValidate();
} else {
$validate = null;
}
if ($validate != null) {
$formValidate = new IFormValidation($validate);
$data = $formValidate->run();
}
$model = new IModel($modelName);
if (isset($data) && $data !== null) {
$model->setData($data[$modelName]);
if ($action = 'add') {
$flag = $model->add();
} else {
$flag = $model->upd("{$key} = '" . IReq::get($key) . "'");
}
}
if (isset($flag) && $flag) {
$_GET['action'] = $actions['success'];
} else {
$_GET['action'] = $actions['fail'];
}
$controller->run();
return true;
case 'del':
$model = new IModel($modelName);
$flag = $model->del("{$key} = '" . IReq::get($key) . "'");
if ($flag) {
$_GET['action'] = $actions['success'];
} else {
$_GET['action'] = $actions['fail'];
}
$controller->run();
return true;
case 'get':
$model = new IModel($modelName);
$rs = $model->getObj("{$key} = '" . IReq::get($key) . "'");
echo JSON::encode($rs);
return false;
}
}
}
示例13: run
/**
* @param string $method form 表单提交方法,默认post方式提交
* @return array 表单验证后的信息
* @brief 表单元素验证
*/
function run()
{
$lang = new ILanguage();
$lang->load("form_validation");
foreach ($this->fieldData as $key => $value) {
foreach ($value as $k => $v) {
//获取要验证的数据
$this->fieldData[$key][$k]['postdate'] = IReq::get($this->fieldData[$key][$k]['name']);
//发现有误不继续验证
if ($this->errorflag) {
continue;
}
//获取验证规则
$rules = explode('|', $v['rules']);
foreach ($rules as $rule) {
//如果有数组带有错误信息,直接跳出
if ($this->fieldData[$key][$k]['error'] != '' || $this->errorflag) {
break;
}
$param = FALSE;
if (preg_match("/(.*?)\\[(.*?)\\]/", $rule, $match)) {
$rule = $match[1];
$param = $match[2];
}
//如果验证规则为空,则跳过不进行验证
if ($rule == '') {
continue;
}
//如果验证函数不存在,则进行正则表达式验证
$result = true;
if (method_exists($this, $rule)) {
//如果表单没有值并且不是必填的时候,不需要进行验证
if ($this->fieldData[$key][$k]['postdate'] || !$this->fieldData[$key][$k]['postdate'] && $rule == 'required') {
$result = $this->{$rule}($this->fieldData[$key][$k]['postdate'], $param);
}
} else {
$result = $this->check($rule, $this->fieldData[$key][$k]['postdate']);
}
if (!$result) {
//验证不通过,返回null,构建错误内容
$msg = $lang->g('fv_' . $rule);
$this->validate[$this->fieldData[$key][$k]['name']] = array('value' => $this->fieldData[$key][$k]['postdate'], 'msg' => $this->fieldData[$key][$k]['label'] . $msg);
$this->fieldData[$key][$k]['error'] = $this->fieldData[$key][$k]['label'] . $msg;
$this->errorMsg = $this->fieldData[$key][$k]['label'] . $msg;
$this->errorflag = true;
}
}
}
}
if ($this->errorflag) {
IWeb::$app->setRenderData(array('validate' => $this->validate));
}
return $this->fieldData;
}
示例14: delsingle
function delsingle()
{
$uid = IReq::get('id');
$uid = is_array($uid) ? $uid : array($uid);
$ids = join(',', $uid);
if (empty($ids)) {
$this->message('单页ID不能为空');
}
$this->mysql->delete(Mysite::$app->config['tablepre'] . 'single', "id in (" . $ids . ") ");
$this->success('操作成功');
}
示例15: onCreateController
/**
* @brief theme和skin进行选择
*/
public static function onCreateController()
{
$controller = func_num_args() > 0 ? func_get_arg(0) : IWeb::$app->controller;
//判断是否为后台管理控制器
if (in_array($controller->getId(), self::$syscontroller)) {
defined("IWEB_SCENE") ? "" : define("IWEB_SCENE", self::SCENE_SYSDEFAULT);
$controller->theme = self::$sysTheme;
$controller->skin = self::$sysSkin;
} elseif (in_array($controller->getId(), self::$sellercontroller)) {
defined("IWEB_SCENE") ? "" : define("IWEB_SCENE", self::SCENE_SYSSELLER);
$controller->theme = self::$sysSellerTheme;
$controller->skin = self::$sysSellerSkin;
} else {
defined("IWEB_SCENE") ? "" : define("IWEB_SCENE", self::SCENE_SITE);
/**
* 对于theme和skin的判断流程
* 1,直接从URL中获取是否已经设定了方案__theme,__skin
* 2,获取cookie中的方案名称
* 3,读取config配置中的默认方案
*/
$urlTheme = IReq::get('__theme');
$urlSkin = IReq::get('__skin');
if ($urlTheme && $urlSkin && preg_match('|^\\w+$|', $urlTheme) && preg_match('|^\\w+$|', $urlSkin)) {
ISafe::set('__theme', $controller->theme = $urlTheme);
ISafe::set('__skin', $controller->skin = $urlSkin);
} elseif (ISafe::get('__theme') && ISafe::get('__skin')) {
$controller->theme = ISafe::get('__theme');
$controller->skin = ISafe::get('__skin');
} else {
if (isset(IWeb::$app->config['theme'])) {
//根据不同的客户端进行智能选择
if (is_array(IWeb::$app->config['theme'])) {
$client = IClient::getDevice();
$controller->theme = isset(IWeb::$app->config['theme'][$client]) ? IWeb::$app->config['theme'][$client] : current(IWeb::$app->config['theme']);
} else {
$controller->theme = IWeb::$app->config['theme'];
}
}
if (isset(IWeb::$app->config['skin'])) {
//根据不同的客户端进行智能选择
if (is_array(IWeb::$app->config['skin'])) {
$client = IClient::getDevice();
$controller->skin = isset(IWeb::$app->config['skin'][$client]) ? IWeb::$app->config['skin'][$client] : current(IWeb::$app->config['skin']);
} else {
$controller->skin = IWeb::$app->config['skin'];
}
}
}
}
//修正runtime配置
IWeb::$app->runtimePath = IWeb::$app->getRuntimePath() . $controller->theme . '/';
IWeb::$app->webRunPath = IWeb::$app->getWebRunPath() . $controller->theme . '/';
}