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


PHP fn_get_statuses函数代码示例

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


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

示例1: apiUpdateOrder

 public static function apiUpdateOrder($order, $response)
 {
     if (!defined('ORDER_MANAGEMENT')) {
         define('ORDER_MANAGEMENT', true);
     }
     if (!empty($order['status'])) {
         $statuses = fn_get_statuses(STATUSES_ORDER, false, true);
         if (!isset($statuses[$order['status']])) {
             $response->addError('ERROR_OBJECT_UPDATE', str_replace('[object]', 'orders', __('twgadmin_wrong_api_object_data')));
         } else {
             fn_change_order_status($order['order_id'], $order['status']);
         }
     }
     $cart = array();
     fn_clear_cart($cart, true);
     $customer_auth = fn_fill_auth(array(), array(), false, 'C');
     fn_form_cart($order['order_id'], $cart, $customer_auth);
     $cart['order_id'] = $order['order_id'];
     // update only profile data
     $profile_data = fn_check_table_fields($order, 'user_profiles');
     $cart['user_data'] = fn_array_merge($cart['user_data'], $profile_data);
     $cart['user_data'] = fn_array_merge($cart['user_data'], $order);
     fn_calculate_cart_content($cart, $customer_auth, 'A', true, 'I');
     if (!empty($order['details'])) {
         db_query('UPDATE ?:orders SET details = ?s WHERE order_id = ?i', $order['details'], $order['order_id']);
     }
     if (!empty($order['notes'])) {
         $cart['notes'] = $order['notes'];
     }
     fn_update_payment_surcharge($cart, $customer_auth);
     list($order_id, $process_payment) = fn_place_order($cart, $customer_auth, 'save');
     return array($order_id, $process_payment);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:33,代码来源:TwigmoOrder.php

示例2: fn_google_analytics_change_order_status

function fn_google_analytics_change_order_status(&$status_to, &$status_from, &$order_info)
{
    if (Registry::get('addons.google_analytics.track_ecommerce') == 'N' || AREA != 'A') {
        return false;
    }
    $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true, true);
    if ($order_statuses[$status_to]['params']['inventory'] == 'D' && $order_statuses[$status_from]['params']['inventory'] == 'I') {
        // decrease amount
        fn_google_anaylitics_send(fn_google_analytics_get_tracking_code($order_info['company_id']), $order_info, false);
    } elseif ($order_statuses[$status_to]['params']['inventory'] == 'I' && $order_statuses[$status_from]['params']['inventory'] == 'D') {
        // increase amount
        fn_google_anaylitics_send(fn_google_analytics_get_tracking_code($order_info['company_id']), $order_info, true);
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:14,代码来源:func.php

示例3: fn_google_analytics_change_order_status

function fn_google_analytics_change_order_status($status_to, $status_from, $order_info)
{
    if (Registry::get('addons.google_analytics.track_ecommerce') == 'N') {
        return false;
    }
    $order_statuses = fn_get_statuses(STATUSES_ORDER, false, true, true);
    if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
        // decrease amount
        fn_google_anaylitics_send(Registry::get('addons.google_analytics.tracking_code'), $order_info, false);
    } elseif ($order_statuses[$status_to]['inventory'] == 'I' && $order_statuses[$status_from]['inventory'] == 'D') {
        // increase amount
        fn_google_anaylitics_send(Registry::get('addons.google_analytics.tracking_code'), $order_info, true);
    }
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:14,代码来源:func.php

示例4: index

 public function index($id = '', $params = array())
 {
     $lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
     $type = !empty($params['type']) ? $params['type'] : STATUSES_ORDER;
     if (!empty($id)) {
         $data = fn_get_status_by_id($id, $lang_code);
         if (empty($data)) {
             $status = Response::STATUS_NOT_FOUND;
         } else {
             $status = Response::STATUS_OK;
         }
     } else {
         $items_per_page = $this->safeGet($params, 'items_per_page', Registry::get('settings.Appearance.admin_elements_per_page'));
         $page = $this->safeGet($params, 'page', 1);
         $data = fn_get_statuses($type, array(), false, false, $lang_code);
         $data = array_values($data);
         if ($items_per_page) {
             $data = array_slice($data, ($page - 1) * $items_per_page, $items_per_page);
         }
         $data = array('statuses' => $data, 'params' => array('items_per_page' => $items_per_page, 'page' => $page, 'total_items' => count($data)));
         $status = Response::STATUS_OK;
     }
     return array('status' => $status, 'data' => $data);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:24,代码来源:Statuses.php

示例5: fn_settings_variants_addons_rus_unisender_order_status_sms

function fn_settings_variants_addons_rus_unisender_order_status_sms()
{
    $lists = array();
    $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true, true);
    foreach ($order_statuses as $key => $value) {
        $lists[$key] = $value['description'];
    }
    return $lists;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:9,代码来源:func.php

示例6: getOrderSectionsInfo

 public final function getOrderSectionsInfo($date_periods, $total_periods, $orders, $sort_by, $sort_order)
 {
     $order_sections = array();
     $section_names = array();
     $order_totals = array();
     $show_empty_sections = false;
     if ($sort_by == 'date') {
         $last_date = min($date_periods);
         foreach (array_keys($date_periods) as $period_id) {
             $section_names[$period_id] = self::getOrderPeriodName($period_id);
         }
         foreach ($orders as $order) {
             $selected_period_id = '';
             if ($order['timestamp'] > TIME) {
                 $selected_period_id = 'future';
             } elseif ($order['timestamp'] < $last_date) {
                 $selected_period_id = 'past';
             } else {
                 foreach ($date_periods as $period_id => $start_date) {
                     if ($order['timestamp'] > $start_date) {
                         $selected_period_id = $period_id;
                         break;
                     }
                 }
             }
             if ($selected_period_id != '') {
                 $order_sections[$selected_period_id][] = $order;
                 $order_totals[$selected_period_id] = isset($order_totals[$selected_period_id]) ? $order_totals[$selected_period_id] + $order['total'] : $order['total'];
             }
         }
         if (isset($order_sections['future'])) {
             $section_names = array('future' => self::getOrderPeriodName('future')) + $section_names;
         }
         if (isset($order_sections['past'])) {
             $section_names['past'] = self::getOrderPeriodName('more_than_year');
         }
         if ($sort_order == 'asc') {
             $section_names = array_reverse($section_names, true);
         }
         $show_empty_sections = true;
     } elseif ($sort_by == 'status') {
         $section_names = fn_get_statuses(STATUSES_ORDER, true);
         ksort($section_names);
         if ($sort_order == 'desc') {
             $section_names = array_reverse($section_names);
         }
         foreach ($orders as $order) {
             $selected_period_id = $order['status'];
             $order_sections[$selected_period_id][] = $order;
             $order_totals[$selected_period_id] = isset($order_totals[$selected_period_id]) ? $order_totals[$selected_period_id] + $order['total'] : $order['total'];
         }
         $show_empty_sections = true;
     } elseif ($sort_by == 'total') {
         $min_total = min($total_periods);
         $section_names = array();
         foreach ($total_periods as $subtotal) {
             $section_names['more_' . $subtotal] = __('more_than') . ' ' . fn_format_price($subtotal);
         }
         $section_names['less'] = __('less_than') . ' ' . fn_format_price($min_total);
         reset($total_periods);
         foreach ($orders as $order) {
             if ($order['total'] < $min_total) {
                 $selected_period_id = 'less';
             } else {
                 foreach ($total_periods as $subtotal) {
                     if ($order['total'] > $subtotal) {
                         $selected_period_id = 'more_' . $subtotal;
                         break;
                     }
                 }
             }
             if ($selected_period_id) {
                 $order_sections[$selected_period_id][] = $order;
                 $order_totals[$selected_period_id] = isset($order_totals[$selected_period_id]) ? $order_totals[$selected_period_id] + $order['total'] : $order['total'];
             }
         }
         if ($sort_order == 'asc') {
             $section_names = array_reverse($section_names);
         }
     }
     return array($order_sections, $section_names, $order_totals, $show_empty_sections);
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:82,代码来源:OrderMethods.php

示例7: fn_promotion_check_existence

/**
 * Check if the promotion is already used by customer.
 *
 * @param int $promotion_id
 * @param array $cart
 * @return int|bool
 */
function fn_promotion_check_existence($promotion_id, &$cart)
{
    static $statuses = null;
    if (is_null($statuses)) {
        $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), true);
        foreach ($order_statuses as $status) {
            if ($status['params']['inventory'] == 'D') {
                // decreasing (positive) status
                $statuses[] = $status['status'];
            }
        }
    }
    if (!$statuses) {
        return false;
    }
    $udata = $cart['user_data'];
    fn_fill_user_fields($udata);
    if (defined('ORDER_MANAGEMENT') && !empty($cart['order_id'])) {
        $order_management_condition = db_quote(' order_id != ?i AND ', $cart['order_id']);
    } else {
        $order_management_condition = '';
    }
    $exists = db_get_field("SELECT ((firstname = ?s) + (lastname = ?s) + (b_city = ?s) + (b_state = ?s) + (b_country = ?s) + (b_zipcode = ?s) + (email = ?s) * 6) as r FROM ?:orders WHERE ?p FIND_IN_SET(?i, promotion_ids) AND status IN (?a) HAVING r >= ?i LIMIT 1", $udata['firstname'], $udata['lastname'], $udata['b_city'], $udata['b_state'], $udata['b_country'], $udata['b_zipcode'], $udata['email'], $order_management_condition, $promotion_id, $statuses, PROMOTION_MIN_MATCHES);
    return $exists;
}
开发者ID:askzap,项目名称:ultimate,代码行数:32,代码来源:fn.promotions.php

示例8: array

        }
        $response->returnResponse();
    }
}
if ($mode == 'post') {
    if ($_REQUEST['action'] == 'get') {
        $object_name = '';
        $condition = array();
        $options = array('lang_code' => $lang_code);
        $sortings = array();
        $result = array();
        $is_paginate = false;
        $total_items = 0;
        $items_per_page = !empty($_REQUEST['items_per_page']) ? $_REQUEST['items_per_page'] : TWG_RESPONSE_ITEMS_LIMIT;
        if ($object == 'statuses') {
            $order_statuses = fn_get_statuses(STATUSES_ORDER, array(), false, false, $lang_code);
            $api_statuses = array();
            foreach ($order_statuses as $k => $v) {
                $status = array('code' => $k, 'description' => $v['description'], 'color' => '#28ABF6');
                if ($k == 'C' || $k == 'P') {
                    $status['color'] = '#97CF4D';
                } elseif ($k == 'D' || $k == 'F') {
                    $status['color'] = '#FF5215';
                } elseif ($k == 'I') {
                    $status['color'] = '#D2D2D2';
                } elseif ($k == 'O') {
                    $status['color'] = '#FF9522';
                }
                $api_statuses[] = $status;
            }
            $result['orders']['status'] = $api_statuses;
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:twigmo.php

示例9: fn_settings_variants_addons_call_requests_order_status

function fn_settings_variants_addons_call_requests_order_status()
{
    $data = array('' => ' -- ');
    foreach (fn_get_statuses(STATUSES_ORDER) as $status) {
        $data[$status['status']] = $status['description'];
    }
    return $data;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:8,代码来源:func.php

示例10: fn_get_status_data

/**
 * Gets full information about a particular status
 * @param string $status One letter status code
 * @param string $type One letter status type
 * @param int $object_id Recurring billing: ID of an object to be checked for subscriptions
 * @param string $lang_code Language code
 * @param int $company_id Company identifier
 * @return array Status data
 */
function fn_get_status_data($status, $type, $object_id = 0, $lang_code = DESCR_SL, $company_id = 0)
{
    fn_set_hook('get_status_data_pre', $status, $type, $object_id, $lang_code, $company_id);
    if (empty($status) || empty($type)) {
        return array();
    }
    $status_data = fn_get_statuses($type, !is_array($status) ? (array) $status : $status, false, false, $lang_code, $company_id);
    $status_data = reset($status_data);
    fn_set_hook('get_status_data_post', $status_data, $status, $type, $object_id, $lang_code, $company_id);
    return $status_data;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:20,代码来源:fn.common.php

示例11: fn_delete_call_request

                fn_delete_call_request($request_id);
            }
        }
    }
    if ($mode == 'delete') {
        if ($_REQUEST['request_id']) {
            fn_delete_call_request($_REQUEST['request_id']);
        }
    }
    if ($mode == 'update_status') {
        if (!empty($_REQUEST['id']) && !empty($_REQUEST['status'])) {
            db_query("UPDATE ?:call_requests SET status = ?s WHERE request_id = ?i", $_REQUEST['status'], $_REQUEST['id']);
            fn_set_notification('N', __('notice'), __('status_changed'));
        }
        if (empty($_REQUEST['return_url'])) {
            exit;
        } else {
            return array(CONTROLLER_STATUS_REDIRECT, $_REQUEST['return_url']);
        }
    }
    return array(CONTROLLER_STATUS_OK, 'call_requests.manage');
}
if ($mode == 'manage') {
    $params = array_merge(array('items_per_page' => Registry::get('settings.Appearance.admin_elements_per_page')), $_REQUEST);
    $params['company_id'] = Registry::get('runtime.company_id');
    list($call_requests, $search) = fn_get_call_requests($params, DESCR_SL);
    $statuses = db_get_list_elements('call_requests', 'status', true, DESCR_SL, 'call_requests.status.');
    $order_statuses = fn_get_statuses(STATUSES_ORDER);
    $responsibles = fn_call_requests_get_responsibles();
    Tygh::$app['view']->assign('call_requests', $call_requests)->assign('search', $search)->assign('call_request_statuses', $statuses)->assign('order_statuses', $order_statuses)->assign('responsibles', $responsibles);
}
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:call_requests.php

示例12: fn_gift_registry_change_order_status

function fn_gift_registry_change_order_status($status_to, $status_from, &$order_info)
{
    $order_statuses = fn_get_statuses(STATUSES_ORDER, false, true);
    if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
        // decrease amount
        $sign = '+';
    } elseif ($order_statuses[$status_to]['inventory'] == 'I' && $order_statuses[$status_from]['inventory'] == 'D') {
        // increase amount
        $sign = '-';
    }
    if (!empty($sign)) {
        foreach ($order_info['items'] as $v) {
            if (is_array($v['extra']) && !empty($v['extra']['events'])) {
                foreach ($v['extra']['events'] as $item_id => $amount) {
                    db_query("UPDATE ?:giftreg_event_products SET ordered_amount = ordered_amount {$sign} ?i WHERE item_id = ?i", $amount, $item_id);
                }
            }
        }
    }
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:20,代码来源:func.php

示例13: fn_order_notification

/**
 * Send order notification
 *
 * @param array $order_info order information
 * @param array $edp_data information about downloadable products
 * @param mixed $force_notification user notification flag (true/false), if not set, will be retrieved from status parameters
 * @return array structured data
 */
function fn_order_notification(&$order_info, $edp_data = array(), $force_notification = array())
{
    static $notified = array();
    if (!empty($notified[$order_info['order_id']][$order_info['status']]) && $notified[$order_info['order_id']][$order_info['status']] || $order_info['status'] == STATUS_INCOMPLETED_ORDER || $order_info['status'] == STATUS_PARENT_ORDER) {
        return true;
    }
    if (!is_array($force_notification)) {
        $force_notification = fn_get_notification_rules($force_notification, !$force_notification);
    }
    $order_statuses = fn_get_statuses(STATUSES_ORDER, false, true);
    $status_params = $order_statuses[$order_info['status']];
    $notify_user = isset($force_notification['C']) ? $force_notification['C'] : (!empty($status_params['notify']) && $status_params['notify'] == 'Y' ? true : false);
    $notify_department = isset($force_notification['A']) ? $force_notification['A'] : (!empty($status_params['notify_department']) && $status_params['notify_department'] == 'Y' ? true : false);
    if ($notify_user == true || $notify_department == true) {
        $notified[$order_info['order_id']][$order_info['status']] = true;
        Registry::get('view_mail')->assign('order_info', $order_info);
        Registry::get('view_mail')->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $order_info['lang_code']));
        Registry::get('view_mail')->assign('status_settings', $order_statuses[$order_info['status']]);
        $companies =& Registry::get('s_companies');
        Registry::get('view_mail')->assign('companies', $companies);
        // restore secondary currency
        if (!empty($order_info['secondary_currency']) && Registry::get("currencies.{$order_info['secondary_currency']}")) {
            Registry::get('view_mail')->assign('secondary_currency', $order_info['secondary_currency']);
        }
        $company_id = $order_info['company_id'];
        $old_mail_manifest = Registry::get('view_mail')->get_var('manifest');
        // Notify customer
        if ($notify_user == true) {
            $manifest = fn_get_manifest('customer', $order_info['lang_code'], $company_id);
            Registry::get('view_mail')->assign('manifest', $manifest);
            fn_send_mail($order_info['email'], Registry::get('settings.Company.company_newsletter_email'), 'orders/order_notification_subj.tpl', 'orders/order_notification.tpl', '', $order_info['lang_code']);
            //		fn_send_mail('diedsmiling@gmail.com', Registry::get('settings.Company.company_orders_department'), 'orders/order_notification_subj.tpl', 'orders/order_notification.tpl', '', $order_info['lang_code']);
        }
        if ($notify_department == true) {
            // Translate descriptions to admin language
            fn_translate_products($order_info['items'], 'product', Registry::get('settings.Appearance.admin_default_language'));
            Registry::get('view_mail')->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], Registry::get('settings.Appearance.admin_default_language')));
            $company_email = !empty($companies[$company_id]['email']) ? $companies[$company_id]['email'] : Registry::get('settings.Company.company_orders_department');
            $lang_code = Registry::get('settings.Appearance.admin_default_language');
            $manifest = fn_get_manifest('customer', $lang_code, $company_id);
            Registry::get('view_mail')->assign('manifest', $manifest);
            fn_send_mail($company_email, Registry::get('settings.Company.company_orders_department'), 'orders/order_notification_subj.tpl', 'orders/order_notification.tpl', '', $lang_code, $order_info['email']);
            if (Registry::get('settings.Suppliers.notify_order_department') == 'Y') {
                Registry::get('view_mail')->assign('manifest', $old_mail_manifest);
                fn_send_mail(Registry::get('settings.Company.company_orders_department'), Registry::get('settings.Company.company_orders_department'), 'orders/order_notification_subj.tpl', 'orders/order_notification.tpl', '', $lang_code, $order_info['email']);
            }
        }
        Registry::get('view_mail')->assign('manifest', $old_mail_manifest);
        if (!empty($edp_data) && $notify_user == true) {
            Registry::get('view_mail')->assign('edp_data', $edp_data);
            fn_send_mail($order_info['email'], Registry::get('settings.Company.company_orders_department'), 'orders/edp_access_subj.tpl', 'orders/edp_access.tpl', '', $order_info['lang_code']);
        }
    }
    if (!empty($edp_data) && !$notify_user) {
        // Send out download links for EDP with "Immediately" Activation mode
        // TRUE if the EDP download links e-mail has already been sent. Used to avoid sending duplicate e-mails.
        $download_email_sent = false;
        foreach ($edp_data as $edp_item) {
            foreach ($edp_item['files'] as $file) {
                if (!empty($file['activation']) && $file['activation'] == 'I' && !$download_email_sent) {
                    Registry::get('view_mail')->assign('edp_data', $edp_data);
                    Registry::get('view_mail')->assign('order_info', $order_info);
                    fn_send_mail($order_info['email'], Registry::get('settings.Company.company_orders_department'), 'orders/edp_access_subj.tpl', 'orders/edp_access.tpl', '', $order_info['lang_code']);
                    $download_email_sent = true;
                    break;
                }
            }
        }
    }
    if (PRODUCT_TYPE == 'PROFESSIONAL') {
        fn_companies_suppliers_order_notification($order_info, $order_statuses, $force_notification);
    }
    fn_set_hook('order_notification', $order_info, $order_statuses, $force_notification);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:82,代码来源:fn.cart.php

示例14: foreach

     }
     // Update file downloads section
     if (!empty($_REQUEST['edp_downloads'])) {
         foreach ($_REQUEST['edp_downloads'] as $ekey => $v) {
             foreach ($v as $file_id => $downloads) {
                 $max_downloads = db_get_field("SELECT max_downloads FROM ?:product_files WHERE file_id = ?i", $file_id);
                 if (!empty($max_downloads)) {
                     db_query('UPDATE ?:product_file_ekeys SET ?u WHERE ekey = ?s', array('downloads' => $max_downloads - $downloads), $ekey);
                 }
             }
         }
     }
     $suffix = ".details?order_id={$_REQUEST['order_id']}";
 }
 if ($mode == 'bulk_print' && !empty($_REQUEST['order_ids'])) {
     $view_mail->assign('order_status_descr', fn_get_statuses(STATUSES_ORDER, true, true, true));
     $html = array();
     foreach ($_REQUEST['order_ids'] as $k => $v) {
         $view_mail->assign('order_info', fn_get_order_info($v));
         if (DISPATCH_EXTRA == 'pdf') {
             $html[] = $view_mail->display('orders/print_invoice.tpl', false);
         } else {
             $view_mail->display('orders/print_invoice.tpl');
             echo "<div style='page-break-before: always;'>&nbsp;</div>";
         }
     }
     if (DISPATCH_EXTRA == 'pdf') {
         fn_html_to_pdf($html, fn_get_lang_var('invoices') . '-' . implode('-', $_REQUEST['order_ids']));
     }
     exit;
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:orders.php

示例15: fn_yandex_market_get_order_statuses_for_setting

function fn_yandex_market_get_order_statuses_for_setting()
{
    static $data;
    if (empty($data)) {
        $data = array('' => ' -- ');
        foreach (fn_get_statuses(STATUSES_ORDER) as $status) {
            $data[$status['status']] = $status['description'];
        }
    }
    return $data;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:11,代码来源:func.php


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