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


PHP vmRequest::getInt方法代码示例

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


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

示例1: validate_add

 /**
  * Validates the input parameters onBeforeUserAdd
  *
  * @param array $d
  * @return boolean
  */
 function validate_add(&$d)
 {
     global $my, $perm, $vmLogger, $VM_LANG;
     $db = new ps_DB();
     $valid = true;
     $missing = "";
     require_once CLASSPATH . 'ps_userfield.php';
     $requiredFields = ps_userfield::getUserFields('registration', true);
     $skipFields = array('username', 'password', 'password2', 'email', 'agreed');
     foreach ($requiredFields as $field) {
         if (in_array($field->name, $skipFields)) {
             continue;
         }
         switch ($field->type) {
             case 'age_verification':
                 // The Age Verification here is just a simple check if the selected date
                 // is a birthday older than the minimum age (default: 18)
                 $d[$field->name] = vmRequest::getInt('birthday_selector_year') . '-' . vmRequest::getInt('birthday_selector_month') . '-' . vmRequest::getInt('birthday_selector_day');
                 break;
             default:
                 if (empty($d[$field->name]) && $field->sys == 1) {
                     $valid = false;
                     $fieldtitle = $field->title;
                     if ($VM_LANG->exists($fieldtitle)) {
                         $fieldtitle = $VM_LANG->_($fieldtitle);
                     }
                     $vmLogger->err(sprintf($VM_LANG->_('VM_USER_ERR_MISSINGVALUE'), $fieldtitle));
                 }
                 break;
         }
     }
     $d['user_email'] = @$d['email'];
     if (!$d['perms']) {
         $vmLogger->warning($VM_LANG->_('VM_USER_ERR_GROUP'));
         $valid = false;
     } else {
         if (!$perm->hasHigherPerms($d['perms'])) {
             $vmLogger->err(sprintf($VM_LANG->_('VM_USER_ADD_ERR_NOPERMS'), $d['perms']));
             $valid = false;
         }
     }
     return $valid;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:49,代码来源:ps_user.php

示例2: mm_showMyFileName

* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
require_once CLASSPATH . 'ps_product.php';
$ps_product = new ps_product();
$Itemid = $sess->getShopItemid();
global $vendor_currency, $user;
// Order_id is returned by checkoutComplete function
$order_id = $db->getEscaped(vmGet($vars, 'order_id'));
$print = vmRequest::getInt('print', 0);
/** Retrieve User Email **/
$q = "SELECT * FROM `#__{vm}_order_user_info` WHERE `order_id`='{$order_id}' AND `address_type`='BT'";
$db->query($q);
$db->next_record();
$old_user = '';
if (!empty($user) && is_object($user)) {
    $old_user = $user;
}
$user = $db->record[0];
$dbbt = $db->_clone($db);
$user->email = $db->f("user_email");
/** Retrieve Order & Payment Info **/
$db = new ps_DB();
$q = "SELECT * FROM (`#__{vm}_order_payment` LEFT JOIN `#__{vm}_payment_method` ";
$q .= "ON `#__{vm}_payment_method`.`payment_method_id`  = `#__{vm}_order_payment`.`payment_method_id`), `#__{vm}_orders` ";
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:31,代码来源:checkout.thankyou.php

示例3: shopMakeHtmlSafe

		// so we don't have to make safe if ">" is found
		if (strpos($v,">")===false) {
			$v = shopMakeHtmlSafe($v);
		}
		if( $k == 3 ) {
			echo $CURRENCY_DISPLAY->getFullValue( $v )."; ";
		} elseif( $k > 0 && $k < 4) {
			echo $v.'; ';
		}
	}
	echo "</td></tr>";
}

unset( $row );
if( !isset($order_total) || $order_total > 0.00 ) {
	$payment_method_id = vmRequest::getInt( 'payment_method_id' );
	
	$db->query("SELECT payment_method_id, payment_method_name FROM #__{vm}_payment_method WHERE payment_method_id='$payment_method_id'");
	$db->next_record();
	echo '<tr><td valign="top"><strong>'.$VM_LANG->_('PHPSHOP_ORDER_PRINT_PAYMENT_LBL') . ":</strong></td>";
	echo '<td>';
	echo $db->f("payment_method_name");
	echo "</td></tr>";
}
echo '</table>';
?>
<br />
<div>
    <?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CUSTOMER_NOTE') ?>:<br />
    <textarea title="<?php echo $VM_LANG->_('PHPSHOP_CHECKOUT_CUSTOMER_NOTE') ?>" cols="50" rows="5" name="customer_note"></textarea>
    <br /><br />
开发者ID:rubengarcia0510,项目名称:tienda,代码行数:31,代码来源:get_final_confirmation.tpl.php

示例4: featuredProducts

 function featuredProducts($random, $products, $categories)
 {
     global $VM_LANG;
     require_once CLASSPATH . 'ps_product_attribute.php';
     $ps_product_attribute = new ps_product_attribute();
     $db = new ps_DB();
     $tpl = new $GLOBALS['VM_THEMECLASS']();
     $category_id = null;
     if ($categories) {
         $category_id = vmRequest::getInt('category_id');
     }
     if ($category_id) {
         $q = "SELECT DISTINCT product_sku,#__{vm}_product.product_id,product_name,product_s_desc,product_thumb_image, product_full_image, product_in_stock, product_url FROM #__{vm}_product, #__{vm}_product_category_xref, #__{vm}_category WHERE \n";
         $q .= "(#__{vm}_product.product_parent_id='' OR #__{vm}_product.product_parent_id='0') \n";
         $q .= "AND #__{vm}_product.product_id=#__{vm}_product_category_xref.product_id \n";
         $q .= "AND #__{vm}_category.category_id=#__{vm}_product_category_xref.category_id \n";
         $q .= "AND #__{vm}_category.category_id='{$category_id}' \n";
         $q .= "AND #__{vm}_product.product_publish='Y' \n";
         $q .= "AND #__{vm}_product.product_special='Y' \n";
         if (CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
             $q .= " AND product_in_stock > 0 \n";
         }
         $q .= 'ORDER BY RAND() LIMIT 0, ' . (int) $products;
     } else {
         $q = "SELECT DISTINCT product_sku,product_id,product_name,product_s_desc,product_thumb_image, product_full_image, product_in_stock, product_url FROM #__{vm}_product WHERE ";
         $q .= "(#__{vm}_product.product_parent_id='' OR #__{vm}_product.product_parent_id='0') AND vendor_id='" . $_SESSION['ps_vendor_id'] . "' ";
         $q .= "AND #__{vm}_product.product_publish='Y' ";
         $q .= "AND #__{vm}_product.product_special='Y' ";
         if (CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
             $q .= " AND product_in_stock > 0 ";
         }
         $q .= 'ORDER BY RAND() LIMIT 0, ' . (int) $products;
     }
     $db->query($q);
     // Output using template
     if ($db->num_rows() > 0) {
         $i = 0;
         $featured_products = array();
         while ($db->next_record()) {
             $flypage = $this->get_flypage($db->f("product_id"));
             $featured_products[$i]['product_sku'] = $db->f("product_sku");
             $featured_products[$i]['product_name'] = $db->f("product_name");
             $price = "";
             if (_SHOW_PRICES == '1') {
                 // Show price, but without "including X% tax"
                 $price = $this->show_price($db->f("product_id"), false);
             }
             $featured_products[$i]['product_price'] = $price;
             $featured_products[$i]['product_s_desc'] = $db->f("product_s_desc");
             $featured_products[$i]['product_url'] = $db->f("product_url");
             $featured_products[$i]['product_thumb'] = $db->f("product_thumb_image");
             $featured_products[$i]['product_full_image'] = $db->f("product_full_image");
             $featured_products[$i]['product_id'] = $db->f("product_id");
             $featured_products[$i]['flypage'] = $flypage;
             $featured_products[$i]['form_addtocart'] = "";
             if (USE_AS_CATALOGUE != '1' && $price != "" && !stristr($price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL')) && !$this->product_has_attributes($db->f('product_id'), true) && $tpl->get_cfg('showAddtocartButtonOnProductList')) {
                 $tpl->set('i', $i);
                 $tpl->set('product_id', $db->f('product_id'));
                 $tpl->set('ps_product_attribute', $ps_product_attribute);
                 $tpl->set('product_in_stock', $db->f('product_in_stock'));
                 $featured_products[$i]['form_addtocart'] = $tpl->fetch('browse/includes/addtocart_form.tpl.php');
                 $featured_products[$i]['has_addtocart'] = true;
             }
             $i++;
         }
         $tpl->set('featured_products', $featured_products);
         return $tpl->fetch('common/featuredProducts.tpl.php');
     }
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:69,代码来源:ps_product.php

示例5: sefRelToAbs

                $itemid = '&Itemid=' . $sess->getShopItemid();
                if ($ibg != 0) {
                    $mymenu_content .= ",";
                }
                $mymenu_content .= "\n[ '<img src=\"' + ctThemeXPBase + 'darrow.png\" alt=\"arr\" />','" . $db->f("category_name", false) . "','" . sefRelToAbs('index.php?option=com_virtuemart&page=shop.browse&category_id=' . $db->f("category_id") . $itemid) . "',null,'" . $db->f("category_name", false) . "'\n ";
                $ibg++;
                /* recurse through the subcategories */
                $this->traverse_tree_down($mymenu_content, $db->f("category_child_id"), $level);
                /* let's see if the loop has reached its end */
                $mymenu_content .= "]";
            }
        }
    }
}
$Itemid = vmRequest::getInt('Itemid');
$TreeId = vmRequest::getInt('TreeId');
if (vmIsJoomla('1.5')) {
    $js_src = 'modules/mod_virtuemart';
} else {
    $js_src = 'modules';
}
echo vmCommonHTML::scriptTag('', 'var ctThemeXPBase = "' . $js_src . '/ThemeXP/";');
if ($jscook_type == "tree") {
    if ($jscookTree_style == "ThemeXP") {
        $jscook_tree = "ctThemeXP1";
    }
    if ($jscookTree_style == "ThemeNavy") {
        $jscook_tree = "ctThemeNavy";
    }
    echo vmCommonHTML::scriptTag($js_src . '/JSCookTree.js');
    echo vmCommonHTML::linkTag($js_src . "/{$jscookTree_style}/theme.css");
开发者ID:albertobraschi,项目名称:Hab,代码行数:31,代码来源:vm_JSCook.php

示例6: getFirstLevelItem

 function getFirstLevelItem($mitem)
 {
     global $Itemid, $mosConfig_live_site, $mainframe, $sess;
     $txt = '';
     switch ($mitem->type) {
         case 'separator':
         case 'component_item_link':
             break;
         case 'content_item_link':
             $temp = split("&task=view&id=", $mitem->link);
             $mitem->link .= '&Itemid=' . $mainframe->getItemid($temp[1]);
             break;
         case 'url':
             if (eregi('index.php\\?', $mitem->link)) {
                 if (!eregi('Itemid=', $mitem->link)) {
                     $mitem->link .= '&Itemid=' . $mitem->id;
                 }
             }
             break;
         case 'content_typed':
         default:
             $mitem->link .= '&Itemid=' . $sess->getShopItemid();
             break;
     }
     $id = 'id="menu' . $mitem->id . '"';
     $mitem->link = vmAmpReplace($mitem->link);
     if (strcasecmp(substr($mitem->link, 0, 4), 'http')) {
         $mitem->link = sefRelToAbs($mitem->link);
     }
     $menuclass = 'mainlevel' . $this->parent->_params->get('class_sfx');
     // Active Menu highlighting
     $current_itemid = trim(vmRequest::getInt('Itemid'));
     if (in_array($mitem->id, $this->parent->open)) {
         $menuclass = 'mainlevel_active' . $this->parent->_params->get('class_sfx');
     }
     switch ($mitem->browserNav) {
         // cases are slightly different
         case 1:
             // open in a new window
             $txt = '<a href="' . $mitem->link . '" target="_blank" class="' . $menuclass . '" ' . $id . '>' . $mitem->name . '</a>';
             break;
         case 2:
             // open in a popup window
             $txt = "<a href=\"#\" onclick=\"javascript: window.open('" . $mitem->link . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"{$menuclass}\" " . $id . ">" . $mitem->name . "</a>\n";
             break;
         case 3:
             // don't link it
             $txt = '<span class="' . $menuclass . '" ' . $id . '>' . $mitem->name . '</span>';
             break;
         default:
             // formerly case 2
             // open in parent window
             $txt = '<a href="' . $mitem->link . '" class="' . $menuclass . '" ' . $id . '>' . $mitem->name;
             if ($this->parent->hasSubItems($mitem->id)) {
                 $txt .= '&nbsp;&nbsp;<img border="0" src="' . $this->parent->_params->get('LSPath') . '/img/tabarrow.gif" alt="arrow" />';
             }
             $txt .= '</a>';
             break;
     }
     if ($this->parent->_params->get('menu_images')) {
         $menu_params = new stdClass();
         $menu_params =& new mosParameters($mitem->params);
         $menu_image = $menu_params->def('menu_image', -1);
         if ($menu_image != '-1' && $menu_image) {
             $image = '<img src="' . $mosConfig_live_site . '/images/stories/' . $menu_image . '" border="0" alt="' . $mitem->name . '"/>';
             if ($this->parent->_params->get('menu_images_align')) {
                 $txt = $txt . ' ' . $image;
             } else {
                 $txt = $image . ' ' . $txt;
             }
         }
     }
     return $txt;
 }
开发者ID:dalinhuang,项目名称:joomla-goods-china,代码行数:74,代码来源:transmenu.php

示例7: deleteButton

 /**
  * This is used by lists to show a "Delete this item" button in each row
  *
  * @param string $id_fieldname The name of the identifying field [example: product_id]
  * @param mixed $id The unique ID identifying the item that is to be deleted
  * @param string $func The name of the function that is used to delete the item [e.g. productDelete]
  * @param string $keyword The recent keyword [deprecated]
  * @param int $limitstart The recent limitstart value [deprecated]
  * @param string $extra Additional URL parameters to be appended to the link
  * @return A link with the delete button in it
  */
 function deleteButton($id_fieldname, $id, $func, $keyword = "", $limitstart = 0, $extra = "")
 {
     global $page, $sess, $VM_LANG;
     $no_menu = vmRequest::getInt('no_menu');
     $href = $sess->url($_SERVER['PHP_SELF'] . "?page={$page}&func={$func}&{$id_fieldname}={$id}&keyword=" . urlencode($keyword) . "&limitstart={$limitstart}&no_menu={$no_menu}" . $extra);
     $code = "<a class=\"toolbar\" href=\"{$href}\" onclick=\"return confirm('" . $VM_LANG->_('PHPSHOP_DELETE_MSG') . "');\" onmouseout=\"MM_swapImgRestore();\"  onmouseover=\"MM_swapImage('delete{$id}','','" . IMAGEURL . "ps_image/delete_f2.gif',1);\">";
     $code .= "<img src=\"" . IMAGEURL . "ps_image/delete.gif\" alt=\"Delete this record\" name=\"delete{$id}\" align=\"middle\" border=\"0\" />";
     $code .= "</a>";
     return $code;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:21,代码来源:ps_html.php

示例8: update

 /**
  * Updates a Vendor (and the Store) Record
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $vendor_currency, $VM_LANG;
     $db = new ps_DB();
     $timestamp = time();
     if (!$this->validate_update($d)) {
         return False;
     }
     if (!vmImageTools::process_images($d)) {
         return false;
     }
     foreach ($d as $key => $value) {
         if (!is_array($value)) {
             $d[$key] = addslashes($value);
         }
     }
     $d['display_style'][1] = ps_vendor::checkCurrencySymbol($d['display_style'][1]);
     $d['display_style'] = implode("|", $d['display_style']);
     if (empty($d['vendor_accepted_currencies'])) {
         $d['vendor_accepted_currencies'] = array($vendor_currency);
     }
     $fields = array('vendor_name' => $d["vendor_name"], 'contact_last_name' => $d["contact_last_name"], 'contact_first_name' => $d["contact_first_name"], 'contact_middle_name' => $d["contact_middle_name"], 'contact_title' => $d["contact_title"], 'contact_phone_1' => $d["contact_phone_1"], 'contact_phone_2' => $d["contact_phone_2"], 'contact_fax' => $d["contact_fax"], 'contact_email' => $d["contact_email"], 'vendor_phone' => $d["vendor_phone"], 'vendor_address_1' => $d["vendor_address_1"], 'vendor_address_2' => $d["vendor_address_2"], 'vendor_city' => $d["vendor_city"], 'vendor_state' => $d["vendor_state"], 'vendor_country' => $d["vendor_country"], 'vendor_zip' => $d["vendor_zip"], 'vendor_store_name' => $d["vendor_store_name"], 'vendor_store_desc' => $d["vendor_store_desc"], 'vendor_category_id' => vmRequest::getInt('vendor_category_id'), 'vendor_image_path' => vmGet($d, 'vendor_image_path'), 'vendor_thumb_image' => vmGet($d, 'vendor_thumb_image'), 'vendor_full_image' => vmGet($d, 'vendor_full_image'), 'vendor_currency' => $d["vendor_currency"], 'vendor_url' => $d["vendor_url"], 'mdate' => $timestamp, 'vendor_terms_of_service' => $d["vendor_terms_of_service"], 'vendor_min_pov' => $d["vendor_min_pov"], 'vendor_currency_display_style' => $d["display_style"], 'vendor_freeshipping' => $d['vendor_freeshipping'], 'vendor_accepted_currencies' => implode(',', $d['vendor_accepted_currencies']), 'vendor_address_format' => $d['vendor_address_format'], 'vendor_date_format' => $d['vendor_date_format']);
     if (!empty($d["vendor_category_id"])) {
         $fields['vendor_category_id'] = $d["vendor_category_id"];
     }
     if (!empty($d["vendor_image_path"])) {
         $fields['vendor_image_path'] = $d["vendor_image_path"];
     }
     $db->buildQuery('UPDATE', '#__{vm}_vendor', $fields, 'WHERE vendor_id = ' . $d["vendor_id"]);
     $db->query();
     if ($d['vendor_id'] == 1) {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_STORE_UPDATED'));
     } else {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_VENDOR_UPDATED'));
     }
     return True;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:43,代码来源:ps_vendor.php

示例9: mm_showMyFileName

* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*
* This file is included by the virtuemart module and product categories module if the module parameter
* MenuType is set to tigratree
**/
mm_showMyFileName(__FILE__);
global $sess, $mosConfig_live_site;
// Decide which node to open (if any)
$Treeid = vmRequest::getInt('Treeid');
// Get the root label
$root_label = $params->get('root_label', $VM_LANG->_('PHPSHOP_STORE_MOD'));
// Get the ps_product_category class
require_once CLASSPATH . 'ps_product_category.php';
if (!isset($ps_product_category)) {
    $ps_product_category = new ps_product_category();
}
// The tree generator
$vmTigraTree = new vmTigraTreeMenu();
// A unique name for our tree (to support multiple instances of the menu)
$varname = uniqid("TigraTree_");
// Get necessary scripts
if (vmIsJoomla('1.5')) {
    $js_src = $mosConfig_live_site . '/modules/mod_virtuemart';
} else {
开发者ID:rafarubert,项目名称:megafiltros,代码行数:31,代码来源:vm_tigratree.php

示例10: update

 /**
  * Updates information about a core module
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $db, $VM_LANG;
     $timestamp = time();
     if (!$this->validate_update($d)) {
         $d['error'] = $this->error;
         return False;
     }
     if (is_array($d['module_perms'])) {
         $d['module_perms'] = implode(',', $d['module_perms']);
     }
     $fields = array('module_name' => vmGet($d, 'module_name'), 'module_perms' => vmGet($d, 'module_perms'), 'module_description' => vmGet($d, 'module_description'), 'module_publish' => vmGet($d, 'module_publish'), 'list_order' => vmRequest::getInt('list_order'));
     $db->buildQuery('UPDATE', '#__{vm}_module', $fields, ' WHERE module_id=' . intval($d['module_id']));
     if ($db->query() !== false) {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_MODULE_UPDATED'));
         return True;
     }
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:25,代码来源:ps_module.php

示例11: update

 /**
  * Updates a product price
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $vmLogger, $VM_LANG;
     if (!$this->validate($d)) {
         return false;
     }
     if ($d["product_price"] === '') {
         return $this->delete($d);
     }
     $timestamp = time();
     $db = new ps_DB();
     if (empty($d["product_price_vdate"])) {
         $d["product_price_vdate"] = '';
     }
     if (empty($d["product_price_edate"])) {
         $d["product_price_edate"] = '';
     }
     $fields = array('shopper_group_id' => vmRequest::getInt('shopper_group_id'), 'product_price' => vmRequest::getFloat('product_price'), 'product_currency' => vmGet($d, 'product_currency'), 'product_price_vdate' => vmGet($d, 'product_price_vdate'), 'product_price_edate' => vmGet($d, 'product_price_edate'), 'mdate' => $timestamp, 'price_quantity_start' => vmRequest::getInt('price_quantity_start'), 'price_quantity_end' => vmRequest::getInt('price_quantity_end'));
     $db = new ps_DB();
     $db->buildQuery('UPDATE', '#__{vm}_product_price', $fields, 'WHERE product_price_id=' . (int) $d["product_price_id"]);
     if ($db->query() !== false) {
         $vmLogger->info($VM_LANG->_('VM_PRODUCT_PRICE_UPDATED', false));
         return true;
     }
     $vmLogger->err($VM_LANG->_('VM_PRODUCT_PRICE_UPDATING_FAILED', false));
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:33,代码来源:ps_product_price.php

示例12: listUserFields


//.........这里部分代码省略.........
                    break;
                default:
                    switch ($field->type) {
                        case 'date':
                            echo vmCommonHTML::scriptTag($mosConfig_live_site . '/includes/js/calendar/calendar.js');
                            if (vmIsJoomla('1.5', '>=')) {
                                // in Joomla 1.5, the name of calendar lang file is changed...
                                echo vmCommonHTML::scriptTag($mosConfig_live_site . '/includes/js/calendar/lang/calendar-en-GB.js');
                            } else {
                                echo vmCommonHTML::scriptTag($mosConfig_live_site . '/includes/js/calendar/lang/calendar-en.js');
                            }
                            echo vmCommonHTML::linkTag($mosConfig_live_site . '/includes/js/calendar/calendar-mos.css');
                            $maxlength = $field->maxlength ? 'maxlength="' . $field->maxlength . '"' : '';
                            echo '<input type="text" id="' . $field->name . '_field" name="' . $field->name . '" size="' . $field->size . '" value="' . ($db->sf($field->name) ? $db->sf($field->name) : '') . '" class="inputbox" ' . $maxlength . $readonly . ' />' . "\n";
                            echo '<input name="reset" type="reset" class="button" onclick="return showCalendar(\'' . $field->name . '_field\', \'y-mm-dd\');" value="..." />';
                            break;
                        case 'text':
                        case 'emailaddress':
                        case 'webaddress':
                        case 'euvatid':
                            $maxlength = $field->maxlength ? 'maxlength="' . $field->maxlength . '"' : '';
                            echo '<input type="text" id="' . $field->name . '_field" name="' . $field->name . '" size="' . $field->size . '" value="' . ($db->sf($field->name) ? $db->sf($field->name) : '') . '" class="inputbox" ' . $maxlength . $readonly . ' />' . "\n";
                            break;
                        case 'textarea':
                            echo '<textarea name="' . $field->name . '" id="' . $field->name . '_field" cols="' . $field->cols . '" rows="' . $field->rows . '" ' . $readonly . '>' . $db->sf($field->name) . '</textarea>';
                            break;
                        case 'editorta':
                            editorArea($field->name, $db->sf($field->name), $field->name, '300', '150', $field->cols, $field->rows);
                            break;
                        case 'checkbox':
                            echo '<input type="checkbox" name="' . $field->name . '" id="' . $field->name . '_field" value="1" ' . ($db->sf($field->name) ? 'checked="checked"' : '') . '/>';
                            break;
                        case 'age_verification':
                            $year = vmRequest::getInt('birthday_selector_year', date('Y'));
                            if ($db->f($field->name)) {
                                $birthday = $db->f($field->name);
                                $date_array = explode('-', $birthday);
                                $year = $date_array[0];
                                $month = $date_array[1];
                                $day = $date_array[2];
                            }
                            ps_html::list_days('birthday_selector_day', vmRequest::getInt('birthday_selector_day', @$day));
                            ps_html::list_month('birthday_selector_month', vmRequest::getInt('birthday_selector_month', @$month));
                            ps_html::list_year('birthday_selector_year', $year, $year - 100, $year);
                            break;
                        case 'captcha':
                            if (file_exists($mosConfig_absolute_path . '/administrator/components/com_securityimages/client.php')) {
                                include $mosConfig_absolute_path . '/administrator/components/com_securityimages/client.php';
                                // Note that this package name must be used on the validation side too! If both are not equal, validation will fail
                                $packageName = 'securityVMRegistrationCheck';
                                echo insertSecurityImage($packageName);
                                echo getSecurityImageText($packageName);
                            } else {
                                if (file_exists($mosConfig_absolute_path . '/plugins/system/securityimages.php')) {
                                    echo "<script type=\"text/javascript\" src=\"" . JURI::root() . "/components/com_securityimages/js/securityImages.js\"></script>";
                                    echo "<img id='captchaSecurityImages' name='captchaSecurityImages' src=\"" . JURI::root() . "/index.php?option=com_securityimages&task=displayCaptcha\" />";
                                    echo "<a href=\"javascript:askNewSecurityImages('captchaSecurityImages');\">";
                                    echo "<img src=\"" . JURI::root() . "/components/com_securityimages/buttons/reload.gif\" id=\"securityImagesContactCaptchaReload\" name=\"securityImagesContactCaptchaReload\" border=\"0\">";
                                    echo "</a>";
                                    echo "<input type=\"text\" name=\"securityVMRegistrationCheck_try\" />";
                                }
                            }
                            break;
                            // Begin of a fallthrough
                        // Begin of a fallthrough
                        case 'multicheckbox':
开发者ID:albertobraschi,项目名称:Hab,代码行数:67,代码来源:ps_userfield.php

示例13: update_parameter

 /**
  * updates Parameter information
  * @author Zdenek Dvorak
  * @param array $d
  * @return boolean
  */
 function update_parameter(&$d)
 {
     $db = new ps_DB();
     if ($this->validate_update_parameter($d)) {
         if ($d["parameter_old_type"] == "B") {
             // delete record and call add_parameter()
             $q = "DELETE FROM #__{vm}_product_type_parameter WHERE product_type_id='" . $d["product_type_id"] . "' ";
             $q .= "AND parameter_name='" . $db->getEscaped(vmGet($d, 'parameter_name')) . "'";
             $db->setQuery($q);
             $db->query();
             return $this->add_parameter($d);
         }
         // added for custom parameter modification
         // strips the trailing semi-colon from an values
         if (';' == substr($d["parameter_values"], strlen($d["parameter_values"]) - 1, 1)) {
             $d["parameter_values"] = substr($d["parameter_values"], 0, strlen($d["parameter_values"]) - 1);
         }
         if (empty($d["parameter_multiselect"])) {
             $d["parameter_multiselect"] = "N";
         }
         // delete "\n" from field parameter_description
         $d["parameter_description"] = str_replace("\r\n", "", $d["parameter_description"]);
         $d["parameter_description"] = str_replace("\n", "", $d["parameter_description"]);
         $fields = array('parameter_name' => vmGet($d, 'parameter_name'), 'parameter_label' => vmGet($d, 'parameter_label'), 'parameter_description' => vmGet($d, 'parameter_description'), 'parameter_list_order' => vmRequest::getInt('list_order'), 'parameter_type' => vmGet($d, 'parameter_type'), 'parameter_values' => vmGet($d, 'parameter_values'), 'parameter_multiselect' => vmGet($d, 'parameter_multiselect'), 'parameter_default' => vmGet($d, 'parameter_default'), 'parameter_unit' => vmGet($d, 'parameter_unit'));
         $db->buildQuery('UPDATE', '#__{vm}_product_type_parameter', $fields, "WHERE `product_type_id`='" . $d["product_type_id"] . "' AND `parameter_name`='" . $db->getEscaped(vmGet($d, 'parameter_old_name')) . "'");
         $db->query();
         /* Re-Order the Parameter table IF the list_order has been changed */
         if (intval($d['list_order']) != intval($d['currentpos'])) {
             $dbu = new ps_DB();
             /* Moved UP in the list order */
             if (intval($d['list_order']) < intval($d['currentpos'])) {
                 $q = "SELECT product_type_id,parameter_name FROM #__{vm}_product_type_parameter WHERE ";
                 $q .= "product_type_id=' " . $d["product_type_id"];
                 $q .= "' AND parameter_name <> '" . $db->getEscaped(vmGet($d, 'parameter_name'));
                 $q .= "' AND parameter_list_order >= '" . intval($d["list_order"]) . "'";
                 $db->query($q);
                 while ($db->next_record()) {
                     $dbu->query("UPDATE #__{vm}_product_type_parameter SET parameter_list_order=parameter_list_order+1 WHERE product_type_id='" . $db->f("product_type_id") . "' AND parameter_name='" . $db->f("parameter_name") . "'");
                 }
             } else {
                 $q = "SELECT product_type_id,parameter_name FROM #__{vm}_product_type_parameter WHERE ";
                 $q .= "product_type_id='" . $d["product_type_id"];
                 $q .= "' AND parameter_name <> '" . $db->getEscaped(vmGet($d, 'parameter_name'));
                 $q .= "' AND parameter_list_order > '" . intval($d["currentpos"]);
                 $q .= "' AND parameter_list_order <= '" . intval($d["list_order"]) . "'";
                 $db->query($q);
                 while ($db->next_record()) {
                     $dbu->query("UPDATE #__{vm}_product_type_parameter SET parameter_list_order=parameter_list_order-1 WHERE product_type_id='" . $db->f("product_type_id") . "' AND parameter_name='" . $db->f("parameter_name") . "'");
                 }
             }
         }
         /* END Re-Ordering */
         if ($d["parameter_type"] != "B") {
             // != Break Line
             // Delete old index
             $q = "ALTER TABLE `#__{vm}_product_type_";
             $q .= $d["product_type_id"] . "` DROP INDEX `idx_product_type_" . $d["product_type_id"] . "_";
             $q .= $db->getEscaped(vmGet($d, 'parameter_old_name')) . "`;";
             $db->setQuery($q);
             $db->query();
             // Update column in table product_type_<id>
             $q = "ALTER TABLE `#__{vm}_product_type_";
             $q .= $d["product_type_id"] . "` CHANGE `";
             $q .= $db->getEscaped(vmGet($d, 'parameter_old_name')) . "` `";
             $q .= $db->getEscaped(vmGet($d, 'parameter_name')) . "` ";
             switch ($d["parameter_type"]) {
                 case "I":
                     $q .= "int(11) ";
                     break;
                     // Integer
                 // Integer
                 case "T":
                     $q .= "text ";
                     break;
                     // Text
                 // Text
                 case "S":
                     $q .= "varchar(255) ";
                     break;
                     // Short Text
                 // Short Text
                 case "F":
                     $q .= "float ";
                     break;
                     // Float
                 // Float
                 case "C":
                     $q .= "char(1) ";
                     break;
                     // Char
                 // Char
                 case "D":
                     $q .= "datetime ";
                     break;
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:owaspbwa,代码行数:101,代码来源:ps_product_type_parameter.php

示例14: update

 /**
  * updates the affiliate details
  * @author SP Bridgewater
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     $db = new ps_DB();
     $fields = array('rate' => $d['rate'], 'active' => $d["active"] == 'on' ? 'Y' : 'N');
     $db->buildQuery('UPDATE', '#__{vm}_affiliate', $fields, 'WHERE affiliate_id =\'' . vmRequest::getInt('affiliate_id') . '\'');
     return $db->query();
 }
开发者ID:rafarubert,项目名称:megafiltros,代码行数:13,代码来源:ps_affiliate.php

示例15: FORMS_MENU_SAVE_CANCEL

    /**
     * The function to handle all default page situations
     * not responsible for lists!
     */
    function FORMS_MENU_SAVE_CANCEL()
    {
        global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_lang, $VM_LANG, $product_id, $page, $limitstart, $mosConfig_editor, $vmIcons;
        $bar =& JToolBar::getInstance('toolbar');
        $product_id = vmGet($_REQUEST, 'product_id', 0);
        $no_menu = vmGet($_REQUEST, 'no_menu', 0);
        $is_iframe = vmGet($_REQUEST, 'is_iframe', 0);
        $product_parent_id = vmGet($_REQUEST, 'product_parent_id', 0);
        $script = '';
        $clone_product = vmRequest::getInt('clone_product', 0);
        if (is_array($product_id)) {
            $product_id = "";
        }
        // These editor arrays tell the toolbar to load correct "getEditorContents" script parts
        // This is necessary for WYSIWYG Editors like TinyMCE / mosCE / FCKEditor
        $editor1_array = array('product.product_form' => 'product_desc', 'shopper.shopper_group_form' => 'shopper_group_desc', 'product.product_category_form' => 'category_description', 'manufacturer.manufacturer_form' => 'mf_desc', 'store.store_form' => 'vendor_store_desc', 'product.product_type_parameter_form' => 'parameter_description', 'product.product_type_form' => 'product_type_description', 'vendor.vendor_form' => 'vendor_store_desc');
        $editor2_array = array('store.store_form' => 'vendor_terms_of_service', 'vendor.vendor_form' => 'vendor_terms_of_service');
        $editor1 = isset($editor1_array[$page]) ? $editor1_array[$page] : '';
        $editor2 = isset($editor2_array[$page]) ? $editor2_array[$page] : '';
        if ($no_menu) {
            vmCommonHTML::loadExtjs();
        }
        $script .= '<script type="text/javascript">
        	function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == \'cancel\') {
				submitform( pressbutton );
				return;
			}
			';
        if ($editor1 != '') {
            if (vmIsJoomla(1.5)) {
                jimport('joomla.html.editor');
                $editor_type = $GLOBALS['mainframe']->getCfg('editor');
                if ($editor_type != 'none') {
                    $editor = JEditor::getInstance();
                    $script .= $editor->getContent($editor1);
                }
            } else {
                ob_start();
                getEditorContents('editor1', $editor1);
                $script .= ob_get_contents();
                ob_end_clean();
            }
        }
        if ($editor2 != '') {
            if (vmIsJoomla(1.5)) {
                jimport('joomla.html.editor');
                $editor_type = $GLOBALS['mainframe']->getCfg('editor');
                if ($editor_type != 'none') {
                    $editor = JEditor::getInstance();
                    $script .= $editor->getContent($editor2);
                }
            } else {
                ob_start();
                getEditorContents('editor2', $editor2);
                $script .= ob_get_contents();
                ob_end_clean();
            }
        }
        if ($no_menu) {
            $admin = defined('_VM_IS_BACKEND') ? '/administrator' : '';
            $script .= "\n\t\t\t\n    // define some private variables\n    var dialog, showBtn;\n\n   // the second argument is true to indicate file upload.\n   YAHOO.util.Connect.setForm(form, true);\n   \n    var showDialog = function( content ) {\n    \tExt.MessageBox.show( { \n            \t\ttitle: '" . $VM_LANG->_('PEAR_LOG_NOTICE') . "',\n            \t\tmsg: content,\n            \t\tautoCreate: true,\n                    width:400,\n                    height:180,\n                    modal: false,\n                    resizable: false,\n                    buttons: Ext.MessageBox.OK,\n                    shadow:true,\n                    animEl:Ext.get( 'vm-toolbar' )\n            });\n        setTimeout('Ext.MessageBox.hide()', 3000);\n    };\n    \n    // return a public interface\n    var callback = {\n    \tsuccess: function(o) {\n    \t\t//Ext.DomHelper.insertHtml( document.body, o.responseText );\n    \t\tshowDialog( o.responseText );\n    \t},\n    \tfailure: function(o) {\n    \t\tExt.DomHelper.append( document.body, { tag: 'div', id: 'vmLogResult', html: 'Save action failed: ' + o.statusText } );\n    \t\tshowDialog( o.responseText );\n    \t},\n        upload : function(o){\n            //Ext.DomHelper.insertHtml( 'beforeEnd', document.body, o.responseText );\n    \t\tshowDialog( o.responseText );\n        }\n    };\n    \n   \tvar cObj = YAHOO.util.Connect.asyncRequest('POST', '{$_SERVER['PHP_SELF']}', callback);\n\t\n\t\t\t\n";
        } else {
            $script .= "\n\t\t\tsubmitform( pressbutton );\n";
        }
        $script .= "\t\t}\n\t\t</script>";
        $bar->appendButton('Custom', $script);
        vmMenuBar::startTable();
        if ($page == "product.product_form" && !empty($product_id) && $clone_product != 1) {
            if (empty($product_parent_id)) {
                // add new attribute
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_attribute_form&product_id=" . $product_id . "&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_ATTRIBUTE_FORM_MNU');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
            } else {
                // back to parent product
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_RETURN_LBL');
                vmMenuBar::customHref($href, $vmIcons['back_icon'], $vmIcons['back_icon2'], $alt);
                vmMenuBar::spacer();
                // new child product
                $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_form&product_parent_id={$product_parent_id}&limitstart=" . $limitstart . "&no_menu={$no_menu}";
                $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ADD_ANOTHER_ITEM_MNU');
                vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
                vmMenuBar::spacer();
            }
            // Go to Price list
            $href = $_SERVER['PHP_SELF'] . "?page=product.product_price_list&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&return_args=&option=com_virtuemart&no_menu={$no_menu}";
            $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRICE_LIST_MNU');
            vmMenuBar::customHref($href, $vmIcons['new_icon'], $vmIcons['new_icon2'], $alt);
            vmMenuBar::spacer();
            // add product type
            $href = $_SERVER['PHP_SELF'] . "?option=com_virtuemart&page=product.product_product_type_form&product_id={$product_id}&product_parent_id={$product_parent_id}&limitstart={$limitstart}&no_menu={$no_menu}";
            $alt = "&nbsp;" . $VM_LANG->_('PHPSHOP_PRODUCT_PRODUCT_TYPE_FORM_MNU');
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:owaspbwa,代码行数:101,代码来源:toolbar.virtuemart.html.php


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