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


PHP cw_header_location函数代码示例

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


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

示例1: product_stages_add

function product_stages_add()
{
    global $new_product_stage, $REQUEST_METHOD, $product_id, $default_status;
    if ($REQUEST_METHOD == "POST") {
        $new_stage_data = array('product_id' => $product_id, 'stage_lib_id' => $new_product_stage['stage_lib_id'], 'period' => $new_product_stage['period'], 'status' => !empty($default_status['new_product_stage']) ? '-1' : (!empty($new_product_stage['status']) ? serialize($new_product_stage['status']) : ''), 'active' => !empty($new_product_stage['active']) ? 1 : 0);
        cw_array2insert('product_stages_product_settings', $new_stage_data);
        cw_header_location("index.php?target=products&mode=details&product_id={$product_id}&js_tab=product_stages");
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:9,代码来源:modify.php

示例2: cw_pages_by_url

function cw_pages_by_url($url, $check_redirect = true)
{
    global $tables;
    $page_id = cw_query_first_cell("select * from {$tables['pages']} where url='{$url}'");
    $page_data = cw_pages_get_page_content($page_id);
    if ($check_redirect && $page_data['redirect']) {
        cw_header_location($page_data['redirect'], true, false, 301);
    }
    return $page_data;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:10,代码来源:cw.pages.php

示例3: ab_redirect

function ab_redirect($product_id = 0)
{
    global $app_catalogs, $target, $mode;
    $productid_url_param = null;
    if (!empty($product_id)) {
        $product_id = (int) $product_id;
        $productid_url_param = '&product_id=' . $product_id;
    }
    cw_header_location("{$app_catalogs['admin']}/index.php?target={$target}&mode={$mode}&js_tab=cms{$productid_url_param}");
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:10,代码来源:product_modify.php

示例4: order_tracking_redirect

function order_tracking_redirect()
{
    global $smarty, $request_prepared;
    cw_load('doc');
    $order = cw_call('cw_doc_get', array($request_prepared['doc_id'], 0));
    if (empty($order) || $order['info']['tracking'] != $request_prepared['tracking']) {
        cw_header_location('index.php?target=error_message&error=access_denied&id=59');
    }
    $smarty->assign('order', $order);
    $form = cw_display('addons/shipping_system/tracking.tpl', $smarty, false);
    echo $form;
    exit;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:13,代码来源:order_tracking.php

示例5: estimate_cart

function estimate_cart()
{
    global $request_prepared;
    $user_address =& cw_session_register('user_address', array());
    // Declare session var for addresses
    $user_address['current_address']['zipcode'] = $request_prepared['zipcode'];
    $user_address['current_address']['state'] = $request_prepared['state'];
    $user_address['current_address']['country'] = $request_prepared['country'];
    if (empty($user_address['current_address']['state']) && $user_address['current_address']['country'] == 'US') {
        cw_load('map');
        $user_address['current_address']['state'] = cw_call('cw_map_get_state_by_zip', array($user_address['current_address']['zipcode']));
    }
    cw_header_location('index.php?target=cart');
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:14,代码来源:shipping_estimator.php

示例6: delete

function delete()
{
    global $posted_data, $REQUEST_METHOD, $tables;
    if ($REQUEST_METHOD == "POST") {
        foreach ($posted_data as $lib_id => $stage_data) {
            if (!$stage_data['deleted']) {
                continue;
            }
            db_query("delete from {$tables['product_stages_library']} where stage_lib_id='{$lib_id}'");
            db_query("delete from {$tables['product_stages_product_settings']} where stage_lib_id='{$lib_id}'");
        }
        cw_header_location("index.php?target=product_stages");
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:14,代码来源:product_stages.php

示例7: cw_user_delete

function cw_user_delete($params)
{
    global $var_dirs, $tables, $config;
    global $addons;
    global $smarty;
    extract($params);
    // damn extract
    //    $customer_id, $send_mail, $is_redirect = true
    $customer_id = isset($customer_id) ? $customer_id : 0;
    $send_mail = isset($send_mail) ? $send_mail : false;
    $is_redirect = isset($is_redirect) ? $is_redirect : true;
    cw_load('files', 'product', 'mail');
    $olduser_info = cw_user_get_info($customer_id, 65535);
    $to_customer = $olduser_info['language'];
    $usertype = $olduser_info['usertype'];
    if ($usertype == "A") {
        $users_count = cw_query_first_cell("SELECT COUNT(*) FROM {$tables['customers']} WHERE usertype='A'");
        if ($users_count == 1) {
            if ($is_redirect) {
                cw_header_location("index.php?target=error_message&error=last_admin");
            }
            return false;
        }
    }
    /*
    # kornev, TOFIX
    	if ($usertype == "B" && cw_query_first_cell("SELECT COUNT(*) FROM $tables[addons] WHERE addon='Salesman'") > 0) {
    		include $app_main_dir."/addons/Salesman/init.php";
    
    		db_query("delete FROM $tables[salesman_clicks] WHERE salesman_customer_id='$customer_id'");
    		db_query("delete FROM $tables[salesman_commissions] WHERE salesman_customer_id='$customer_id'");
    		db_query("delete FROM $tables[salesman_payment] WHERE salesman_customer_id='$customer_id'");
    		db_query("delete from $tables[salesman_views] WHERE salesman_customer_id='$customer_id'");
    		db_query("UPDATE $tables[customers_salesman_info] SET parent_customer_id=0 WHERE customer_id = '$customer_id' AND usertype = 'B'");
    	}
    */
    \Customer\delete($customer_id);
    $main_tables = array('register_fields_values', 'customers_ccinfo', 'customers_settings', 'customers_relations', 'customers_salesman_info', 'customers_customer_info', 'customers_warehouse_info', 'customers_system_info');
    foreach ($main_tables as $v) {
        db_query("delete from " . $tables[$v] . " where customer_id='{$customer_id}'");
    }
    $smarty->assign('userinfo', $olduser_info);
    $anonymous_user = cw_is_anonymous($olduser_info['email']);
    if (!$anonymous_user && $config['Email']['eml_profile_deleted'] == 'Y' && $send_mail) {
        cw_call('cw_send_mail', array($config['Company']['users_department'], $olduser_info['email'], 'mail/profile_deleted_subj.tpl', 'mail/profile_deleted.tpl'));
    }
    if (!$anonymous_user && $config['Email']['eml_profile_deleted_admin'] == 'Y' && $send_mail) {
        cw_call('cw_send_mail', array($olduser_info['email'], $config['Company']['users_department'], 'mail/profile_deleted_subj.tpl', 'mail/profile_admin_deleted.tpl', $config['default_admin_language']));
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:50,代码来源:cw.user.php

示例8: cw_refresh

function cw_refresh($product_id, $js_tab = '', $added = '')
{
    global $ge_id, $target;
    if (!empty($js_tab)) {
        $js_tab = "&js_tab=" . $js_tab;
    }
    if (!empty($ge_id)) {
        $redirect_ge_id = "&ge_id=" . $ge_id;
    }
    if ($product_id) {
        cw_header_location("index.php?target={$target}&mode=details&product_id=" . $product_id . $redirect_ge_id . $js_tab . $added);
    } else {
        cw_header_location("index.php?target={$target}&mode=add");
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:15,代码来源:modify.php

示例9: cw_dpi_refresh

function cw_dpi_refresh($product_id)
{
    global $app_catalogs, $target, $ge_id;
    $productid_url_param = null;
    if (!empty($product_id)) {
        $product_id = (int) $product_id;
        $productid_url_param = '&product_id=' . $product_id;
    }
    $ge_id_url_param = null;
    if (!empty($ge_id)) {
        $ge_id = (int) $ge_id;
        $ge_id_url_param = '&ge_id=' . $ge_id;
    }
    if (!empty($product_id)) {
        cw_header_location("{$app_catalogs['admin']}/index.php?target={$target}&mode=details&js_tab=dpi{$productid_url_param}{$ge_id_url_param}");
    } else {
        cw_header_location("{$app_catalogs['admin']}/index.php?target={$target}&mode=add");
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:19,代码来源:func.php

示例10: cw_fbauth_user_logout

function cw_fbauth_user_logout()
{
    global $action;
    $fb_access_token = cw_session_register('fb_access_token');
    $fb_referer = cw_session_register('fb_referer');
    $referer_url = !empty($fb_referer) ? $fb_referer : 'index.php';
    cw_session_unregister('fb_referer');
    if ($fb_access_token) {
        $graph_url = "https://graph.facebook.com/me/permissions?method=delete&access_token=" . $fb_access_token;
        $result = cw_fbauth_get_ssl_page($graph_url);
        if ($result['error']) {
            $top_message = array('type' => 'E', 'content' => $result['error']);
            cw_header_location($referer_url, TRUE);
        }
        $result = json_decode($result['result']);
        if ($result) {
            cw_session_unregister('fb_access_token');
        }
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:20,代码来源:func.fbauth.php

示例11: cw_payment_authorize_sim_run_processor

function cw_payment_authorize_sim_run_processor($params, $return)
{
    if ($params['payment_data']['processor'] == authorize_sim_addon_name) {
        global $config, $tables, $current_location, $cart, $APP_SESS_ID;
        $addon_name = str_replace("-", "_", authorize_sim_addon_name);
        $asim_api_login_id = $config[$addon_name]['asim_api_login_id'];
        $asim_transaction_key = $config[$addon_name]['asim_transaction_key'];
        $asim_md5_hash = $config[$addon_name]['asim_md5_hash'];
        $asim_mode = $config[$addon_name]['asim_test_live_mode'];
        $asim_currency = $config[$addon_name]['asim_currency'];
        $asim_prefix = intval($config[$addon_name]['asim_prefix']);
        if (empty($asim_api_login_id) || empty($asim_transaction_key)) {
            $top_message = array("content" => "Enter your merchant credentials on settings page before running the payment.", "type" => "E");
            cw_header_location($current_location . "index.php?target=cart&mode=checkout");
        }
        define("AUTHORIZENET_API_LOGIN_ID", $asim_api_login_id);
        define("AUTHORIZENET_TRANSACTION_KEY", $asim_transaction_key);
        define("AUTHORIZENET_SANDBOX", $asim_mode == "live" ? FALSE : TRUE);
        define("AUTHORIZENET_MD5_SETTING", $asim_md5_hash);
        $payment_data = $params['payment_data'];
        $userinfo = $params['userinfo'];
        $doc_ids = $params['doc_ids'];
        $cart =& cw_session_register('cart');
        $time = time();
        $asim_amount = price_format($cart['info']['total']);
        $asim_fp_sequence = $asim_prefix . $time;
        $asim_fp_hash = AuthorizeNetDPM::getFingerprint($asim_api_login_id, $asim_transaction_key, $asim_amount, $asim_fp_sequence, $time);
        $asim_fp_timestamp = $time;
        $asim_relay_url = $current_location . '/index.php?target=' . authorize_sim_addon_target;
        // save $APP_SESS_ID
        $unique_id = strtolower(md5($asim_md5_hash . $asim_api_login_id . $userinfo['email']));
        db_query("INSERT INTO {$tables['payment_data']} (ref_id, session_id) VALUES ('{$unique_id}', '{$APP_SESS_ID}')");
        $card_expire_Month = intval($_POST['card_expire_Month']);
        $card_expire_Year = intval($_POST['card_expire_Year']);
        cw_func_call('cw_payment_create_form', array('url' => AUTHORIZENET_SANDBOX ? AuthorizeNetDPM::SANDBOX_URL : AuthorizeNetDPM::LIVE_URL, 'fields' => array('x_relay_response' => "FALSE", 'x_version' => "3.1", 'x_delim_char' => ",", 'x_delim_data' => "TRUE", 'x_amount' => $asim_amount, 'x_fp_sequence' => $asim_fp_sequence, 'x_fp_hash' => $asim_fp_hash, 'x_fp_timestamp' => $time, 'x_relay_response' => "TRUE", 'x_relay_url' => $asim_relay_url, 'x_login' => $asim_api_login_id, 'x_card_num' => $_POST['card_number'], 'x_exp_date' => date("m/y", mktime(0, 0, 0, $card_expire_Month, 1, $card_expire_Year)), 'x_card_code' => $_POST['card_cvv2'], 'x_first_name' => $_POST['first_name'], 'x_last_name' => $_POST['last_name'], 'x_address' => $_POST['address'], 'x_city' => $_POST['city'], 'x_state' => $_POST['state'], 'x_zip' => $_POST['zipcode'], 'x_country' => $_POST['country'], 'x_email' => $userinfo['email']), 'name' => $payment_data['title']));
        exit;
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:39,代码来源:func.php

示例12: cw_header_location

<?php

// TODO: DELETE THIS CONTROLLER
if (!$addons['Gift_Registry']) {
    cw_header_location('index.php');
}
$access_status =& cw_session_register("access_status", array());
if ($mode == "preview") {
    $html_content = cw_query_first_cell("SELECT html_content FROM {$tables['giftreg_events']} WHERE event_id='{$eventid}'");
    if (!empty($html_content)) {
        echo $html_content;
    } else {
        echo "<br /><br /><br /><br /><h3 align=\"center\">" . cw_get_langvar_by_name("lbl_no_html_content", false, false, true) . "</h3>";
    }
    exit;
}
if (!empty($cc)) {
    # Confirm/Decline the participation by recipient
    # $cc - is a confirmation code passed via GET request
    cw_include('addons/Gift_Registry/giftreg_confirm.php');
}
if (!empty($eventid)) {
    if (!empty($wlid)) {
        if (cw_query_first_cell("SELECT event_id FROM {$tables['wishlist']} WHERE wishlist_id='{$wild}'") == $eventid) {
            $wlid_eventid =& cw_session_register("wlid_eventid");
            $wlid_eventid = $eventid;
            cw_session_save("wlid_eventid");
        }
    }
    cw_include('addons/Gift_Registry/event_guestbook.php');
    cw_include('addons/Gift_Registry/giftreg_display.php');
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:31,代码来源:giftregs.php

示例13: cw_profile_fields_add_section

            if ($v['name']) {
                cw_profile_fields_add_section($v);
            }
        } else {
            cw_profile_fields_update_section($k, $v);
        }
    }
    cw_header_location("index.php?target={$target}&mode=fields&js_tab=addition_section");
}
if ($action == 'delete_sections') {
    foreach ($update as $k => $v) {
        if ($v['del'] == 'Y') {
            cw_profile_fields_delete_section($k);
        }
    }
    cw_header_location("index.php?target={$target}&mode=fields&js_tab=addition_section");
}
$membership_titles = array();
$usertypes_array = array();
$usertypes_array[$user_type] = '';
if (in_array($user_type, array('C'))) {
    $customer_memberships = cw_user_get_memberships($user_type);
    if (is_array($customer_memberships)) {
        foreach ($customer_memberships as $val) {
            $usertypes_array[$user_type . '_' . $val['membership_id']] = '';
            $membership_titles[$user_type . '_' . $val['membership_id']] = $val['membership'];
        }
    }
}
$smarty->assign('membership_titles', $membership_titles);
$smarty->assign('customer_memberships', $customer_memberships);
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:31,代码来源:user_profiles.php

示例14: cw_header_location

<?php

if (cw_query_first_cell("SELECT COUNT(*) FROM {$tables['categories']} WHERE category_id='{$cat}'") == 0) {
    cw_header_location('index.php?target=categories');
}
$category_page =& cw_session_register('category_page');
$data = array();
$data['flat_search'] = 1;
$data['category_id'] = $cat;
$data['category_main'] = "Y";
$data['category_extra'] = "Y";
$data['page'] = $page;
$data['objects_per_page'] = $category_page['objects_per_page'];
$data['sort_field'] = $category_page['sort_field'];
$data['sort_direction'] = $category_page['sort_direction'];
list($products, $navigation) = cw_func_call('cw_product_search', array('data' => $data, 'user_account' => $user_account, 'current_area' => $current_area, 'info_type' => 0));
$navigation['script'] = 'index.php?target=' . $target . '&mode=' . $mode . '&cat=' . $cat;
$smarty->assign('navigation', $navigation);
$smarty->assign('products', $products);
$smarty->assign('current_category', cw_func_call('cw_category_get', array('cat' => $cat)));
$smarty->assign('main', 'category_products');
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:21,代码来源:products.php

示例15: cw_header_location

        $nwslt_object['fill_error'] = $fill_error;
        $nwslt_object['list'] = $list;
        cw_header_location("index.php?target={$target}&list_id=" . $list['list_id']);
    }
    cw_header_location("index.php?target={$target}&list_id=" . $list['list_id']);
}
$location[] = array(cw_get_langvar_by_name('lbl_news_management'), 'index.php?target=' . $target);
if (isset($_GET['list_id'])) {
    if (!empty($list_id)) {
        $list = cw_query_first("select * from {$tables['newslists']} WHERE list_id='{$list_id}'");
        if (empty($list['list_id'])) {
            $top_message['content'] = cw_get_langvar_by_name('msg_adm_err_newslist_not_exists');
            cw_header_location('index.php?target=' . $target);
        } else {
            if ($list['lngcode'] != $current_language && is_array($d_langs) && !in_array($list['lngcode'], $d_langs)) {
                cw_header_location("index.php?target={$target}&mode=modify&list_id={$list_id}&edit_lng={$list['lngcode']}&old_lng={$current_language}");
            }
        }
        $memberships = cw_query("select membership_id from {$tables['newslists_memberships']} where list_id='{$list['list_id']}'");
        if ($memberships) {
            foreach ($memberships as $val) {
                $list['memberships'][$val['membership_id']] = true;
            }
        }
        $list_idname = cw_query_first_cell("SELECT name FROM {$tables['newslists']} WHERE list_id='{$list_id}'");
        $smarty->assign('list_idname', $list_idname);
        $smarty->assign('list_id', $list_id);
        $smarty->assign('list', $list);
        # subscribers tabs
        $total_items = count($subscribers = cw_call('cw\\news\\get_subscribers', array($list_id)));
        if (!empty($total_items)) {
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:31,代码来源:news.php


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