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


PHP Toolbox::numericFilter方法代码示例

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


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

示例1: existAddress

    public static function existAddress($order_infos, $id_country, $id_customer)
    {
        $addr = Db::getInstance()->getRow('
			SELECT * FROM ' . _DB_PREFIX_ . 'address WHERE
			address1 = "' . pSQL($order_infos->Address1) . '" AND
			address2 = "' . pSQL($order_infos->Address2) . '" AND
			city = "' . pSQL($order_infos->CityName) . '" AND
			firstname = "' . pSQL($order_infos->FirstName) . '" AND
			lastname = "' . pSQL($order_infos->LastName) . '" AND
			postcode = "' . pSQL($order_infos->PostalCode) . '" AND
			phone = "' . pSQL(Toolbox::numericFilter($order_infos->Phone)) . '" AND
			phone_mobile = "' . pSQL(Toolbox::numericFilter($order_infos->Mobile)) . '" AND
			id_country = ' . intval($id_country) . ' AND
			id_customer = ' . intval($id_customer));
        if ($addr) {
            return $addr["id_address"];
        } else {
            return false;
        }
    }
开发者ID:juniorhq88,项目名称:PrestaShop-modules,代码行数:20,代码来源:Toolbox.php

示例2: addAddresseInBDD

    /**
     * Add addresses
     * @param $order_id
     * @param $order_infos
     * @param $type
     * @param $id_customer
     * @return mixed
     */
    private function addAddresseInBDD($order_id, $neteven_address, $type, $id_customer)
    {
        $id_country = $this->getValue('id_country_default');
        if (!($id_country = Country::getIdByName(2, $neteven_address->Country))) {
            Toolbox::addLogLine(self::getL('Problem with id_country on address') . ' ' . $type . ' ' . self::getL('NetEven Order Id') . ' ' . $order_id);
        }
        $country = Db::getInstance()->getRow('
				SELECT c.`id_country`
				FROM `' . _DB_PREFIX_ . 'country` c
				INNER JOIN `' . _DB_PREFIX_ . 'country_lang` cl ON (c.`id_country` = cl.`id_country`)
				WHERE LOWER(c.`iso_code`) = "' . pSQL(strtolower($neteven_address->Country)) . '"
				OR LOWER(cl.`name`) = "' . pSQL(strtolower($neteven_address->Country)) . '" 
				GROUP BY c.`id_country`
			');
        if (!empty($country['id_country'])) {
            $id_country = $country['id_country'];
        }
        if ($id_address = Toolbox::existAddress($neteven_address, $id_country, $id_customer)) {
            Toolbox::addLogLine(self::getL('Get existing address for NetEven Order Id') . ' ' . $order_id);
        } else {
            Toolbox::addLogLine(self::getL('Creation of address of NetEven order Id') . ' ' . $order_id);
            $date_now = date('Y-m-d H:i:s');
            $new_address = new Address();
            $new_address->alias = 'Address';
            $new_address->lastname = !empty($neteven_address->LastName) ? substr(Toolbox::stringFilter($neteven_address->LastName), 0, 32) : ' ';
            $new_address->firstname = !empty($neteven_address->FirstName) ? substr(Toolbox::stringFilter($neteven_address->FirstName), 0, 32) : ' ';
            $new_address->address1 = !empty($neteven_address->Address1) ? Toolbox::stringWithNumericFilter($neteven_address->Address1) : ' ';
            $new_address->address2 = Toolbox::stringWithNumericFilter($neteven_address->Address2);
            $new_address->postcode = Toolbox::numericFilter($neteven_address->PostalCode);
            $new_address->city = !empty($neteven_address->CityName) ? Toolbox::stringFilter($neteven_address->CityName) : ' ';
            $new_address->phone = substr(Toolbox::numericFilter($neteven_address->Phone), 0, 16);
            $new_address->phone_mobile = substr(Toolbox::numericFilter($neteven_address->Mobile), 0, 16);
            $new_address->id_country = $id_country;
            $new_address->id_customer = $id_customer;
            $new_address->date_add = $date_now;
            $new_address->date_upd = $date_now;
            if (!empty($neteven_address->Company)) {
                $new_address->company = $neteven_address->Company;
            }
            if (!$new_address->add()) {
                Toolbox::addLogLine(self::getL('Failed for creation of address of NetEven order Id') . ' ' . $order_id);
            } else {
                $id_address = $new_address->id;
            }
        }
        return $id_address;
    }
开发者ID:juniorhq88,项目名称:PrestaShop-modules,代码行数:55,代码来源:GatewayOrder.php


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