• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vmRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: plgVmAddToSearch

 public function plgVmAddToSearch(&$where, &$PluginJoinTables, $custom_id)
 {
     if ($keyword = vmRequest::uword('custom_specification_name1', null, ' ')) {
         $db = JFactory::getDBO();
         if ($this->_name != $this->GetNameByCustomId($custom_id)) {
             return;
         }
         $keyword = '"%' . $db->getEscaped($keyword, true) . '%"';
         $where[] = $this->_name . '.`custom_specification_default1` LIKE ' . $keyword;
         $PluginJoinTables[] = $this->_name;
     }
     return true;
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:13,代码来源:specification.php


示例2: 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


示例3: clean

 /**
  * Cleans the request from script injection.
  *
  * @static
  * @return	void
  * @since	1.1
  */
 function clean()
 {
     vmRequest::_cleanArray($_FILES);
     vmRequest::_cleanArray($_ENV);
     vmRequest::_cleanArray($_GET);
     vmRequest::_cleanArray($_POST);
     vmRequest::_cleanArray($_COOKIE);
     vmRequest::_cleanArray($_SERVER);
     if (isset($_SESSION)) {
         vmRequest::_cleanArray($_SESSION);
     }
     $REQUEST = $_REQUEST;
     $GET = $_GET;
     $POST = $_POST;
     $COOKIE = $_COOKIE;
     $FILES = $_FILES;
     $ENV = $_ENV;
     $SERVER = $_SERVER;
     if (isset($_SESSION)) {
         $SESSION = $_SESSION;
     }
     foreach ($GLOBALS as $key => $value) {
         if ($key != 'GLOBALS') {
             unset($GLOBALS[$key]);
         }
     }
     $_REQUEST = $REQUEST;
     $_GET = $GET;
     $_POST = $POST;
     $_COOKIE = $COOKIE;
     $_FILES = $FILES;
     $_ENV = $ENV;
     $_SERVER = $SERVER;
     if (isset($SESSION)) {
         $_SESSION = $SESSION;
     }
     // Make sure the request hash is clean on file inclusion
     $GLOBALS['_VMREQUEST'] = array();
 }
开发者ID:albertobraschi,项目名称:Hab,代码行数:46,代码来源:request.class.php


示例4: mm_showMyFileName

* 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__);
global $ps_shopper_group, $ps_product;
global $acl, $database;
include_class('shopper');
include_class('product');
if (!isset($ps_shopper_group)) {
    $ps_shopper_group = new ps_shopper_group();
}
$user_id = intval(vmGet($_REQUEST, 'user_id'));
$cid = vmRequest::getVar('cid', array(0), '', 'array');
if (!empty($user_id)) {
    $q = "SELECT * FROM #__users AS u LEFT JOIN #__{vm}_user_info AS ui ON id=user_id ";
    $q .= "WHERE id={$user_id} ";
    $q .= "AND (address_type='BT' OR address_type IS NULL ) ";
    $q .= "AND gid <= " . $my->gid;
    $db->query($q);
    $db->next_record();
}
// Set up the CMS General User Information
$row = new mosUser($database);
$row->load((int) $user_id);
if ($user_id) {
    $query = "SELECT *" . "\n FROM #__contact_details" . "\n WHERE user_id = " . (int) $row->id;
    $database->setQuery($query);
    $contact = $database->loadObjectList();
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:admin.user_form.php


示例5: updateRecords

    /**
     * This is the main function which stores the order information in the database
     * 
     * @author Ashish Solanki!
     * @return boolean
     */
    function updateRecords($order_number, $order_total, &$d)
    {
        require_once CLASSPATH . 'ps_checkout.php';
        $ps_chkout = new ps_checkout();
        global $order_tax_details, $afid, $VM_LANG, $auth, $my, $mosConfig_offset, $vmLogger, $vmInputFilter, $discount_factor;
        $ps_vendor_id = $_SESSION["ps_vendor_id"];
        $cart = $_SESSION['cart'];
        require_once CLASSPATH . 'ps_payment_method.php';
        $ps_payment_method = new ps_payment_method();
        require_once CLASSPATH . 'ps_product.php';
        $ps_product = new ps_product();
        require_once CLASSPATH . 'ps_cart.php';
        $ps_cart = new ps_cart();
        $db = new ps_DB();
        $totals = $ps_chkout->calc_order_totals($d);
        extract($totals);
        $timestamp = time();
        //Custom
        $vmLogger->debug('-- Checkout Debug--
							Subtotal: ' . $order_subtotal . '
							Taxable: ' . $order_taxable . '
							Payment Discount: ' . $payment_discount . '
							Coupon Discount: ' . $coupon_discount . '
							Shipping: ' . $order_shipping . '
							Shipping Tax : ' . $order_shipping_tax . '
							Tax : ' . $order_tax . '
							------------------------
							Order Total: ' . $order_total . '
							----------------------------');
        // Check to see if Payment Class File exists
        $payment_class = $ps_payment_method->get_field($d["payment_method_id"], "payment_class");
        $d['new_order_status'] = 'P';
        // This is meant to be updated by a payment modules' process_payment method
        if (!class_exists($payment_class)) {
            include CLASSPATH . "payment/{$payment_class}.php";
        }
        $_PAYMENT = new $payment_class();
        // Remove the Coupon, because it is a Gift Coupon and now is used!!
        if (@$_SESSION['coupon_type'] == "gift") {
            $d['coupon_id'] = $_SESSION['coupon_id'];
            include_once CLASSPATH . 'ps_coupon.php';
            ps_coupon::remove_coupon_code($d);
        }
        // Get the IP Address
        if (!empty($_SERVER['REMOTE_ADDR'])) {
            $ip = $_SERVER['REMOTE_ADDR'];
        } else {
            $ip = 'unknown';
        }
        // Collect all fields and values to store them!
        $fields = array('user_id' => $auth["user_id"], 'vendor_id' => $ps_vendor_id, 'order_number' => $order_number, 'user_info_id' => $d["ship_to_info_id"], 'ship_method_id' => @urldecode($d["shipping_rate_id"]), 'order_total' => $order_total, 'order_subtotal' => $order_subtotal, 'order_tax' => $order_tax, 'order_tax_details' => serialize($order_tax_details), 'order_shipping' => $order_shipping, 'order_shipping_tax' => $order_shipping_tax, 'order_discount' => $payment_discount, 'coupon_discount' => $coupon_discount, 'coupon_code' => @$_SESSION['coupon_code'], 'order_currency' => $GLOBALS['product_currency'], 'order_status' => 'P', 'cdate' => $timestamp, 'mdate' => $timestamp, 'customer_note' => htmlspecialchars(vmRequest::getString('customer_note', '', 'POST', 'none'), ENT_QUOTES), 'ip_address' => $ip);
        // Insert the main order information
        $db->buildQuery('INSERT', '#__{vm}_orders', $fields);
        $result = $db->query();
        $d["order_id"] = $order_id = $db->last_insert_id();
        if ($result === false || empty($order_id)) {
            $vmLogger->crit('Adding the Order into the Database failed! User ID: ' . $auth["user_id"]);
            return false;
        }
        // Insert the initial Order History.
        $mysqlDatetime = date("Y-m-d G:i:s", $timestamp);
        $fields = array('order_id' => $order_id, 'order_status_code' => 'P', 'date_added' => $mysqlDatetime, 'customer_notified' => 1, 'comments' => '');
        $db->buildQuery('INSERT', '#__{vm}_order_history', $fields);
        $db->query();
        /**
         * Insert the Order payment info 
         */
        $payment_number = str_replace(array(' ', '|', '-'), '', @$_SESSION['ccdata']['order_payment_number']);
        $d["order_payment_code"] = @$_SESSION['ccdata']['credit_card_code'];
        // Payment number is encrypted using mySQL encryption functions.
        $fields = array('order_id' => $order_id, 'payment_method_id' => $d["payment_method_id"], 'order_payment_log' => @$d["order_payment_log"], 'order_payment_trans_id' => $vmInputFilter->safeSQL(@$d["order_payment_trans_id"]));
        if (!empty($payment_number) && VM_STORE_CREDITCARD_DATA == '1') {
            // Store Credit Card Information only if the Store Owner has decided to do so
            $fields['order_payment_code'] = $d["order_payment_code"];
            $fields['order_payment_expire'] = @$_SESSION["ccdata"]["order_payment_expire"];
            $fields['order_payment_name'] = @$_SESSION["ccdata"]["order_payment_name"];
            $fields['order_payment_number'] = VM_ENCRYPT_FUNCTION . "( '{$payment_number}','" . ENCODE_KEY . "')";
            $specialfield = array('order_payment_number');
        } else {
            $specialfield = array();
        }
        $db->buildQuery('INSERT', '#__{vm}_order_payment', $fields, '', $specialfield);
        $db->query();
        /**
         * Insert the User Billto & Shipto Info
         */
        // First: get all the fields from the user field list to copy them from user_info into the order_user_info
        $fields = array();
        require_once CLASSPATH . 'ps_userfield.php';
        $userfields = ps_userfield::getUserFields('', false, '', true, true);
        foreach ($userfields as $field) {
            if ($field->name == 'email') {
                $fields[] = 'user_email';
            } else {
//.........这里部分代码省略.........
开发者ID:atomtechnologyltd,项目名称:VM9_paynetz_for_Joomla1.5_updated,代码行数:101,代码来源:ps_nbpaynetz.php


示例6: update

 /**
  * Updates an Order Status
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $VM_LANG;
     $db = new ps_DB();
     $ps_vendor_id = $_SESSION["ps_vendor_id"];
     if (!$this->validate_update($d)) {
         return False;
     }
     $fields = array('order_status_code' => vmGet($d, 'order_status_code'), 'order_status_name' => vmGet($d, 'order_status_name'), 'order_status_description' => vmGet($d, 'order_status_description'), 'list_order' => vmRequest::getInt('list_order'));
     $db->buildQuery('UPDATE', $this->_table_name, $fields, "WHERE order_status_id=" . (int) $d["order_status_id"] . " AND vendor_id={$ps_vendor_id}");
     if ($db->query() !== false) {
         $GLOBALS['vmLogger']->info($VM_LANG->_('VM_ORDERSTATUS_UPDATED'));
         return true;
     }
     return false;
 }
开发者ID:rafarubert,项目名称:megafiltros,代码行数:22,代码来源:ps_order_status.php


示例7: add

 /**
  * Adds a new Shopper Group
  *
  * @param array $d
  * @return boolean
  */
 function add(&$d)
 {
     global $perm, $vmLogger, $VM_LANG;
     $hash_secret = "virtuemart";
     if ($perm->check("admin")) {
         $vendor_id = $d["vendor_id"];
     } else {
         $vendor_id = $_SESSION["ps_vendor_id"];
     }
     $db = new ps_DB();
     $timestamp = time();
     $default = @$d["default"] == "1" ? "1" : "0";
     if (!$this->validate_add($d)) {
         return False;
     }
     $user_id = md5(uniqid($hash_secret));
     $fields = array('vendor_id' => $vendor_id, 'shopper_group_name' => $d["shopper_group_name"], 'shopper_group_desc' => $d["shopper_group_desc"], 'shopper_group_discount' => $d["shopper_group_discount"], 'show_price_including_tax' => $d["show_price_including_tax"], 'default' => $default);
     $db->buildQuery('INSERT', '#__{vm}_shopper_group', $fields);
     if ($db->query() !== false) {
         $shopper_group_id = $db->last_insert_id();
         vmRequest::setVar('shopper_group_id', $shopper_group_id);
         $vmLogger->info($VM_LANG->_('SHOPPER_GROUP_ADDED'));
         // Set all other shopper groups to be non-default, if this new shopper group shall be "default"
         if ($default == "1") {
             $q = "UPDATE #__{vm}_shopper_group ";
             $q .= "SET `default`=0 ";
             $q .= "WHERE shopper_group_id !=" . $shopper_group_id;
             $q .= " AND vendor_id ={$vendor_id}";
             $db->query($q);
             $db->next_record();
         }
         return $_REQUEST['shopper_group_id'];
     }
     $vmLogger->err($VM_LANG->_('SHOPPER_GROUP_ADD_FAILED'));
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:42,代码来源:ps_shopper_group.php


示例8: utime

$only_page = vmRequest::getInt('only_page', 0);
if (PSHOP_IS_OFFLINE == '1' && !$perm->hasHigherPerms('storeadmin')) {
    echo PSHOP_OFFLINE_MESSAGE;
} else {
    if (PSHOP_IS_OFFLINE == '1') {
        echo '<h2>' . $VM_LANG->_('OFFLINE_MODE') . '</h2>';
    }
    if ($is_popup) {
        echo "<style type='text/css' media='print'>.vmNoPrint { display: none }</style>";
        echo vmCommonHTML::PrintIcon('', true, ' ' . $VM_LANG->_('CMN_PRINT'));
    }
    // The Vendor ID is important
    $ps_vendor_id = $_SESSION['ps_vendor_id'];
    // The authentication array
    $auth = $_SESSION['auth'];
    $no_menu = vmRequest::getInt('no_menu', 0);
    // Timer Start
    if (vmShouldDebug()) {
        /*@MWM1: Log/Debug enhancements */
        $start = utime();
        $GLOBALS["mosConfig_debug"] = 1;
    }
    // update the cart because something could have
    // changed while running a function
    $cart = $_SESSION["cart"];
    if ((!$pagePermissionsOK || !$funcParams) && $_REQUEST['page'] != 'checkout.index') {
        if (!$pagePermissionsOK && defined('_VM_PAGE_NOT_AUTH')) {
            $page = 'checkout.login_form';
            echo '<br/><br/>' . $VM_LANG->_('DO_LOGIN') . '<br/><br/>';
        } elseif (!$pagePermissionsOK && defined('_VM_PAGE_NOT_FOUND')) {
            $page = HOMEPAGE;
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:31,代码来源:virtuemart.php


示例9: mm_showMyFileName

* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName(__FILE__);
if (!isset($_REQUEST["shopper_id"]) || empty($_REQUEST["shopper_id"])) {
    echo $VM_LANG->_('VM_CHECKOUT_ORDERIDNOTSET');
} else {
    include CLASSPATH . "payment/ps_ipayment.cfg.php";
    $order_number = vmrequest::getVar('shopper_id');
    $q = 'SELECT order_id,order_total,order_status,order_currency FROM #__{vm}_orders WHERE ';
    $q .= '#__{vm}_orders.user_id= ' . $auth["user_id"] . "\n";
    $q .= 'AND #__{vm}_orders.order_number=\'' . $db->getEscaped($order_number) . "'";
    $db->query($q);
    if ($db->next_record()) {
        if (vmRequest::getVar('ret_status') == 'SUCCESS') {
            ?>
 
        <img src="<?php 
            echo VM_THEMEURL;
            ?>
images/button_ok.png" align="middle" alt="<?php 
            echo $VM_LANG->_('VM_CHECKOUT_SUCCESS');
            ?>
" border="0" />
        <h2><?php 
            echo $VM_LANG->_('PHPSHOP_PAYMENT_TRANSACTION_SUCCESS');
            ?>
</h2>
    
    <?php 
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:checkout.ipayment_result.php


示例10: ps_product

require_once CLASSPATH . 'ps_product.php';
require_once CLASSPATH . 'ps_order_status.php';
require_once CLASSPATH . 'ps_checkout.php';
require_once CLASSPATH . 'ps_order_change.php';
require_once CLASSPATH . 'ps_order_change_html.php';
$ps_product = new ps_product();
$order_id = vmRequest::getInt('order_id');
$ps_order_change_html = new ps_order_change_html($order_id);
//Added Option to resend the Confirmation Mail
$resend_action = vmRequest::getVar('func');
if ($resend_action == 'resendconfirm' && $order_id) {
    ps_checkout::email_receipt($order_id);
    $redirurl = $_SERVER['PHP_SELF'];
    foreach ($_POST as $key => $value) {
        if ($value != 'resendconfirm') {
            $redirurl .= !strpos($redirurl, '?') ? '?' : '&' . $key . '=' . vmRequest::getVar($key);
        }
    }
    vmRedirect($redirurl, $VM_LANG->_('PHPSHOP_ORDER_RESEND_CONFIRMATION_MAIL_SUCCESS'));
}
if (!is_numeric($order_id)) {
    echo "<h2>The Order ID {$order_id} is not valid.</h2>";
} else {
    $dbc = new ps_DB();
    $q = "SELECT * FROM #__{vm}_orders WHERE order_id='{$order_id}'";
    $db->query($q);
    if ($db->next_record()) {
        // Print View Icon
        $print_url = $_SERVER['PHP_SELF'] . "?page=order.order_printdetails&amp;order_id={$order_id}&amp;no_menu=1&pop=1";
        if (vmIsJoomla('1.5', '>=')) {
            $print_url .= "&amp;tmpl=component";
开发者ID:rafarubert,项目名称:megafiltros,代码行数:31,代码来源:order.order_print.php


示例11: linkTag

 /**
  * Returns a link tag
  *
  * @param string $href
  * @param string $type
  * @param string $rel
  * @return string
  */
 function linkTag($href, $type = 'text/css', $rel = 'stylesheet', $media = "screen, projection")
 {
     global $mosConfig_gzip, $mosConfig_live_site;
     if (isset($_REQUEST['usefetchscript'])) {
         $use_fetchscript = vmRequest::getBool('usefetchscript', 1);
         vmRequest::setVar('usefetchscript', $use_fetchscript, 'session');
     } else {
         $use_fetchscript = vmRequest::getBool('usefetchscript', 1, 'session');
     }
     if (stristr($href, 'com_virtuemart') && $use_fetchscript) {
         $base_href = str_replace(URL, '', $href);
         $base_href = str_replace(SECUREURL, '', $base_href);
         $base_href = str_replace('components/com_virtuemart/', '', $base_href);
         $href = $mosConfig_live_site . '/components/com_virtuemart/fetchscript.php?gzip=' . $mosConfig_gzip . '&amp;subdir[0]=' . dirname($base_href) . '&amp;file[0]=' . basename($href);
     }
     return '<link type="' . $type . '" href="' . $href . '" rel="' . $rel . '"' . (empty($media) ? '' : ' media="' . $media . '"') . ' />' . "\n";
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:25,代码来源:htmlTools.class.php


示例12: stripslashes

   <input type="hidden" name="Itemid" value="' . $sess->getShopItemid() . '" />
   <input type="hidden" name="description" value="' . stripslashes($cart[$i]["description"]) . '" />
   <input type="image" name="update" title="' . $VM_LANG->_('PHPSHOP_CART_UPDATE') . '" src="' . VM_THEMEURL . 'images/update_quantity_cart.png" alt="' . $VM_LANG->_('PHPSHOP_UPDATE') . '" align="middle" />
 </form>';
       $product_rows[$i]['delete_form'] = '<form action="' . $action_url . '" method="post" name="delete" style="display: inline;">
   <input type="hidden" name="option" value="com_virtuemart" />
   <input type="hidden" name="page" value="' . $page . '" />
   <input type="hidden" name="Itemid" value="' . $sess->getShopItemid() . '" />
   <input type="hidden" name="func" value="cartDelete" />
   <input type="hidden" name="product_id" value="' . $_SESSION['cart'][$i]["product_id"] . '" />
   <input type="hidden" name="description" value="' . $cart[$i]["description"] . '" />
 	<input type="image" name="delete" title="' . $VM_LANG->_('PHPSHOP_CART_DELETE') . '" src="' . VM_THEMEURL . 'images/remove_from_cart.png" alt="' . $VM_LANG->_('PHPSHOP_CART_DELETE') . '" align="middle" />
 </form>';
   }
   // End of for loop through the Cart
   vmRequest::setVar('zone_qty', $vars['zone_qty']);
   $total = $total_undiscounted = round($total, 5);
   $vars["total"] = $total;
   $subtotal_display = $GLOBALS['CURRENCY_DISPLAY']->getFullValue($grandSubtotal);
   if (!empty($_POST["do_coupon"]) || in_array(strtolower($func), array('cartadd', 'cartupdate', 'cartdelete')) && !empty($_SESSION['coupon_redeemed'])) {
       /* process the coupon */
       require_once CLASSPATH . "ps_coupon.php";
       $vars["total"] = $total;
       ps_coupon::process_coupon_code($vars);
   }
   /* HANDLE SHIPPING COSTS */
   if (!empty($shipping_rate_id) && !ps_checkout::noShippingMethodNecessary()) {
       $shipping = true;
       $vars["weight"] = $weight_total;
       $shipping_total = round($ps_checkout->_SHIPPING->get_rate($vars), 5);
       $shipping_taxrate = $ps_checkout->_SHIPPING->get_tax_rate();
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:basket.php


示例13: update

 /**
  * Updates a Payment Entry
  *
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     global $VM_LANG;
     global $vmLogger, $VM_LANG;
     $ps_vendor_id = $_SESSION["ps_vendor_id"];
     $db = new ps_DB();
     if (!$this->validate_update($d)) {
         return False;
     }
     if (!empty($d["payment_class"])) {
         $payment_class = basename($d["payment_class"]);
         @(include CLASSPATH . "payment/" . $payment_class . ".php");
         if (class_exists($payment_class)) {
             $_PAYMENT = new $payment_class();
         } else {
             $GLOBALS['vmLogger']->err($VM_LANG->_('VM_PAYMENTMETHOD_CLASS_NOT_EXIST'));
             return false;
         }
     } else {
         include CLASSPATH . "payment/ps_payment.php";
         $_PAYMENT = new ps_payment();
     }
     if ($_PAYMENT->configfile_writeable() || $_PAYMENT->classname == 'ps_payment') {
         $_PAYMENT->write_configuration($d);
         $vmLogger->info($VM_LANG->_('VM_CONFIGURATION_CHANGE_SUCCESS', false));
     } else {
         $vmLogger->err(sprintf($VM_LANG->_('VM_CONFIGURATION_CHANGE_FAILURE', false), CLASSPATH . "payment/" . $_PAYMENT->classname . ".cfg.php"));
         return false;
     }
     $fields = array('payment_method_name' => vmGet($d, 'payment_method_name'), 'payment_class' => vmGet($d, 'payment_class'), 'shopper_group_id' => vmRequest::getInt('shopper_group_id'), 'payment_method_discount' => vmRequest::getFloat('payment_method_discount'), 'payment_method_discount_is_percent' => vmGet($d, 'payment_method_discount_is_percent'), 'payment_method_discount_max_amount' => (double) str_replace(',', '.', $d["payment_method_discount_max_amount"]), 'payment_method_discount_min_amount' => (double) str_replace(',', '.', $d["payment_method_discount_min_amount"]), 'payment_method_code' => vmGet($d, 'payment_method_code'), 'enable_processor' => vmGet($d, 'enable_processor'), 'list_order' => vmRequest::getInt('list_order'), 'is_creditcard' => vmGet($d, 'is_creditcard'), 'payment_enabled' => vmGet($d, 'payment_enabled'), 'accepted_creditcards' => vmGet($d, 'accepted_creditcards'), 'payment_extrainfo' => vmGet($_POST, 'payment_extrainfo', null, VMREQUEST_ALLOWRAW));
     $db->buildQuery('UPDATE', '#__{vm}_payment_method', $fields, 'WHERE payment_method_id=' . (int) $d["payment_method_id"] . ' AND vendor_id=' . $ps_vendor_id);
     $db->query();
     return True;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:40,代码来源:ps_payment_method.php


示例14: display


//.........这里部分代码省略.........
     if (!empty($tpl)) {
         $format = $tpl;
     } else {
         $format = JRequest::getWord('format', 'html');
     }
     if ($format == 'html') {
         $document->addHeadLink(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $categoryId), 'canonical', 'rel', '');
     }
     // Set the titles
     if ($category->customtitle) {
         $title = strip_tags($category->customtitle);
     } elseif ($category->category_name) {
         $title = strip_tags($category->category_name);
     } else {
         $menus = $app->getMenu();
         $menu = $menus->getActive();
         if ($menu) {
             $title = $menu->title;
         }
         // $title = $this->params->get('page_title', '');
         // Check for empty title and add site name if param is set
         if (empty($title)) {
             $title = $app->getCfg('sitename');
         } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
             $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
         } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
             $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
         }
     }
     if (JRequest::getInt('error')) {
         $title .= ' ' . JText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
     }
     // set search and keyword
     if ($keyword = vmRequest::uword('keyword', '', ' ')) {
         $pathway->addItem($keyword);
         $title .= ' (' . $keyword . ')';
     }
     $search = JRequest::getvar('keyword', null);
     if ($search !== null) {
         $searchcustom = $this->getSearchCustom();
     }
     $this->assignRef('keyword', $keyword);
     $this->assignRef('search', $search);
     // Load the products in the given category
     $products = $productModel->getProductsInCategory($categoryId);
     $productModel->addImages($products, 1);
     $this->assignRef('products', $products);
     foreach ($products as $product) {
         $product->stock = $productModel->getStockIndicator($product);
     }
     $ratingModel = VmModel::getModel('ratings');
     $showRating = $ratingModel->showRating();
     $this->assignRef('showRating', $showRating);
     $virtuemart_manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id', 0);
     if ($virtuemart_manufacturer_id and !empty($products[0])) {
         $title .= ' ' . $products[0]->mf_name;
     }
     $document->setTitle($title);
     // Override Category name when viewing manufacturers products !IMPORTANT AFTER page title.
     if (JRequest::getInt('virtuemart_manufacturer_id') and !empty($products[0])) {
         $category->category_name = $products[0]->mf_name;
     }
     $pagination = $productModel->getPagination($perRow);
     $this->assignRef('vmPagination', $pagination);
     $orderByList = $productModel->getOrderByList($categoryId);
     $this->assignRef('orderByList', $orderByList);
开发者ID:Gskflute,项目名称:joomla25,代码行数:67,代码来源:view.html.php


示例15: update

 /**
  * updates Product Type information
  * @author Zdenek Dvorak
  * @param array $d
  * @return boolean
  */
 function update(&$d)
 {
     $db = new ps_DB();
     if ($this->validate_update($d)) {
         if (empty($d["product_type_publish"])) {
             $d["product_type_publish"] = "N";
         }
         $fields = array('product_type_name' => vmGet($d, 'product_type_name'), 'product_type_description' => vmGet($d, 'product_type_description'), 'product_type_publish' => vmGet($d, 'product_type_publish'), 'product_type_browsepage' => vmGet($d, 'product_type_browsepage'), 'product_type_flypage' => vmGet($d, 'product_type_flypage'), 'product_type_list_order' => vmRequest::getInt('list_order'));
         $db->buildQuery('UPDATE', '#__{vm}_product_type', $fields, 'WHERE product_type_id=' . (int) $d["product_type_id"]);
         $db->query();
         // Re-Order the Product Type 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 FROM #__{vm}_product_type WHERE ";
                 $q .= "product_type_id <> '" . $d["product_type_id"] . "' ";
                 $q .= "AND product_type_list_order >= '" . intval($d["list_order"]) . "'";
                 $db->query($q);
                 while ($db->next_record()) {
                     $dbu->query("UPDATE #__{vm}_product_type SET product_type_list_order=product_type_list_order+1 WHERE product_type_id='" . $db->f("product_type_id") . "'");
                 }
             } else {
                 $q = "SELECT product_type_id FROM #__{vm}_product_type WHERE ";
                 $q .= "product_type_id <> '" . $d["product_type_id"] . "' ";
                 $q .= "AND product_type_list_order > '" . intval($d["currentpos"]) . "'";
                 $q .= "AND product_type_list_order <= '" . intval($d["list_order"]) . "'";
                 $db->query($q);
                 while ($db->next_record()) {
                     $dbu->query("UPDATE #__{vm}_product_type SET product_type_list_order=product_type_list_order-1 WHERE product_type_id='" . $db->f("product_type_id") . "'");
                 }
             }
         }
         // END Re-Ordering
         return True;
     } else {
         return False;
     }
 }
开发者ID:albertobraschi,项目名称:Hab,代码行数:45,代码来源:ps_product_type.php


示例16: updateState

 /**
  * Updates a state entry
  *
  * @param array $d
  * @return boolean
  */
 function updateState(&$d)
 {
     $db = new ps_DB();
     if (empty($d['state_id']) || empty($d['country_id'])) {
         $GLOBALS['vmLogger']->err('Please select a state or country for update!');
         return False;
     }
     $fields = array('state_name' => vmGet($d, 'state_name'), 'country_id' => vmRequest::getInt('country_id'), 'state_2_code' => vmGet($d, 'state_2_code'), 'state_3_code' => vmGet($d, 'state_3_code'));
     $db->buildQuery('UPDATE', '#__{vm}_state', $fields, 'WHERE state_id=' . (int) $d["state_id"]);
     if ($db->query()) {
         $GLOBALS['vmLogger']->info('The state has been updated.');
         return True;
     }
     return false;
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:21,代码来源:ps_country.php


示例17: 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


示例18: updateRequests

 /**
  * This functions updates the variables of the model which are used in the sortSearchListQuery
  *  with the variables from the Request
  *
  * @author Max Milbers
  */
 function updateRequests()
 {
     //hmm how to trigger that in the module or so?
     $this->keyword = vmRequest::uword('keyword', "0", ' ');
     if ($this->keyword == "0") {
         $this->keyword = vmRequest::uword('filter_product', "0", ' ');
     }
     $app = JFactory::getApplication();
     $option = 'com_virtuemart';
     $view = 'product';
     //Filter order and dir  This is unecessary complex and maybe even wrong, but atm it seems to work
     if ($app->isSite()) {
         $filter_order = JRequest::getString('orderby', VmConfig::get('browse_orderby_field', 'p.virtuemart_product_id'));
         $filter_order = $this->checkFilterOrder($filter_order);
         $filter_order_Dir = strtoupper(JRequest::getWord('order', 'ASC'));
         $valid_search_fields = VmConfig::get('browse_search_fields');
     } else {
         $filter_order = strtolower($app->getUserStateFromRequest('com_virtuemart.' . $view . '.filter_order', 'filter_order', $this->_selectedOrdering, 'cmd'));
         $filter_order = $this->checkFilterOrder($filter_order);
         $filter_order_Dir = strtoupper($app->getUserStateFromRequest($option . '.' . $view . '.filter_order_Dir', 'filter_order_Dir', '', 'word'));
         $valid_search_fields = array('product_name');
     }
     $filter_order_Dir = $this->checkFilterDir($filter_order_Dir);
     $this->filter_order = $filter_order;
     $this->filter_order_Dir = $filter_order_Dir;
     $this->valid_search_fields = $valid_search_fields;
     $this->product_parent_id = JRequest::getInt('product_parent_id', false);
     $this->virtuemart_manufacturer_id = JRequest::getInt('virtuemart_manufacturer_id', false);
     $this->search_type = JRequest::getVar('search_type', '');
     $this->searchcustoms = JRequest::getVar('customfields', array(), 'default', 'array');
     $this->searchplugin = JRequest::getInt('custom_parent_id', 0);
 }
开发者ID:joselapria,项目名称:virtuemart,代码行数:38,代码来源:product.php


示例19: foreach

		<th><?php 
echo $this->sort('product_weight', 'COM_VIRTUEMART_PRODUCT_INVENTORY_WEIGHT');
?>
</th>
		<th><?php 
echo $this->sort('published');
?>
</th>
	</tr>
	</thead>
	<tbody>
	<?php 
if (count($this->inventorylist) > 0) {
    $i = 0;
    $k = 0;
    $keyword = vmRequest::uword('keyword', "", ' ,-,+,.,_,#,/');
    foreach ($this->inventorylist as $key => $product) {
        $checked = JHTML::_('grid.id', $i, $product->virtuemart_product_id);
        $published = JHTML::_('grid.published', $product, $i);
        //<!-- low_stock_notification  -->
        if ($product->product_in_stock - $product->product_ordered < 1) {
            $stockstatut = "out";
        } elseif ($product->product_in_stock - $product->product_ordered < $product->low_stock_notification) {
            $stockstatut = "low";
        } else {
            $stockstatut = "normal";
        }
        $stockstatut = 'class="stock-' . $stockstatut . '" title="' . jText::_('COM_VIRTUEMART_STOCK_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vmText类代码示例发布时间:2022-05-23
下一篇:
PHP vmPlugin类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap