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

PHP fn_strtolower函数代码示例

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

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



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

示例1: generateName

 /**
  * Checks if file with this name is already exist and generate new name if it is so
  *
  * @param  string $file path to file
  * @return string unique file name
  */
 public function generateName($file)
 {
     $info = fn_pathinfo($file);
     while ($this->isExist($file)) {
         $info['filename'] .= '_' . fn_strtolower(fn_generate_code('', $this->_file_suffix_length));
         $file = $info['dirname'] . '/' . $info['filename'] . '.' . $info['extension'];
     }
     return $file;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:15,代码来源:ABackend.php


示例2: _generateName

 /**
  * Checks if file with this name is already exist and generate new name if it is so
  *
  * @param  string $file path to file
  * @return string unique file name
  */
 protected function _generateName($file)
 {
     if ($this->isExist($file)) {
         $parts = explode('.', $file);
         $parts[0] .= '_' . fn_strtolower(fn_generate_code('', $this->_file_suffix_length));
         $file = implode('.', $parts);
     }
     return $file;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:15,代码来源:ABackend.php


示例3: WAGetCities

    public static function WAGetCities($location)
    {
        $city_name = $location['city'];
        $url = self::$url;
        if (!empty($location['country'])) {
            $country_name = fn_get_country_name($location['country'], 'ru');
        } else {
            $country_name = '';
        }
        $data = <<<EOT
        <root xmlns="http://spsr.ru/webapi/Info/GetCities/1.0">
            <p:Params Name="WAGetCities" Ver="1.0" xmlns:p="http://spsr.ru/webapi/WA/1.0" />
            <GetCities CityName="{$city_name}" CountryName="{$country_name}"/>
        </root>
EOT;
        $response = Http::post($url, $data, self::$extra);
        $xml = simplexml_load_string($response);
        $return = false;
        $status_code = (string) $xml->Result['RC'];
        if ($status_code != 0) {
            self::$last_error = !empty(self::$_error_descriptions[$status_code]) ? self::$_error_descriptions[$status_code] : __("shippings.spsr.error_city");
        } else {
            if (isset($xml->City->Cities) && !empty($xml->City)) {
                $return = array();
                $city_name = fn_strtolower($city_name);
                foreach ($xml->City->Cities as $city) {
                    $spsr_city = fn_strtolower((string) $city['CityName']);
                    if ($spsr_city == $city_name) {
                        $return = self::attributesToArray($city);
                    }
                }
            }
        }
        if (empty($return)) {
            self::$last_error = __("shipping.sdek.not_city");
        }
        return $return;
    }
开发者ID:askzap,项目名称:ask-zap,代码行数:38,代码来源:RusSpsr.php


示例4: md5

$post['transactionAmount'] = $order_info['total'];
// Payment Params
$post['paymentCardName'] = $order_info['payment_info']['cardholder_name'];
$post['paymentCardNumber'] = $order_info['payment_info']['card_number'];
$post['paymentCardExpiry'] = $order_info['payment_info']['expiry_month'] . $order_info['payment_info']['expiry_year'];
$post['paymentCardCSC'] = $order_info['payment_info']['cvv2'];
// Customer Params
$post['customerName'] = $order_info['b_firstname'] . ' ' . $order_info['b_lastname'];
$post['customerCountry'] = $order_info['b_country'];
$post['customerState'] = $order_info['b_state_descr'];
$post['customerCity'] = $order_info['b_city'];
$post['customerAddress'] = $order_info['b_address'] . (!empty($order_info['b_address_2']) ? ' ; ' . $order_info['b_address_2'] : '');
$post['customerPostCode'] = $order_info['b_zipcode'];
$post['customerIP'] = $_SERVER['REMOTE_ADDR'];
//Transaction Hash
$post['hash'] = md5(fn_strtolower($passPhrase . $processor_data['processor_params']['merchant_id'] . $order_info['total'] . $processor_data['processor_params']['currency']));
// Post a request and analyse the response
Registry::set('log_cut_data', array('paymentCardName', 'paymentCardNumber', 'paymentCardExpiry', 'paymentCardCSC'));
$response_data = Http::post($post_address, $post);
if (!empty($response_data)) {
    // Parse the XML
    $xml = simplexml_load_string($response_data);
    // Convert the result from a SimpleXMLObject into an array
    $xml = (array) $xml;
    // Validate the response - the only successful code is 0
    $status = (int) $xml['responseCode'] === 0 ? 'P' : 'F';
    // Pass TRN Status, Id and Response
    $pp_response = array('order_status' => $status, 'transaction_id' => isset($xml['transactionID']) ? $xml['transactionID'] : null, 'reason_text' => ($pos = strpos($xml['responseMessage'], ':')) === false ? $xml['responseMessage'] : substr($xml['responseMessage'], $pos + 1));
} else {
    // Invalid response
    $pp_response = array('order_status' => 'F', 'transaction_id' => null, 'reason_text' => 'API response invalid.');
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:merchant_warrior.php


示例5: array

    }
    $width = !empty($_REQUEST['width']) ? $_REQUEST['width'] : BCD_DEFAULT_WIDTH;
    $height = !empty($_REQUEST['height']) ? $_REQUEST['height'] : BCD_DEFAULT_HEIGHT;
    $id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : '';
    $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : '';
    $xres = 1;
    $font = 3;
    $prefix = 'spsr';
    $objects = array('I25' => 'I25Object', 'C39' => 'C39Object', 'C128A' => 'C128AObject', 'C128B' => 'C128BObject', 'C128C' => 'C128CObject');
    $numeric_objects = array('I25' => true, 'C128C' => true);
    if (!empty($objects[$type])) {
        if (!empty($numeric_objects[$type]) && !is_numeric($prefix)) {
            $prefix = '';
        }
        $code = $prefix . $id;
        require Registry::get('config.dir.addons') . 'barcode/lib/barcodegenerator/' . fn_strtolower($objects[$type]) . '.php';
        $obj = new $objects[$type]($width, $height, $style, $code);
        if ($obj) {
            $obj->SetFont($font);
            $obj->DrawObject($xres);
            $obj->FlushObject();
            $obj->DestroyObject();
            unset($obj);
        }
    } else {
        __DEBUG__("Need bar code type ex. C39");
    }
    exit;
}
function fn_spsr_pre_check_invoice_create($order_id, $section, $spsr_shipments = array())
{
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:orders.post.php


示例6: fn_set_notification

        fn_set_notification('N', __('notice'), __('text_directory_created', array('[directory]' => fn_basename($folder_path))));
    } else {
        fn_set_notification('E', __('error'), __('text_cannot_create_directory', array('[directory]' => fn_basename($folder_path))));
    }
    return array(CONTROLLER_STATUS_REDIRECT, 'templates.init_view?dir=' . $_REQUEST['file_path']);
} elseif ($mode == 'get_file') {
    $pname = fn_te_normalize_path($_REQUEST, $root_dir);
    if (fn_te_check_path($pname)) {
        if (is_file($pname) && !in_array(fn_strtolower(fn_get_file_ext($pname)), Registry::get('config.forbidden_file_extensions'))) {
            fn_get_file($pname);
        }
    }
    exit;
} elseif ($mode == 'edit') {
    $fname = fn_te_normalize_path($_REQUEST, $root_dir);
    if (fn_te_check_path($fname) && !in_array(fn_strtolower(fn_get_file_ext($fname)), Registry::get('config.forbidden_file_extensions'))) {
        Tygh::$app['ajax']->assign('content', fn_get_contents($fname));
    } else {
        fn_set_notification('E', __('error'), __('you_have_no_permissions'));
    }
    exit;
} elseif ($mode == 'restore') {
    $copied = false;
    $file_path = fn_te_normalize_path($_REQUEST, $root_dir);
    if (fn_te_check_path($file_path)) {
        $repo_path = str_replace($root_dir, fn_te_get_root('repo'), $file_path);
        if (!file_exists($repo_path) && fn_get_theme_path('[theme]') != Registry::get('config.base_theme') && is_dir(fn_get_theme_path('[repo]/[theme]'))) {
            $repo_path = preg_replace("/\\/themes_repository\\/(\\w+)\\//", "/themes_repository/" . Registry::get('config.base_theme') . "/", $repo_path);
        }
        $object_base = is_file($repo_path) ? 'file' : (is_dir($repo_path) ? 'directory' : '');
        if (!empty($object_base) && fn_copy($repo_path, $file_path)) {
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:templates.php


示例7: _generateAdditionalCacheLevel

 /**
  * Generates additional cache levels by storage
  *
  * @param  array  $cache_scheme Block cache scheme
  * @param  string $handler_name Name of handlers frocm block scheme
  * @param  array  $storage      Storage to find params
  * @return string Additional chache level
  */
 private static function _generateAdditionalCacheLevel($cache_scheme, $handler_name, $storage)
 {
     $additional_level = '';
     if (!empty($cache_scheme[$handler_name]) && is_array($cache_scheme[$handler_name])) {
         foreach ($cache_scheme[$handler_name] as $param) {
             $param = fn_strtolower(str_replace('%', '', $param));
             if (isset($storage[$param])) {
                 $additional_level .= '|' . $param . '=' . md5(serialize($storage[$param]));
             }
         }
     }
     return $additional_level;
 }
开发者ID:arpad9,项目名称:bygmarket,代码行数:21,代码来源:RenderManager.php


示例8: fn_get_theme_path

        $full_path = fn_get_theme_path('[themes]/[theme]', 'C') . '/templates/' . $_REQUEST['file'];
        if (fn_check_path($full_path)) {
            $c_name = fn_normalize_path($full_path);
            $r_name = fn_normalize_path(Registry::get('config.dir.themes_repository') . Registry::get('config.base_theme') . '/templates/' . $_REQUEST['file']);
            if (is_file($r_name)) {
                $copied = fn_copy($r_name, $c_name);
            }
            if ($copied) {
                fn_set_notification('N', __('notice'), __('text_file_restored', array('[file]' => fn_basename($_REQUEST['file']))));
            } else {
                fn_set_notification('E', __('error'), __('text_cannot_restore_file', array('[file]' => fn_basename($_REQUEST['file']))));
            }
            if ($copied) {
                if (defined('AJAX_REQUEST')) {
                    Registry::get('ajax')->assign('force_redirection', fn_url($_REQUEST['current_url']));
                    Registry::get('ajax')->assign('non_ajax_notifications', true);
                }
                return array(CONTROLLER_STATUS_OK, $_REQUEST['current_url']);
            }
        }
        exit;
    }
}
if ($mode == 'get_content') {
    $ext = fn_strtolower(fn_get_file_ext($_REQUEST['file']));
    if ($ext == 'tpl') {
        $theme_path = fn_get_theme_path('[themes]/[theme]/templates/', 'C');
        Registry::get('ajax')->assign('content', fn_get_contents($_REQUEST['file'], $theme_path));
    }
    exit;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:design_mode.php


示例9: fn_filter_uploaded_data

/**
 * Filter data from file uploader
 *
 * @param string $name
 * @return array $filtered
 */
function fn_filter_uploaded_data($name, $filter_by_ext = array())
{
    $udata_local = fn_rebuild_files('file_' . $name);
    $udata_other = !empty($_REQUEST['file_' . $name]) ? $_REQUEST['file_' . $name] : array();
    $utype = !empty($_REQUEST['type_' . $name]) ? $_REQUEST['type_' . $name] : array();
    //var_dump($name);echo"<br/>";
    //    if($name=='p_feature_var_extra_image_detailed'){
    //        var_dump($utype);die();
    //    }
    if (empty($utype)) {
        return array();
    }
    $filtered = array();
    foreach ($utype as $id => $type) {
        if ($type == 'local' && !fn_is_empty(@$udata_local[$id])) {
            $filtered[$id] = fn_get_local_data(Bootstrap::stripSlashes($udata_local[$id]));
        } elseif ($type == 'server' && !fn_is_empty(@$udata_other[$id]) && AREA == 'A') {
            fn_get_last_key($udata_other[$id], 'fn_get_server_data', true);
            $filtered[$id] = $udata_other[$id];
        } elseif ($type == 'url' && !fn_is_empty(@$udata_other[$id])) {
            fn_get_last_key($udata_other[$id], 'fn_get_url_data', true);
            $filtered[$id] = $udata_other[$id];
        }
        if (isset($filtered[$id]) && $filtered[$id] === false) {
            unset($filtered[$id]);
            fn_set_notification('E', __('error'), __('cant_upload_file'));
        }
        if (!empty($filtered[$id]) && is_array($filtered[$id]) && !empty($filtered[$id]['name'])) {
            $filtered[$id]['name'] = str_replace(' ', '_', urldecode($filtered[$id]['name']));
            // replace spaces with underscores
            $ext = fn_get_file_ext($filtered[$id]['name']);
            if (!empty($filter_by_ext) && !in_array(fn_strtolower($ext), $filter_by_ext)) {
                unset($filtered[$id]);
                fn_set_notification('E', __('error'), __('text_not_allowed_to_upload_file_extension', array('[ext]' => $ext)));
            } elseif (in_array(fn_strtolower($ext), Registry::get('config.forbidden_file_extensions'))) {
                unset($filtered[$id]);
                fn_set_notification('E', __('error'), __('text_forbidden_file_extension', array('[ext]' => $ext)));
            }
        }
        if (!empty($filtered[$id]['path']) && in_array(fn_get_mime_content_type($filtered[$id]['path'], true, 'text/plain'), Registry::get('config.forbidden_mime_types'))) {
            fn_set_notification('E', __('error'), __('text_forbidden_file_mime', array('[mime]' => fn_get_mime_content_type($filtered[$id]['path'], true, 'text/plain'))));
            unset($filtered[$id]);
        }
    }
    static $shutdown_inited;
    if (!$shutdown_inited) {
        $shutdown_inited = true;
        register_shutdown_function('fn_remove_temp_data');
    }
    return $filtered;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:57,代码来源:fn.fs.php


示例10: fn_set_notification

        fn_set_notification('N', __('notice'), __('text_permissions_changed'));
    } else {
        fn_set_notification('E', __('error'), __('error_permissions_not_changed'));
    }
    return array(CONTROLLER_STATUS_REDIRECT, 'file_editor.init_view?dir=' . $_REQUEST['file_path']);
} elseif ($mode == 'get_file') {
    $pname = fn_te_normalize_path($_REQUEST, $section_root_dir);
    if (fn_te_check_path($pname, $_SESSION['active_section'])) {
        if (is_file($pname) && !in_array(fn_strtolower(fn_get_file_ext($pname)), Registry::get('config.forbidden_file_extensions'))) {
            fn_get_file($pname);
        }
    }
    exit;
} elseif ($mode == 'edit') {
    $fname = fn_te_normalize_path($_REQUEST, $section_root_dir);
    if (fn_te_check_path($fname, $_SESSION['active_section']) && !in_array(fn_strtolower(fn_get_file_ext($fname)), Registry::get('config.forbidden_file_extensions'))) {
        Registry::get('ajax')->assign('content', fn_get_contents($fname));
    } else {
        fn_set_notification('E', __('error'), __('you_have_no_permissions'));
    }
    exit;
} elseif ($mode == 'restore') {
    $copied = false;
    $file_path = fn_te_normalize_path($_REQUEST, $section_root_dir);
    if (fn_te_check_path($file_path, $_SESSION['active_section'])) {
        $repo_path = str_replace($section_root_dir, fn_te_get_root('repo'), $file_path);
        if (!file_exists($repo_path) && fn_get_theme_path('[theme]') != Registry::get('config.base_theme') && is_dir(fn_get_theme_path('[repo]/[theme]'))) {
            $repo_path = preg_replace("/\\/themes_repository\\/(\\w+)\\//", "/themes_repository/" . Registry::get('config.base_theme') . "/", $repo_path);
        }
        $object_base = is_file($repo_path) ? 'file' : (is_dir($repo_path) ? 'directory' : '');
        if (!empty($object_base) && fn_copy($repo_path, $file_path)) {
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:file_editor.php


示例11: db_get_field

* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    require './init_payment.php';
    $order_id = (int) $_REQUEST['order_id'];
    if (!empty($_REQUEST['payer_merchant_reference_id']) || !empty($_REQUEST['payer_callback_type']) && $_REQUEST['payer_callback_type'] == 'settle') {
        // Settle data is received
        $payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id = ?i", $order_id);
        $processor_data = fn_get_payment_method_data($payment_id);
        $order_info = fn_get_order_info($order_id);
        if ($order_info['status'] == 'N' || $order_info['status'] == 'O') {
            $pp_response = array();
            $req_url = ($_SERVER['SERVER_PORT'] == '80' ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $ok1 = fn_strtolower($_REQUEST['md5sum']) == fn_strtolower(md5($processor_data['processor_params']['key_1'] . substr($req_url, 0, strpos($req_url, '&md5sum')) . $processor_data['processor_params']['key_2']));
            $valid_ips = array('217.151.207.84', '79.136.103.5', '79.136.103.9', '94.140.57.180', '94.140.57.184', '192.168.100.1');
            $ok2 = in_array($_SERVER['REMOTE_ADDR'], $valid_ips);
            $pp_response['order_status'] = $ok1 && $ok2 ? 'P' : 'F';
            $pp_response['reason_text'] = __('order_id') . '-' . $order_id;
            $pp_response['transaction_id'] = !empty($_REQUEST['payread_payment_id']) ? $_REQUEST['payread_payment_id'] : 'BANK';
            fn_finish_payment($order_id, $pp_response);
        }
        echo "TRUE";
        exit;
    } else {
        // Customer is redirected from the Pay&Read server
        // Check if the settle data was recieved and order status was upsated otherwise transaction is failed
        $order_info = fn_get_order_info($order_id);
        if ($order_info['status'] == 'N' || $order_info['status'] == 'O') {
            $pp_response = array();
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:pay_read.php


示例12: fn_init_ua

/**
 * Detect user agent
 *
 * @return boolean true always
 */
function fn_init_ua()
{
    static $crawlers = array('google', 'bot', 'yahoo', 'spider', 'archiver', 'curl', 'python', 'nambu', 'Twitterbot', 'perl', 'sphere', 'PEAR', 'java', 'wordpress', 'radian', 'crawl', 'yandex', 'eventbox', 'monitor', 'mechanize', 'facebookexternal');
    $http_ua = fn_strtolower($_SERVER['HTTP_USER_AGENT']);
    if (strpos($http_ua, 'shiretoko') !== false || strpos($http_ua, 'firefox') !== false) {
        $ua = 'firefox';
    } elseif (strpos($http_ua, 'chrome') !== false) {
        $ua = 'chrome';
    } elseif (strpos($http_ua, 'safari') !== false) {
        $ua = 'safari';
    } elseif (strpos($http_ua, 'opera') !== false) {
        $ua = 'opera';
    } elseif (strpos($http_ua, 'msie') !== false || strpos($http_ua, 'trident/7.0; rv:11.0') !== false) {
        // IE11 does not send normal headers and seems like Mozilla:
        // Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko
        $ua = 'ie';
        if (preg_match("/msie (6|7|8)/i", $http_ua)) {
            Registry::set('runtime.unsupported_browser', true);
        }
    } elseif (preg_match('/(' . implode('|', $crawlers) . ')/', $http_ua, $m)) {
        $ua = 'crawler';
        fn_define('CRAWLER', $m[1]);
        fn_define('NO_SESSION', true);
        // do not start session for crawler
    } else {
        $ua = 'unknown';
    }
    fn_define('USER_AGENT', $ua);
    return array(INIT_STATUS_OK);
}
开发者ID:ambient-lounge,项目名称:site,代码行数:35,代码来源:fn.init.php


示例13: fn_clone_table_data

function fn_clone_table_data($table_data, $clone_data, $start, $from, $to, $extra = array())
{
    static $schema;
    static $cloned_ids = array();
    $clone_id = $table_data['name'];
    if (!isset($cloned_ids[$clone_id])) {
        $cloned_ids[$clone_id] = array();
    }
    if (empty($schema)) {
        $schema = fn_init_clone_schemas();
    }
    $limit = 50;
    // Clone 50 lines per one iteration
    $return = array();
    $condition = '';
    if (!empty($table_data['condition'])) {
        $condition = ' AND ' . implode(' AND ', $table_data['condition']);
        preg_match_all('/%(.*?)%/', $condition, $variables);
        foreach ($variables[1] as $variable) {
            $variable = fn_strtolower($variable);
            $var = ${$variable};
            if (is_array($var)) {
                $var = implode(', ', $var);
            }
            $condition = preg_replace('/%(.*?)%/', $var, $condition, 1);
        }
    }
    if (!empty($table_data['dependence_tree'])) {
        $ids = fn_build_dependence_tree($table_data['name'], $table_data['key'], $parent = 'parent_id', $from);
        $data = $_data = array();
        if (!empty($ids)) {
            $_data = db_get_hash_array('SELECT * FROM ?:' . $table_data['name'] . ' WHERE company_id = ?i ' . $condition . 'AND ' . $table_data['key'] . ' IN (?a)', $table_data['key'], $from, $ids);
        }
        foreach ($ids as $id) {
            if (isset($_data[$id])) {
                $data[] = $_data[$id];
            }
        }
        unset($_data, $ids);
        $start = db_get_field('SELECT COUNT(*) FROM ?:' . $table_data['name'] . ' WHERE company_id = ?i', $from);
    } elseif (empty($clone_data)) {
        $data = db_get_array('SELECT * FROM ?:' . $table_data['name'] . ' WHERE company_id = ?i ' . $condition . ' LIMIT ?i, ?i', $from, $start, $limit);
    } else {
        $data = db_get_array('SELECT * FROM ?:' . $table_data['name'] . ' WHERE ' . $table_data['key'] . ' IN (?a)' . $condition, array_keys($clone_data));
    }
    if (!empty($data)) {
        // We using sharing. So do not use "quick" insert schema...
        if (false && empty($table_data['children']) && empty($table_data['pre_process']) && empty($table_data['post_process']) && empty($table_data['return_clone_data'])) {
            $exclude = array(empty($clone_data) ? $table_data['key'] : '');
            if (!empty($table_data['exclude'])) {
                $exclude = array_merge($exclude, $table_data['exclude']);
            }
            $fields = fn_get_table_fields($table_data['name'], $exclude, true);
            $query = 'REPLACE INTO ?:' . $table_data['name'] . ' (' . implode(',', $fields) . ') VALUES ';
            $rows = array();
            foreach ($data as $row) {
                if (empty($clone_data)) {
                    unset($row[$table_data['key']]);
                } else {
                    $row[$table_data['key']] = $clone_data[$row[$table_data['key']]];
                }
                if (!empty($extra)) {
                    foreach ($extra as $field => $field_data) {
                        if (isset($field_data[$row[$field]])) {
                            $row[$field] = $field_data[$row[$field]];
                        }
                    }
                }
                if (isset($row['company_id'])) {
                    $row['company_id'] = $to;
                }
                if (!empty($table_data['exclude'])) {
                    foreach ($table_data['exclude'] as $exclude_field) {
                        unset($row[$exclude_field]);
                    }
                }
                $row = explode('(###)', addslashes(implode('(###)', $row)));
                $rows[] = "('" . implode("', '", $row) . "')";
            }
            $query .= implode(', ', $rows);
            db_query($query);
        } else {
            foreach ($data as $id => $row) {
                if (!empty($table_data['key'])) {
                    $key = $row[$table_data['key']];
                    if (empty($clone_data)) {
                        unset($row[$table_data['key']]);
                    } else {
                        $row[$table_data['key']] = $clone_data[$row[$table_data['key']]];
                    }
                }
                if (isset($row['company_id'])) {
                    $row['company_id'] = $to;
                }
                if (!empty($extra)) {
                    foreach ($extra as $field => $field_data) {
                        if (isset($field_data[$row[$field]])) {
                            $row[$field] = $field_data[$row[$field]];
                        }
                    }
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:fn.ultimate.php


示例14: fn_finish_payment

            $pp_response["reason_text"] = "CpiResultsCode: " . $_REQUEST['CpiResultsCode'];
        } else {
            $pp_response["order_status"] = "F";
            $pp_response["reason_text"] = $hsbc_errors[$_REQUEST['CpiResultsCode']];
        }
        $order_id = $_REQUEST['OrderId'];
        if (fn_check_payment_script('hsbc.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
            fn_order_placement_routines('route', $order_id);
        }
        exit;
    }
} else {
    $hashkey = $processor_data['processor_params']['cpihashkey'];
    $post_data = array("CpiDirectResultUrl" => fn_url("payment_notification.notify?payment=hsbc&order_id={$order_id}", AREA, 'https'), "CpiReturnUrl" => fn_url("payment_notification.invoice?payment=hsbc&order_id={$order_id}", AREA, 'https'), "MerchantData" => "ORDER " . $order_id, "Mode" => $processor_data['processor_params']['mode'], "OrderDesc" => "ORDER " . $order_id . ($order_info['repaid'] ? '_' . $order_info['repaid'] : ''), "OrderId" => $order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id, "PurchaseAmount" => $order_info['total'] * ($processor_data['processor_params']['currency'] != '392' ? 100 : 1), "PurchaseCurrency" => $processor_data['processor_params']['currency'], "StorefrontId" => $processor_data['processor_params']['store_id'], "TimeStamp" => time() . "000", "TransactionType" => "Capture", "UserId" => $order_info['firstname'] . " " . $order_info['lastname'], "BillingAddress1" => str_replace('\\n', '', $order_info['b_address']), "BillingCity" => $order_info['b_city'], "BillingCountry" => db_get_field("SELECT code_N3 FROM ?:countries WHERE code = ?s", $order_info['b_country']), "BillingCounty" => $order_info['b_state'] ? $order_info['b_state'] : 'n/a', "BillingFirstName" => $order_info['b_firstname'], "BillingLastName" => $order_info['b_lastname'], "BillingPostal" => $order_info['b_zipcode'], "ShopperEmail" => $order_info['email'], "ShippingAddress1" => str_replace('\\n', '', $order_info['s_address']), "ShippingCity" => $order_info['s_city'], "ShippingCountry" => db_get_field("SELECT code_N3 FROM ?:countries WHERE code = ?s", $order_info['s_country']), "ShippingCounty" => $order_info['s_state'] ? $order_info['s_state'] : 'n/a', "ShippingFirstName" => $order_info['s_firstname'], "ShippingLastName" => $order_info['s_lastname'], "ShippingPostal" => $order_info['s_zipcode']);
    $_current_os = fn_strtolower(substr(PHP_OS, 0, 3));
    $post_data_line = escapeshellarg(implode("\" \"", $post_data));
    // Generate Hash
    if ($_current_os == 'win') {
        @exec('PATH ' . Registry::get('config.dir.payments') . 'hsbc_files/lib/' . $_current_os);
        @exec(Registry::get('config.dir.payments') . 'hsbc_files/modules/' . $_current_os . '/TestHash.exe ' . $hashkey . " \"" . $post_data_line . "\"", $data);
    } elseif ($_current_os == 'sun') {
        putenv("LD_LIBRARY_PATH=" . Registry::get('config.dir.payments') . "hsbc_files/lib/{$_current_os}");
        @exec(Registry::get('config.dir.payments') . "hsbc_files/modules/{$_current_os}/TestHash.e " . $hashkey . " \"" . $post_data_line . "\"", $data);
    } elseif ($_current_os == 'lin') {
        putenv("LD_LIBRARY_PATH=" . Registry::get('config.dir.payments') . "hsbc_files/lib/{$_current_os}");
        @exec(Registry::get('config.dir.payments') . "hsbc_files/modules/{$_current_os}/TestHash.e " . $hashkey . " \"" . $post_data_line . "\"", $data);
    }
    if (!preg_match("/^Hash value:  (.*)\$/", @$data[0], $a)) {
        //Set notification
        fn_set_notification('E', __('error'), __('error_hash_generation'));
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:hsbc.php


示例15: fn_payjunction_response_val

function fn_payjunction_response_val($key, $response)
{
    $processor_response = array("avs" => array("AWZ" => "Match Address OR Zip", "XY" => "Match Address AND Zip", "WZ" => "Match Zip", "AW" => "Match Address OR 9 Digit Zip", "AZ" => "Match Address OR 5 Digit Zip", "A" => "Match Address", "X" => "Match Address AND 9 Digit Zip", "Y" => "Match Address AND 5 Digit Zip", "W" => "Match 9 Digit Zip", "Z" => "Match 5 Digit Zip"), "cvv" => array("M" => "CVV On", "I" => "CVV Off"), "preauth" => array("true" => "Pre-auth On", "false" => "Pre-auth Off"), "avsforce" => array("true" => "AVS Force On", "false" => "AVS Force Off"), "cvvforce" => array("true" => "CVV Force On", "false" => "CVV Force Off"));
    $key_ = strtr(fn_strtolower($key), array(" " => "_"));
    return $processor_response[$key_][$response[$key_]] ? $processor_response[$key_][$response[$key_]] : $key . " Code: " . $response[$key_];
}
开发者ID:askzap,项目名称:ultimate,代码行数:6,代码来源:payjunction.php


示例16: getVariants

 /**
  * Function retuns variants for setting objects
  *
  * Usage (examples):
  *  // Addons
  *  Settings::instance->get_variants('affiliate', 'payment_period');
  *
  *  // Core same as addons but if $section_tab_name is empty it will be setted to 'main'
  *  Settings::instance->get_variants('general', 'feedback_type');
  *
  *  // Return variants only by setting id, but function not check custom variant functions
  *  Settings::instance->get_variants('', '', '', 40);
  *
  *  // Return variants only by setting id, and checks custom variant functions
  *  Settings::instance->get_variants('affiliate', 'payment_period', '', 40);
  *
  * @param  string $section_name     Setting name
  * @param  string $setting_name     Section name
  * @param  string $section_tab_name Section tab name
  * @param  int    $object_id        Id of setting in setting_objects table
  * @param  string $lang_code        2 letters language code
  * @return array  Array of variants or empty array if this setting have no variants
  */
 public function getVariants($section_name, $setting_name, $section_tab_name = '', $object_id = null, $lang_code = CART_LANGUAGE)
 {
     fn_get_schema('settings', 'variants.functions', 'php', true);
     $variants = array();
     // Generate custom variants
     $addon_variant_func = 'fn_settings_variants_addons_' . fn_strtolower($section_name) . '_' . fn_strtolower($setting_name);
     $core_variant_func = 'fn_settings_variants_' . fn_strtolower($section_name) . '_' . ($section_tab_name != 'main' ? fn_strtolower($section_tab_name) . '_' : '') . fn_strtolower($setting_name);
     if (function_exists($addon_variant_func)) {
         $variants = $addon_variant_func();
     } elseif (function_exists($core_variant_func)) {
         $variants = $core_variant_func();
     } else {
         // If object id is 0 try to get it from section name and setting name
         if ($object_id === null || $object_id === 0) {
             $object_id = $this->getId($setting_name, $section_name);
         }
         if ($object_id !== null && $object_id !== 0 || $object_id == 'all') {
             if ($object_id == 'all') {
                 $object_condition = '';
             } else {
                 $object_condition = db_quote('?:settings_variants.object_id = ?i AND', $object_id);
             }
             $_variants = db_get_array("SELECT ?:settings_variants.*, ?:settings_descriptions.value, ?:settings_descriptions.object_type " . "FROM ?:settings_variants " . "INNER JOIN ?:settings_descriptions " . "ON ?:settings_descriptions.object_id = ?:settings_variants.variant_id AND object_type = ?s " . "WHERE ?p ?:settings_descriptions.lang_code = ?s ORDER BY ?:settings_variants.position", Settings::VARIANT_DESCRIPTION, $object_condition, $lang_code);
             fn_update_lang_objects('variants', $_variants);
             foreach ($_variants as $variant) {
                 if ($object_id == 'all') {
                     $variants[$variant['name']] = array('value' => $variant['value']);
                 } else {
                     $variants[$variant['name']] = $variant['value'];
                 }
             }
         } else {
             if (Debugger::isActive() || fn_is_development()) {
                 $message = str_replace("[option_id]", $setting_name, __('setting_has_no_variants'));
                 fn_set_notification('E', __('error'), $message);
             }
             return $variants;
         }
     }
     return $variants;
 }
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:64,代码来源:Settings.php


示例17: fn_return_bytes

function fn_return_bytes($val)
{
    $last = fn_strtolower($val[strlen($val) - 1]);
    switch ($last) {
        case 'g':
            $val *= 1024;
        case 'm':
            $val *= 1024;
        case 'k':
            $val *= 1024;
            break;
    }
    return $val;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:14,代码来源:fn.common.php


示例18: die

* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
$processor_error = array("A4" => "A link error has occurred between the bank and the modem.", "A5" => "The secure PIN Pad unit is not responding.", "A6" => "No free PIN Pad slots were available to service the transaction request.", "A7" => "A generic interface request specified an illegal value in 'Polled' field.", "A8" => "An invalid amount was specified.", "AA" => "An invalid card number was specified.", "AB" => "An account invalid value for account was specified", "AC" => "A past date was specified for expiry", "AD" => "The specified account is not available on the server.", "AE" => "A queued Authorisation timed-out.", "AF" => "A journal lookup did not find the requested transaction.", "U9" => "A valid response was not received in time from the Bank Host.", "W6" => "The function requested is not supported by the OCV servers bank.");
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_REQUEST['ewayTrxnStatus'])) {
    $order_info = fn_get_order_info($_REQUEST['order_id']);
    if (fn_strtolower($_REQUEST['ewayTrxnStatus']) == 'true' && fn_format_price(str_replace(array('$', ','), '', $_REQUEST['eWAYReturnAmount'])) == fn_format_price($order_info['total'])) {
        $pp_response['order_status'] = 'P';
        $pp_response["reason_text"] = $_REQUEST['eWAYresponseText'];
    } else {
        $pp_response['order_status'] = 'F';
        $pp_response["reason_text"] = $_REQUEST['eWAYresponseText'] . ":" . @$processor_error[$_REQUEST['eWAYresponseCode']];
    }
    if (fn_strtolower($_REQUEST['eWAYoption3']) == 'true') {
        $pp_response["reason_text"] .= "; This is a TEST transaction";
    }
    $pp_response["transaction_id"] = $_REQUEST['ewayTrxnReference'];
    if (fn_check_payment_script('eway_form.php', $_REQUEST['order_id'])) {
        fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
        fn_order_placement_routines('route', $_REQUEST['order_id']);
    }
} else {
    $return_url = fn_url("payment_notification.notify?payment=eway_form&order_id={$order_id}", AREA, 'current');
    $order_total = 100 * $order_info['total'];
    $testmode = $processor_data['processor_params']['test'] == 'Y' ? "TRUE" : "FALSE";
    $_order_id = $processor_data['processor_params']['order_prefix'] . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id);
    $post_data = array('ewayCustomerID' => $processor_data['processor_params']['client_id'], 'ewayTotalAmount' => $order_total, 'ewayCustomerInvoiceRef' => $_order_id, 'ewayCustomerFirstName' => $order_info['firstname'], 'ewayCustomerLastName' => $order_info['lastname'], 'ewayCustomerEmail' => $order_info['email'], 'ewayCustomerAddress' => $order_info['b_address'], 'ewayCustomerPostcode' => $order_info['b_zipcode'], 'ewayOption3' => $testmode, 'ewayURL' => $return_url);
    fn_create_payment_form('https://www.eway.com.au/gateway/payment.asp', $post_data, 'eWay');
    exit;
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:eway_form.php


示例19: fn_anti_fraud_place_order

function fn_anti_fraud_place_order(&$order_id, &$action, &$order_status)
{
    $checked = db_get_field('SELECT COUNT(*) FROM ?:order_data WHERE order_id = ?i AND type = ?s', $order_id, 'F');
    if ($action == 'save' || defined('ORDER_MANAGEMENT') || $checked) {
        return true;
    }
    $return = array();
    $af_settings = Registry::get('addons.anti_fraud');
    if (empty($af_settings['anti_fraud_key'])) {
        return false;
    }
    $order_info = fn_get_order_info($order_id);
    if (empty($order_info['ip_address'])) {
        $return['B'][] = 'af_ip_not_found';
    }
    $risk_factor = 1;
    $request = array('license_key' => $af_settings['anti_fraud_key'], 'i' => $order_info['ip_address'], 'city' => $order_info['b_city'], 'region' => $order_info['b_state'], 'postal' => $order_info['b_zipcode'], 'country' => $order_info['b_country'], 'domain' => substr($order_info['email'], strpos($order_info['email'], '@') + 1), 'emailMD5' => $order_info['email']);
    $_result = Http::get('http://www.maxmind.com/app/ccv2r', $request);
    $result = array();
    $_result = explode(';', $_result);
    if (is_array($_result)) {
        foreach ($_result as $v) {
            $tmp = explode('=', $v);
            $result[$tmp[0]] = $tmp[1];
       

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP fn_substr函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_strlen函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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