本文整理汇总了PHP中zen_not_null函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_not_null函数的具体用法?PHP zen_not_null怎么用?PHP zen_not_null使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_not_null函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quote
function quote($method = '')
{
global $order, $shipping_weight;
$calc_weight = $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE') && defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT') && defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE') && MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE > 0) {
if ($calc_weight <= MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT) {
$shipping_cost = MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE + MODULE_SHIPPING_CHINAPOSTREGISTERED_REGISTER_FEE;
} else {
$calc_weight = $calc_weight - MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT;
$shipping_cost = ceil($calc_weight / MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT) * MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE;
$shipping_cost = MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE + $shipping_cost + MODULE_SHIPPING_CHINAPOSTREGISTERED_REGISTER_FEE;
}
$shipping_method = MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_WAY . ' ' . $dest_country . ' (' . number_format($shipping_weight, 2) . MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_UNITS . ') ';
//modified by john 2010-06-30
//for better calculate with currency
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_EXCHANGE_RATE') ? MODULE_SHIPPING_CHINAPOSTREGISTERED_EXCHANGE_RATE : 1);
}
if ($shipping_weight > MODULE_SHIPPING_CHINAPOSTREGISTERED_BEYOND_WEIGHTLIMIT) {
$error = true;
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_CHINAPOSTREGISTERED_BEYOND_WEIGHTLIMIT_TEXT;
}
return $this->quotes;
}
示例2: process
function process()
{
global $order;
$order_total_array = array();
if (is_array($this->modules)) {
reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if (!isset($GLOBALS[$class])) {
continue;
}
$GLOBALS[$class]->process();
for ($i = 0, $n = sizeof($GLOBALS[$class]->output); $i < $n; $i++) {
if (zen_not_null($GLOBALS[$class]->output[$i]['title']) && zen_not_null($GLOBALS[$class]->output[$i]['text'])) {
$order_total_array[] = array('code' => $GLOBALS[$class]->code, 'title' => $GLOBALS[$class]->output[$i]['title'], 'text' => $GLOBALS[$class]->output[$i]['text'], 'value' => $GLOBALS[$class]->output[$i]['value'], 'sort_order' => $GLOBALS[$class]->sort_order);
}
}
}
//print_r($order_total_array);
}
// $order_total_array[3]['code']="ot_coupon";
// $order_total_array[3]['title']="12312312312";
// $order_total_array[3]['text']="-US$18.00";
// $order_total_array[3]['value']="16.00";
// $order_total_array[3]['sort_order']="400";
return $order_total_array;
}
示例3: zen_get_countries
/**
* Returns an array with countries
*
* @param int If set limits to a single country
* @param boolean If true adds the iso codes to the array
*/
function zen_get_countries($countries_id = '', $with_iso_codes = false)
{
global $db;
$countries_array = array();
if (zen_not_null($countries_id)) {
if ($with_iso_codes == true) {
$countries = "select countries_name, countries_iso_code_2, countries_iso_code_3\n from " . TABLE_COUNTRIES . "\n where countries_id = '" . (int) $countries_id . "'\n order by countries_name";
$countries_values = $db->Execute($countries);
$countries_array = array('countries_name' => $countries_values->fields['countries_name'], 'countries_iso_code_2' => $countries_values->fields['countries_iso_code_2'], 'countries_iso_code_3' => $countries_values->fields['countries_iso_code_3']);
} else {
$countries = "select countries_name\n from " . TABLE_COUNTRIES . "\n where countries_id = '" . (int) $countries_id . "'";
$countries_values = $db->Execute($countries);
$countries_array = array('countries_name' => $countries_values->fields['countries_name']);
}
} else {
$countries = "select countries_id, countries_name\n from " . TABLE_COUNTRIES . "\n order by countries_name";
$countries_values = $db->Execute($countries);
$front_list = array(223, 204, 195, 163, 81, 38, 14, 13);
array_unshift($countries_array, array('countries_id' => '-1', 'countries_name' => '-----------------------'));
while (!$countries_values->EOF) {
if (in_array($countries_values->fields['countries_id'], $front_list)) {
array_unshift($countries_array, array('countries_id' => $countries_values->fields['countries_id'], 'countries_name' => $countries_values->fields['countries_name']));
}
$countries_array[] = array('countries_id' => $countries_values->fields['countries_id'], 'countries_name' => $countries_values->fields['countries_name']);
$countries_values->MoveNext();
}
array_unshift($countries_array, array('countries_id' => '-1', 'countries_name' => '-----------------------'));
}
return $countries_array;
}
示例4: quote
function quote($method = '')
{
global $order;
if ($this->enabled) {
$excluded_array = explode(',', MODULE_SHIPPING_PREFERRED_SHIPPING_EXCLUDED_PRODUCTS);
$products_in_cart_array = explode(',', $_SESSION['cart']->get_product_id_list());
echo var_dump($products_in_cart_array);
foreach ($products_in_cart_array as $product_in_cart) {
$base_product_in_cart = substr($product_in_cart, 0, strpos($product_in_cart, ':'));
if (in_array($base_product_in_cart, $excluded_array)) {
$this->enabled = false;
}
}
if ($_SESSION['cart']->show_total() < MODULE_SHIPPING_PREFERRED_SHIPPING_MIN_ORDER) {
$this->enabled = false;
}
}
if ($this->enabled) {
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PREFERRED_SHIPPING_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PREFERRED_SHIPPING_TEXT_WAY, 'cost' => '0.00')));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
}
return $this->quotes;
}
示例5: quote
function quote($method = '')
{
global $order, $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT') && MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT > 0) {
//hkpost weight as gram g.
$shipping_cost = MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT * $shipping_weight;
if (defined('MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE') && MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE > 0) {
$shipping_cost += MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE;
}
//$shipping_method = MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_WAY . ' ' . $dest_country . ' ('.number_format($shipping_weight,2).MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_UNITS.')';
$shipping_method = MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_WAY;
//############################for better calculate with currency#########################
//modified by john 2010-06-30 2/3
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_HKPOSTREGISTERED_EXCHANGE_RATE') ? MODULE_SHIPPING_HKPOSTREGISTERED_EXCHANGE_RATE : 1);
}
if ($shipping_weight > MODULE_SHIPPING_HKPOSTREGISTERED_BEYOND_WEIGHTLIMIT) {
$error = true;
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_HKPOSTREGISTERED_BEYOND_WEIGHTLIMIT_TEXT;
}
return $this->quotes;
}
示例6: required_text
public static function required_text($text)
{
if (zen_not_null($text)) {
return "<span class='text-danger'><strong>{$text}</strong></span>";
}
return '';
}
开发者ID:Southern-Exposure-Seed-Exchange,项目名称:Zencart-Bootstrap-Theme,代码行数:7,代码来源:sese_bootstrap_forms.php
示例7: ot_gv
/**
* Enter description here...
*
* @return ot_gv
*/
function ot_gv()
{
global $currencies;
$this->code = 'ot_gv';
$this->title = MODULE_ORDER_TOTAL_GV_TITLE;
$this->header = MODULE_ORDER_TOTAL_GV_HEADER;
$this->description = MODULE_ORDER_TOTAL_GV_DESCRIPTION;
$this->user_prompt = MODULE_ORDER_TOTAL_GV_USER_PROMPT;
$this->sort_order = MODULE_ORDER_TOTAL_GV_SORT_ORDER;
$this->include_shipping = MODULE_ORDER_TOTAL_GV_INC_SHIPPING;
$this->include_tax = MODULE_ORDER_TOTAL_GV_INC_TAX;
$this->calculate_tax = MODULE_ORDER_TOTAL_GV_CALC_TAX;
$this->credit_tax = MODULE_ORDER_TOTAL_GV_CREDIT_TAX;
$this->tax_class = MODULE_ORDER_TOTAL_GV_TAX_CLASS;
$this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX;
$this->credit_class = true;
if (!zen_not_null(ltrim($_SESSION['cot_gv'], ' 0')) || $_SESSION['cot_gv'] == '0') {
$_SESSION['cot_gv'] = '0.00';
}
if (IS_ADMIN_FLAG !== true) {
$this->checkbox = $this->user_prompt . '<input type="text" size="6" onkeyup="submitFunction()" name="cot_gv" value="' . number_format($_SESSION['cot_gv'], 2) . '" onfocus="if (this.value == \'' . number_format($_SESSION['cot_gv'], 2) . '\') this.value = \'\';" />' . ($this->user_has_gv_account($_SESSION['customer_id']) > 0 ? '<br />' . MODULE_ORDER_TOTAL_GV_USER_BALANCE . $currencies->format($this->user_has_gv_account($_SESSION['customer_id'])) : '');
}
$this->output = array();
if (IS_ADMIN_FLAG === true) {
if ($this->include_tax == 'true' && $this->calculate_tax != "None") {
$this->title .= '<span class="alert">' . MODULE_ORDER_TOTAL_GV_INCLUDE_ERROR . '</span>';
}
}
}
示例8: notifierUpdate
function notifierUpdate($notifier)
{
global $db;
global $order;
switch ($notifier) {
case 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING':
if (zen_not_null($_POST['calendar_hope_delivery_day'])) {
$_SESSION['calendar_hope_delivery_day'] = zen_db_prepare_input($_POST['calendar_hope_delivery_day']);
}
if (zen_not_null($_POST['calendar_hope_delivery_time'])) {
$_SESSION['calendar_hope_delivery_time'] = zen_db_prepare_input($_POST['calendar_hope_delivery_time']);
}
break;
case 'NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_BEFOREPROCESS':
//
// 希望配送日時をコメントへ付加する
$order->info['comments'] = MODULE_CALENDAR_HOPE_DELIVERY_DAY_HEADER . ":" . $_SESSION['calendar_hope_delivery_day'] . "\n" . MODULE_CALENDAR_HOPE_DELIVERY_TIME_HEADER . ":" . $_SESSION['calendar_hope_delivery_time'] . "\n" . $order->info['comments'];
break;
case 'NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL':
$_SESSION['calendar_hope_delivery_day'] = '';
$_SESSION['calendar_hope_delivery_time'] = '';
unset($_SESSION['calendar_hope_delivery_day']);
unset($_SESSION['calendar_hope_delivery_time']);
break;
}
}
示例9: exportFinalizeInitialization
public function exportFinalizeInitialization()
{
// -----
// Check to see if any of this handler's filter variables have been set. If set, check the values and then
// update the where_clause for the to-be-issued SQL query for the export.
//
if ($_POST['orders_status'] != '0') {
$this->where_clause .= ($this->where_clause == '' ? '' : ' AND ') . 'o.orders_status = ' . (int) $_POST['orders_status'];
}
if (zen_not_null($_POST['orders_id_min']) && ctype_digit($_POST['orders_id_min'])) {
$this->where_clause .= ($this->where_clause == '' ? '' : ' AND ') . 'o.orders_id >= ' . (int) $_POST['orders_id_min'];
}
if (zen_not_null($_POST['orders_id_max']) && ctype_digit($_POST['orders_id_max'])) {
$this->where_clause .= ($this->where_clause == '' ? '' : ' AND ') . 'o.orders_id <= ' . (int) $_POST['orders_id_max'];
}
if (zen_not_null($_POST['orders_date_start'])) {
$validated_date = $this->formatValidateDate($_POST['orders_date_start']);
if ($validated_date !== false) {
$this->where_clause .= ($this->where_clause == '' ? '' : ' AND ') . "o.date_purchased >= '{$validated_date} 00:00:00'";
}
}
if (zen_not_null($_POST['orders_date_end'])) {
$validated_date = $this->formatValidateDate($_POST['orders_date_end']);
if ($validated_date !== false) {
$this->where_clause .= ($this->where_clause == '' ? '' : ' AND ') . "o.date_purchased <= '{$validated_date} 23:59:59'";
}
}
return true;
}
示例10: currency_update_quotes
function currency_update_quotes()
{
global $gBitDb;
$output = array();
if ($currencies = $gBitDb->getAssoc("SELECT `code`, `title` FROM " . TABLE_CURRENCIES)) {
foreach ($currencies as $curCode => $curTitle) {
$server_used = 'yahoo';
if (!($rate = currency_yahoo_quote($curCode))) {
$server_used = CURRENCY_SERVER_PRIMARY;
$quote_function = 'currency_' . CURRENCY_SERVER_PRIMARY . '_quote';
$rate = $quote_function($curCode);
if (empty($rate) && zen_not_null(CURRENCY_SERVER_BACKUP)) {
$output[] = sprintf(WARNING_PRIMARY_SERVER_FAILED, CURRENCY_SERVER_PRIMARY, '', $curCode);
$quote_function = 'currency_' . CURRENCY_SERVER_BACKUP . '_quote';
$quote_function = 'currency_yahoo_quote';
$rate = $quote_function($curCode);
$server_used = CURRENCY_SERVER_BACKUP;
}
}
if (!empty($rate)) {
$gBitDb->query("UPDATE " . TABLE_CURRENCIES . " SET `currency_value`=?, `last_updated` = " . $gBitDb->qtNOW() . " WHERE `code` = ?", array($rate, $curCode));
$output[$curCode] = array('result' => 'success', 'message' => sprintf(TEXT_INFO_CURRENCY_UPDATED, $curTitle, $curCode, $server_used) . ' = ' . $rate);
} else {
$output[$curCode] = array('result' => 'failure', 'message' => sprintf(ERROR_CURRENCY_INVALID, $curTitle, $curCode, $server_used));
}
}
}
return $output;
}
示例11: zen_get_countries
/**
* Returns an array with countries
*
* @param int If set limits to a single country
* @param boolean If true adds the iso codes to the array
*/
function zen_get_countries($pCountryMixed = '', $with_iso_codes = false)
{
global $gBitDb;
$ret = array();
$whereSql = '';
$bindVars = array();
if (zen_not_null($pCountryMixed)) {
if (is_numeric($pCountryMixed)) {
$whereSql = ' WHERE `countries_id` = ? ';
} else {
$pCountryMixed = strtoupper($pCountryMixed);
$whereSql = ' WHERE UPPER( `countries_name` ) = ? ';
}
$bindVars = array($pCountryMixed);
}
$countries = "SELECT *\n\t\t\t\t FROM " . TABLE_COUNTRIES . "\n\t\t\t\t {$whereSql}\n\t\t\t\t ORDER BY `countries_name`";
if ($rs = $gBitDb->query($countries, $bindVars)) {
while (!$rs->EOF) {
$row = array('countries_id' => $rs->fields['countries_id'], 'countries_name' => $rs->fields['countries_name'], 'address_format_id' => $rs->fields['address_format_id']);
if ($with_iso_codes == true) {
$row['countries_iso_code_2'] = $rs->fields['countries_iso_code_2'];
$row['countries_iso_code_3'] = $rs->fields['countries_iso_code_3'];
}
if ($rs->RecordCount() == 1) {
$ret = $row;
} else {
$ret[] = $row;
}
$rs->MoveNext();
}
}
return $ret;
}
示例12: trail
function trail($separator = ' ')
{
$trail_string = '';
for ($i = 0, $n = sizeof($this->_trail); $i < $n; $i++) {
// echo 'breadcrumb ' . $i . ' of ' . $n . ': ' . $this->_trail[$i]['title'] . '<br />';
$skip_link = false;
if ($i == $n - 1 && DISABLE_BREADCRUMB_LINKS_ON_LAST_ITEM == 'true') {
$skip_link = true;
}
if (isset($this->_trail[$i]['link']) && zen_not_null($this->_trail[$i]['link']) && !$skip_link) {
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';
} else {
$trail_string .= ' <a href="' . $this->_trail[$i]['link'] . '">' . $this->_trail[$i]['title'] . '</a>';
}
} else {
$trail_string .= $this->_trail[$i]['title'];
}
if ($i + 1 < $n) {
$trail_string .= $separator;
}
$trail_string .= "\n";
}
return $trail_string;
}
示例13: update_recent_products
function update_recent_products($products_id)
{
if ($_COOKIE['recent_viewed'] != '') {
$current_products = explode('_', $_COOKIE['recent_viewed']);
} else {
$current_products = '';
}
$new_products = array();
$new_products[] = $products_id;
$product_count = 0;
if (is_array($current_products)) {
foreach ($current_products as $product) {
if ($product != $products_id) {
if (defined('RECENT_VIEWED_PRODUCTS_MAXIMUM') && RECENT_VIEWED_PRODUCTS_MAXIMUM - 1 > $product_count || !defined('RECENT_VIEWED_PRODUCTS_MAXIMUM') || !zen_not_null(RECENT_VIEWED_PRODUCTS_MAXIMUM)) {
$product_count++;
$new_products[] = $product;
} else {
break;
}
}
}
} else {
//nothing
}
return implode('_', $new_products);
}
示例14: payment
function payment($module = '')
{
global $PHP_SELF, $language, $credit_covers, $messageStack;
if (defined('MODULE_PAYMENT_INSTALLED') && zen_not_null(MODULE_PAYMENT_INSTALLED)) {
$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
$include_modules = array();
if (zen_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) {
$this->selected_module = $module;
$include_modules[] = array('class' => $module, 'file' => $module . '.php');
} else {
reset($this->modules);
// Free Payment Only shows
if (zen_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') and ($_SESSION['cart']->show_total() == 0 and $_SESSION['shipping']['cost'] == 0)) {
$this->selected_module = $module;
if (file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . '/payment/' . 'freecharger.php')) {
$include_modules[] = array('class' => 'freecharger', 'file' => 'freecharger.php');
}
} else {
// All Other Payment Modules show
while (list(, $value) = each($this->modules)) {
// double check that the module really exists before adding to the array
if (file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . '/payment/' . $value)) {
$class = substr($value, 0, strrpos($value, '.'));
// Don't show Free Payment Module
if ($class != 'freecharger') {
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
}
}
}
for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
// include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $include_modules[$i]['file']);
$lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/', $include_modules[$i]['file'], 'false');
if (@file_exists($lang_file)) {
include_once $lang_file;
} else {
if (IS_ADMIN_FLAG === false) {
$messageStack->add(WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
} else {
$messageStack->add_session(WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
}
}
include_once DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file'];
$GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']();
}
// if there is only one payment method, select it as default because in
// checkout_confirmation.php the $payment variable is being assigned the
// $_POST['payment'] value which will be empty (no radio button selection possible)
if (zen_count_payment_modules() == 1 && (!isset($_SESSION['payment']) || isset($_SESSION['payment']) && !is_object($_SESSION['payment']))) {
if (!$credit_covers) {
$_SESSION['payment'] = $include_modules[0]['class'];
}
}
if (zen_not_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
$this->form_action_url = $GLOBALS[$module]->form_action_url;
}
}
}
示例15: is_set
function is_set($code)
{
if (isset($this->currencies[$code]) && zen_not_null($this->currencies[$code])) {
return true;
} else {
return false;
}
}