当前位置: 首页>>代码示例>>PHP>>正文


PHP IFilter::act方法代码示例

本文整理汇总了PHP中IFilter::act方法的典型用法代码示例。如果您正苦于以下问题:PHP IFilter::act方法的具体用法?PHP IFilter::act怎么用?PHP IFilter::act使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IFilter的用法示例。


在下文中一共展示了IFilter::act方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
    }
}
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:60,代码来源:function.load_data.php

示例2: 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;
 }
开发者ID:xzdesk,项目名称:iwebshop.com,代码行数:32,代码来源:bank_alipay.php

示例3: savesingle

 function savesingle()
 {
     $id = IReq::get('uid');
     $data['addtime'] = strtotime(IReq::get('addtime') . ' 00:00:00');
     $data['title'] = IReq::get('title');
     $data['content'] = IReq::get('content');
     $data['code'] = IReq::get('code');
     $data['seo_key'] = IFilter::act(IReq::get('seo_key'));
     $data['seo_content'] = IFilter::act(IReq::get('seo_content'));
     if (empty($id)) {
         $link = IUrl::creatUrl('adminpage/single/module/addsingle');
         if (empty($data['content'])) {
             $this->message('单页内容不能为空', $link);
         }
         if (empty($data['title'])) {
             $this->message('单页标题不能为空', $link);
         }
         $this->mysql->insert(Mysite::$app->config['tablepre'] . 'single', $data);
     } else {
         $link = IUrl::creatUrl('single/addsingle/id/' . $id);
         if (empty($data['content'])) {
             $this->message('单页内容不能为空', $link);
         }
         if (empty($data['title'])) {
             $this->message('单页标题不能为空', $link);
         }
         $this->mysql->update(Mysite::$app->config['tablepre'] . 'single', $data, "id='" . $id . "'");
     }
     $link = IUrl::creatUrl('adminpage/single/module/singlelist');
     $this->success('操作成功', $link);
 }
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:31,代码来源:adminmethod.php

示例4: adminupload

 public function adminupload()
 {
     $func = IFilter::act(IReq::get('func'));
     $obj = IReq::get('obj');
     $uploaddir = IFilter::act(IReq::get('dir'));
     if (is_array($_FILES) && isset($_FILES['imgFile'])) {
         $uploaddir = empty($uploaddir) ? 'goods' : $uploaddir;
         $json = new Services_JSON();
         $uploadpath = 'upload/' . $uploaddir . '/';
         $filepath = '/upload/' . $uploaddir . '/';
         $upload = new upload($uploadpath, array('gif', 'jpg', 'jpge', 'doc', 'png'));
         //upload 自动生成压缩图片
         $file = $upload->getfile();
         if ($upload->errno != 15 && $upload->errno != 0) {
             echo "<script>parent." . $func . "(true,'" . $obj . "','" . json_encode($upload->errmsg()) . "');</script>";
         } else {
             echo "<script>parent." . $func . "(false,'" . $obj . "','" . $filepath . $file[0]['saveName'] . "');</script>";
         }
         exit;
     }
     $data['obj'] = $obj;
     $data['uploaddir'] = $uploaddir;
     $data['func'] = $func;
     Mysite::$app->setdata($data);
 }
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:25,代码来源:adminmethod.php

示例5: 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);
     }
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:36,代码来源:systemseller.php

示例6: _attribute_update

 /**
  * @brief 商品属性添加/修改
  * @param array $attribute 表字段 数组格式,如Array ([name] 		=> Array ( [0] => '' )
  *													[show_type] => Array ( [0] => '' )
  *													[value] 	=> Array ( [0] => '' )
  *													[is_seach] 	=> Array ( [0] => 1 ))
  * @param int $model_id 模型编号
  */
 public function _attribute_update($attribute, $model_id)
 {
     //初始化attribute商品模型属性表类对象
     $attributeObj = new IModel('attribute');
     $len = count($attribute['name']);
     $ids = "";
     for ($i = 0; $i < $len; $i++) {
         if (IValidate::required($attribute['name'][$i]) && IValidate::required($attribute['value'][$i])) {
             $options = str_replace(',', ',', $attribute['value'][$i]);
             $type = isset($attribute['is_search'][$i]) ? $attribute['is_search'][$i] : 0;
             //设置商品模型扩展属性 字段赋值
             $filedData = array("model_id" => intval($model_id), "type" => IFilter::act($attribute['show_type'][$i]), "name" => IFilter::act($attribute['name'][$i]), "value" => rtrim(IFilter::act($options), ','), "search" => IFilter::act($type));
             $attributeObj->setData($filedData);
             $id = intval($attribute['id'][$i]);
             if ($id) {
                 //更新商品模型扩展属性
                 $attributeObj->update("id = " . $id);
             } else {
                 //新增商品模型扩展属性
                 $id = $attributeObj->add();
             }
             $ids .= $id . ',';
         }
     }
     if ($ids) {
         $ids = trim($ids, ',');
         //删除商品模型扩展属性
         $where = "model_id = {$model_id}  and id not in (" . $ids . ") ";
         $attributeObj->del($where);
     }
 }
开发者ID:zhendeguoke1008,项目名称:shop,代码行数:39,代码来源:model.php

示例7: brand_save

 /**
  * @brief 保存品牌
  */
 function brand_save()
 {
     $brand_id = IFilter::act(IReq::get('brand_id'), 'int');
     $name = IFilter::act(IReq::get('name'));
     $sort = IFilter::act(IReq::get('sort'), 'int');
     $url = IFilter::act(IReq::get('url'));
     $description = IFilter::act(IReq::get('description'), 'text');
     $tb_brand = new IModel('brand');
     $brand = array('name' => $name, 'sort' => $sort, 'url' => $url, 'description' => $description);
     if (isset($_FILES['logo']['name']) && $_FILES['logo']['name'] != '') {
         $uploadObj = new PhotoUpload();
         $uploadObj->setIterance(false);
         $photoInfo = $uploadObj->run();
         if (isset($photoInfo['logo']['img']) && file_exists($photoInfo['logo']['img'])) {
             $brand['logo'] = $photoInfo['logo']['img'];
         }
     }
     $tb_brand->setData($brand);
     if ($brand_id) {
         $where = "id=" . $brand_id;
         $tb_brand->update($where);
     } else {
         $tb_brand->add();
     }
     $this->brand_list();
 }
开发者ID:Wen1750686723,项目名称:utao,代码行数:29,代码来源:brand.php

示例8: resolveView

 /**
  * @brief 解析视图路径
  * @param string $viewPath 视图名称
  */
 public function resolveView($viewPath)
 {
     $viewPath = IFilter::act($viewPath, 'filename');
     //分割模板目录的层次
     $view = strtr($viewPath, '-', '/');
     $this->view = $this->basePath = $this->getController()->getViewFile($view);
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:11,代码来源:view_action.php

示例9: 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('兑换成功');
 }
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:25,代码来源:method.php

示例10: 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;
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:8,代码来源:notice.php

示例11: 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;
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:9,代码来源:help.php

示例12: 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;
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:9,代码来源:article.php

示例13: 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;
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:9,代码来源:seller.php

示例14: toSubmit

 /**
 * @brief form提交事件
 	* @param array 订单的详细信息
 	× @return array 返回支付需提交的详细信息
 */
 function toSubmit($payment)
 {
     //合作者身份(parterID)-帐号
     $merId = $this->getConf($payment['M_Paymentid'], 'member_id');
     //交易安全校验码(key)
     $pKey = $this->getConf($payment['M_Paymentid'], 'PrivateKey');
     $key = $pKey == '' ? 'afsvq2mqwc7j0i69uzvukqexrzd0jq6h' : $pKey;
     //订单总价
     $amount = number_format($payment['M_Amount'], 2, ".", "");
     //商店名称
     $shopName = IFilter::act($payment['R_Name']);
     //标题
     $subject = $shopName . '订单';
     //初始化返回值
     $return = array();
     //交易接口名称
     $real_method = $this->getConf($payment['M_Paymentid'], 'real_method');
     switch ($real_method) {
         case '0':
             $return['service'] = 'trade_create_by_buyer';
             break;
         case '1':
             $return['service'] = 'create_direct_pay_by_user';
             break;
         case '2':
             $return['service'] = 'create_partner_trade_by_buyer';
             break;
     }
     //付完款后跳转的页面 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
     $return['return_url'] = $this->callbackUrl;
     //交易过程中服务器通知的页面 要用 http://格式的完整路径,不允许加?id=123这类自定义参数
     $return['notify_url'] = $this->serverCallbackUrl;
     $return['payment_type'] = 1;
     $return['partner'] = $merId;
     $return['subject'] = $subject;
     $return['body'] = '网店订单';
     $return['out_trade_no'] = $payment['M_OrderNO'];
     $return['total_fee'] = $amount;
     $return['seller_id'] = $merId;
     $return['_input_charset'] = 'utf-8';
     ksort($return);
     reset($return);
     $mac = "";
     foreach ($return as $k => $v) {
         $mac .= '&' . $k . '=' . $v;
     }
     $mac = substr($mac, 1);
     $return['sign'] = md5($mac . $key);
     //验证信息
     $return['sign_type'] = 'MD5';
     //验证信息
     unset($return['_input_charset']);
     return $return;
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:59,代码来源:pay_alipay.php

示例15: help_del

 public static function help_del($id)
 {
     if (!is_array($id)) {
         $id = array($id);
     }
     $id = IFilter::act($id, 'int');
     $id = implode(",", $id);
     $tb_help = new IModel("help");
     $tb_help->del("id IN ({$id})");
     return array('flag' => true, 'data' => 'success');
 }
开发者ID:chenyongze,项目名称:iwebshop,代码行数:11,代码来源:sitehelp.php


注:本文中的IFilter::act方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。