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


PHP JRequest::getvar方法代码示例

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


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

示例1: cria_html

 function cria_html()
 {
     // adiciona a biblioteca juri
     jimport('joomla.environment.uri');
     // verifica se a urlbase foi adicionada
     if (!is_null($this->url_base)) {
         $u =& JURI::getInstance($this->url_base);
     } else {
         $u =& JURI::getInstance();
     }
     $links = '';
     $paginas_adm_select = '';
     $select = '';
     // loop nas páginas
     for ($i = 1; $i <= $this->total_paginas; $i++) {
         // adiciona a var na url
         $u->setVar($this->get_var_pagina, $i);
         // retorna o html tag a
         $class = $i == $this->pagina_atual ? ' class="atual"' : '';
         $links .= sprintf('<a href="%s"%s>%d</a> ', JRoute::_($u->toString()), $class, $i);
         // retorna o html select
         $selected = $i == $this->pagina_atual ? ' selected="selected"' : '';
         // cria o select para o site
         $select .= sprintf('<option value="%s" %s>Página %d</option> ', JRoute::_($u->toString()), $selected, $i);
         // cria o select para o adm
         $paginas_adm_select .= sprintf('<option value="%s" %s>Página %d</option> ', $i, $selected, $i);
     }
     // paginas para o adm
     $query = JRequest::get('post');
     unset($query[JUtility::getToken()], $query['funcao'], $query['method'], $query['class'], $query['pagina'], $query['programa'], $query['template'], $query['processID']);
     $u->setQuery($query);
     $u->setVar($this->get_var_pagina, '');
     $js = sprintf('<script type="text/javascript">$(function(){ $(\'select#%s\').change(function(){ eDesktop.dialog.load({programa: "%s", processID: "%s", pagina: "%s", query: "%s"+ $(this).val() }); });});</script>', $this->get_var_pagina, JRequest::getvar('programa'), JRequest::getvar('processID'), JRequest::getvar('pagina'), $u->getQuery());
     $paginas_adm_select = sprintf('<select name="%s" id="%s">%s</select>%s ', $this->get_var_pagina, $this->get_var_pagina, $paginas_adm_select, $js);
     $this->html['paginas.adm.select'] = $paginas_adm_select;
     // páginas para o site
     $js = sprintf('<script type="text/javascript">$(function(){ $(\'select#%s\').change(function(){window.location = $(this).val();});});</script>', $this->get_var_pagina);
     $select = sprintf('<select name="%s" id="%s">%s</select>%s', $this->get_var_pagina, $this->get_var_pagina, $select, $js);
     $this->html['paginas.links'] = $links;
     $this->html['paginas.select'] = $select;
     // ordem para site
     $order = '';
     $this->order_atual = JRequest::getVar($this->get_var_order);
     if (count($this->orders)) {
         foreach ($this->orders as $k => $v) {
             $u->setVar($this->get_var_pagina, 1);
             $u->setVar($this->get_var_order, $k);
             $selected = $k == $this->order_atual ? ' selected="selected"' : '';
             $order .= sprintf('<option value="%s" %s>%s</option> ', JRoute::_($u->toString()), $selected, $v['label']);
         }
         $js = sprintf('<script type="text/javascript">$(function(){ $(\'select#%s\').change(function(){window.location = $(this).val();});});</script>', $this->get_var_order);
         $order = sprintf('<select name="%s" id="%s">%s</select>%s', $this->get_var_order, $this->get_var_order, $order, $js);
         //
         $this->html['order.select'] = $order;
     }
     foreach ($this->html as $k => $v) {
         $key = str_replace('.', '_', $k);
         $this->html[$key] = $v;
     }
 }
开发者ID:eliasrosa,项目名称:eJoomla,代码行数:60,代码来源:paginacao.php

示例2: downloadFile

 /**
  * downloads a file
  *
  * @return void
  */
 function downloadFile()
 {
     $user = JFactory::getUser();
     $productfile_id = intval(JRequest::getvar('id', '', 'request', 'int'));
     $product_id = intval(JRequest::getvar('product_id', '', 'request', 'int'));
     $link = 'index.php?option=com_tienda&view=products&task=edit&id=' . $product_id;
     Tienda::load('TiendaHelperBase', 'helpers._base');
     $helper = TiendaHelperBase::getInstance('ProductDownload', 'TiendaHelper');
     JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_tienda' . DS . 'tables');
     $productfile = JTable::getInstance('ProductFiles', 'TiendaTable');
     $productfile->load($productfile_id);
     if (empty($productfile->productfile_id)) {
         $this->messagetype = 'notice';
         $this->message = JText::_('COM_TIENDA_INVALID FILE');
         $this->setRedirect($link, $this->message, $this->messagetype);
         return false;
     }
     // log and download
     Tienda::load('TiendaFile', 'library.file');
     // geting the ProductDownloadId to updated for which productdownload_max  is greater then 0
     $productToDownload = $helper->getProductDownloadInfo($productfile->productfile_id, $user->id);
     if ($downloadFile = TiendaFile::download($productfile)) {
         $link = JRoute::_($link, false);
         $this->setRedirect($link);
     }
 }
开发者ID:annggeel,项目名称:tienda,代码行数:31,代码来源:productfiles.php

示例3: getStates

 /**
  * Retireve a list of countries from the database.
  *
  * @author RickG, Max Milbers
  * @return object List of state objects
  */
 public function getStates($countryId, $noLimit = false, $published = false, $search = '')
 {
     $where = array();
     $where[] = '`virtuemart_country_id`= "' . (int) $countryId . '"';
     if ($search) {
         $search = '"%' . $this->_db->escape($search, true) . '%"';
         $where[] = '`state_name` LIKE ' . $search;
     }
     if ($published) {
         $where[] = '`published`="1"';
     } else {
         $published = JRequest::getvar('filter_published');
         if ($published === '1') {
             $where[] = '`published` = 1';
         } else {
             if ($published === '0') {
                 $where[] = '`published` = 0';
             }
         }
     }
     $whereString = '';
     if (count($where) > 0) {
         $whereString = ' WHERE ' . implode(' AND ', $where);
     }
     $ordering = $this->_getOrdering();
     // var_dump($ordering,$this->_selectedOrdering); jexit();
     return $this->_data = $this->exeSortSearchListQuery(0, '*', ' FROM `#__virtuemart_states`', $whereString, '', $ordering);
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:34,代码来源:state.php

示例4: getRatings

 /**
  * Select the products to list on the product list page
  */
 public function getRatings()
 {
     $where = array();
     $tables = ' FROM `#__virtuemart_ratings` AS `r` JOIN `#__virtuemart_products_' . VMLANG . '` AS `p`
  			USING (`virtuemart_product_id`) ';
     if ($filter_ratings = jrequest::getvar('filter_ratings')) {
         $where[] = 'product_name like "%' . $this->_db->escape($filter_ratings) . '%"';
     }
     $published = JRequest::getvar('filter_published');
     if ($published === '1') {
         $where[] = "`r`.`published` = 1 ";
     } else {
         if ($published === '0') {
             $where[] = "`r`.`published` = 0 ";
         }
     }
     if (!empty($where)) {
         $whereString = 'where ' . implode(" AND ", $where);
     } else {
         $whereString = '';
     }
     echo $whereString;
     $this->_data = $this->exeSortSearchListQuery(0, ' r.*,p.`product_name` ', $tables, $whereString, '', $this->_getOrdering());
     // 	    $this->_data = $this->_getList($q, $this->getState('limitstart'), $this->getState('limit'));
     // set total for pagination
     // 		$this->_total = $this->_getListCount($q) ;
     // 		if(empty($this->_data)) $this->_data = array();
     // 		if(!isset($this->_total)) $this->_total = 0;
     return $this->_data;
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:33,代码来源:ratings.php

示例5: getInventoryFilter

 /**
  * Collect the filters for the query
  * @author RolandD
  * @author Max Milbers
  */
 private function getInventoryFilter()
 {
     /* Check some filters */
     $filters = array();
     if ($search = JRequest::getVar('filter_inventory', false)) {
         $search = '"%' . $this->_db->escape($search, true) . '%"';
         //$search = $this->_db->Quote($search, false);
         $filters[] = '`#__virtuemart_products`.`product_name` LIKE ' . $search;
     }
     if (JRequest::getInt('stockfilter', 0) == 1) {
         $filters[] = '`#__virtuemart_products`.`product_in_stock` > 0';
     }
     if ($catId = JRequest::getInt('virtuemart_category_id', 0) > 0) {
         $filters[] = '`#__virtuemart_categories`.`virtuemart_category_id` = ' . $catId;
     }
     $published = JRequest::getvar('filter_published');
     if ($published === '1') {
         $filters[] = "`#__virtuemart_products`.`published` = 1 ";
     } else {
         if ($published === '0') {
             $filters[] = "`#__virtuemart_products`.`published` = 0 ";
         }
     }
     $filters[] = '(`#__virtuemart_shoppergroups`.`default` = 1 OR `#__virtuemart_shoppergroups`.`default` is NULL)';
     return ' WHERE ' . implode(' AND ', $filters) . $this->_getOrdering();
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:31,代码来源:inventory.php

示例6: attack

 function attack()
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $id = JRequest::getvar('id');
     $monster = $this->getMonster($id, $db);
     $player = $this->getPlayer($user, $db);
     $attackRoundMonster = $monster->defence + rand(0, 6);
     $attackRoundPlayer = $monster->attack + rand(0, 6);
     if ($attackRoundPlayer > $attackRoundMonster) {
         $query = "UPDATE #__jigs_monsters SET health = health -10 WHERE id= {$id}";
         $db->setQuery($query);
         $db->query();
         $message = 'You caused 10 hit points of damage';
         MessagesHelper::sendFeedback($user->id, $message);
     }
     $query = "SELECT health FROM  #__jigs_monsters WHERE id= {$id}";
     $db->setQuery($query);
     $result['id'] = $id;
     $result['health'] = $db->loadResult();
     $entryData = array('category' => 'monsterHealthCategory', 'title' => 'title', 'article' => $result, 'when' => time());
     $context = new ZMQContext();
     $socket = $context->getSocket(ZMQ::SOCKET_PUSH, 'my pusher');
     if ($socket->connect("tcp://localhost:5555")) {
         //   echo 'connected';
     }
     if ($socket->send(json_encode($entryData))) {
         //  echo 'delivered';
     }
     return true;
 }
开发者ID:Rai-Ka,项目名称:JiGS-PHP-RPG-engine,代码行数:31,代码来源:monsters.php

示例7: paste

 /**
  * Paste the table  in json format
  *
  */
 public function paste()
 {
     // TODO Test user ?
     $json = array();
     $json['fields'] = 'error';
     $json['msg'] = 'Invalid Token';
     $json['structure'] = 'empty';
     if (!JSession::checkToken('get')) {
         echo json_encode($json);
         jexit();
     }
     $lang = JRequest::getvar('lg');
     $langs = VmConfig::get('active_languages', array());
     $language = JFactory::getLanguage();
     if (!in_array($lang, $langs)) {
         $json['msg'] = 'Invalid language ! ' . $lang;
         $json['langs'] = $langs;
         echo json_encode($json);
         jexit();
     }
     $lang = strtolower($lang);
     // Remove tag if defaut or
     // if ($language->getDefault() == $lang ) $dblang ='';
     $dblang = strtr($lang, '-', '_');
     $id = JRequest::getInt('id', 0);
     $viewKey = JRequest::getWord('editView');
     // we have here 2 access user & vendor give same results
     if ($viewKey == 'user') {
         $viewKey = 'vendor';
     }
     // Not needed , vendor is checked in constructor
     //if ($viewKey == 'vendor') $id = 1 ;
     $tables = array('category' => 'categories', 'product' => 'products', 'manufacturer' => 'manufacturers', 'manufacturercategories' => 'manufacturercategories', 'vendor' => 'vendors', 'paymentmethod' => 'paymentmethods', 'shipmentmethod' => 'shipmentmethods');
     if (!isset($tables[$viewKey])) {
         $json['msg'] = "Invalid view " . $viewKey;
         echo json_encode($json);
         jExit();
     }
     $tableName = '#__virtuemart_' . $tables[$viewKey] . '_' . $dblang;
     $db = JFactory::getDBO();
     $q = 'select * FROM `' . $tableName . '` where `virtuemart_' . $viewKey . '_id` =' . $id;
     $db->setQuery($q);
     if ($json['fields'] = $db->loadAssoc()) {
         $json['structure'] = 'filled';
         $json['msg'] = jText::_('COM_VIRTUEMART_SELECTED_LANG') . ':' . $lang;
     } else {
         $json['structure'] = 'empty';
         $db->setQuery('SHOW COLUMNS FROM ' . $tableName);
         $tableDescribe = $db->loadAssocList();
         array_shift($tableDescribe);
         $fields = array();
         foreach ($tableDescribe as $key => $val) {
             $fields[$val['Field']] = $val['Field'];
         }
         $json['fields'] = $fields;
         $json['msg'] = JText::sprintf('COM_VIRTUEMART_LANG_IS_EMPTY', $lang, jText::_('COM_VIRTUEMART_' . strtoupper($viewKey)));
     }
     echo json_encode($json);
     jExit();
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:64,代码来源:translate.php

示例8: get_all_spells

 function get_all_spells()
 {
     $db = JFactory::getDBO();
     $parent = JRequest::getvar('parent');
     $query = "SELECT *\n            FROM #__jigs_spell_types\n            WHERE #__jigs_spell_types.parent_id = '{$parent}'";
     $db->setQuery($query);
     return $db->loadAssocList();
 }
开发者ID:Rai-Ka,项目名称:JiGS-PHP-RPG-engine,代码行数:8,代码来源:spells.php

示例9: getPlate

 public function getPlate()
 {
     $idPlate = JRequest::getvar('id');
     if (empty($this->_data)) {
         $query = "SELECT * FROM #__jigs_plates WHERE id = {$idPlate}";
         $this->_data = $this->_getList($query);
     }
     return $this->_data;
 }
开发者ID:Rai-Ka,项目名称:JiGS-PHP-RPG-engine,代码行数:9,代码来源:plate.php

示例10: get_weapons

 function get_weapons($id)
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $character_id = JRequest::getvar(id);
     $db->setQuery("SELECT #__jigs_weapons.item_id, #__jigs_weapon_types.name, #__jigs_weapon_types.sell_price, #__jigs_weapon_types.image " . "FROM #__jigs_weapons " . "LEFT JOIN #__jigs_weapon_types " . "ON #__jigs_weapons.item_id = #__jigs_weapon_types.id " . "WHERE #__jigs_weapons.player_id =" . $id);
     $result = $db->loadAssocList();
     return $result;
 }
开发者ID:Rai-Ka,项目名称:JiGS-PHP-RPG-engine,代码行数:9,代码来源:player.php

示例11: get_charactor_inventory

 function get_charactor_inventory()
 {
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $character_id = JRequest::getvar(character_id);
     $db->setQuery("SELECT #__jigs_inventory.item_id, " . "#__jigs_objects.name " . "FROM #__jigs_inventory " . "LEFT JOIN #__jigs_objects " . "ON #__jigs_inventory.item_id = #__jigs_objects.id " . "WHERE #__jigs_inventory.player_id =" . $character_id);
     $result = $db->loadAssocList();
     return $result;
 }
开发者ID:yatan,项目名称:JiGS-PHP-RPG-engine,代码行数:9,代码来源:people.php

示例12: enter_Canvas

 function enter_Canvas()
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $query = "Update #__jigs_players SET active=4 WHERE id = " . $user->id;
     $db->setQuery($query);
     $db->query();
     return JRequest::getvar('id');
     //return;
 }
开发者ID:yatan,项目名称:JiGS-PHP-RPG-engine,代码行数:10,代码来源:canvas.php

示例13: get_software

 function get_software()
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $parent = JRequest::getvar('parent');
     $query = "SELECT * FROM #__jigs_software\n          WHERE #__jigs_software.iduser = {$user->id}";
     $db->setQuery($query);
     $data = $db->loadAssocList();
     return $data;
 }
开发者ID:Rai-Ka,项目名称:JiGS-PHP-RPG-engine,代码行数:10,代码来源:software.php

示例14: work_conveyer

 function work_conveyer()
 {
     $building_id = JRequest::getvar(building_id);
     $line = JRequest::getvar(line);
     $type = JRequest::getvar(type);
     $quantity = JRequest::getvar(quantity);
     $model = $this->getModel('building');
     $result = $model->work_conveyer($building_id, $quantity, $type, $line);
     echo Json_encode($result);
 }
开发者ID:euclidthedark,项目名称:JiGS-PHP-RPG-engine,代码行数:10,代码来源:battle.json.php

示例15: display

 /**
  * Function Description
  *
  * @author RolandD
  * @author George
  * @access public
  */
 public function display($cachable = false, $urlparams = false)
 {
     if (JRequest::getvar('search')) {
         $view = $this->getView('category', 'html');
         $view->display();
     } else {
         // Display it all
         $safeurlparams = array('virtuemart_category_id' => 'INT', 'virtuemart_manufacturer_id' => 'INT', 'virtuemart_currency_id' => 'INT', 'return' => 'BASE64', 'lang' => 'CMD', 'orderby' => 'CMD', 'limitstart' => 'CMD', 'order' => 'CMD', 'limit' => 'CMD');
         parent::display(true, $safeurlparams);
     }
 }
开发者ID:Gskflute,项目名称:joomla25,代码行数:18,代码来源:category.php


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