本文整理汇总了PHP中fn_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_redirect函数的具体用法?PHP fn_redirect怎么用?PHP fn_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_redirect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: authPage
public function authPage($page)
{
$access_id = self::getAccessID('A');
$data = array('page' => $page, 'ttl' => self::TWIGMO_SERVER_TTL, 'customer_access_id' => self::getAccessID('C'), 'access_id' => $access_id);
$meta = array('access_id' => $access_id);
$response = $this->send('auth.token', $data, $meta);
if (!$this->responseIsOk($response)) {
die(str_replace(array('[linkOpen]', '[linkClose]'), array('<a href="' . fn_url('addons.update&addon=twigmo') . '">', '</a>'), $this->_getLangVar('twgadmin_no_token_recieved')));
}
$url = fn_link_attach($response['data']['url'], 'sl=' . strtolower(CART_LANGUAGE));
fn_redirect($url, true);
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:12,代码来源:TwigmoConnector.php
示例2: die
****************************************************************************/
//
// $Id: thaiepay.php 10080 2010-07-15 13:04:18Z klerik $
//
if (!defined('AREA')) {
die('Access denied');
}
if (defined('PAYMENT_NOTIFICATION')) {
if (empty($_REQUEST['refno'])) {
if (!empty($_SESSION['thaiepay_refno'])) {
$_REQUEST['refno'] = $_SESSION['thaiepay_refno'];
unset($_SESSION['thaiepay_refno']);
} else {
if ($mode == 'finish') {
$prefix = Registry::get('settings.General.secure_auth') == 'Y' && AREA == 'C' ? Registry::get('config.https_location') . '/' : '';
fn_redirect($prefix . INDEX_SCRIPT . "?dispatch=orders.search", true);
}
exit;
}
}
$order_id = intval($_REQUEST['refno']);
if (fn_check_payment_script('thaiepay.php', $order_id, $processor_data)) {
if ($mode == 'notify') {
$errors = array();
$errors_desc = array('additional_parameter' => fn_get_lang_var('additional_parameter_not_correct'), 'total' => fn_get_lang_var('order_total_not_correct'));
if (isset($_REQUEST['total'])) {
$order_info = fn_get_order_info($order_id);
if (fn_format_price($order_info['total']) != fn_format_price($_REQUEST['total'])) {
$errors['total'] = true;
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:thaiepay.php
示例3: actionNextStep
/**
* Setup next_step action
*
* @param array $cart_settings Cart settings
* @param array $database_settings Database settings
* @param array $server_settings Server settings
* @return bool Always true
*/
public function actionNextStep($cart_settings, $database_settings, $server_settings)
{
$app = App::instance();
$validator = new Validator();
if ($validator->validateAll(array_merge($cart_settings, $server_settings, $database_settings))) {
fn_set_progress('parts', 14);
set_time_limit(0);
if ($app->connectToDB($database_settings['host'], $database_settings['name'], $database_settings['user'], $database_settings['password'], $database_settings['table_prefix'], $database_settings['database_backend'])) {
$app->setToStorage('database_settings', $database_settings);
define('CART_LANGUAGE', $cart_settings['main_language']);
define('DESCR_SL', $cart_settings['main_language']);
define('CART_SECONDARY_CURRENCY', 'NULL');
// Need for cache_level
$sCart = new Setup($cart_settings, $server_settings, $database_settings, $this->isDemoInstall($cart_settings));
$sAddons = new AddonsSetup();
/* Setup Scheme */
fn_set_progress('title', $app->t('setup_scheme'));
fn_set_progress('echo', $app->t('processing'), true);
fn_set_progress('step_scale', 2000);
$sCart->setupScheme();
/* Setup Scheme Data */
fn_set_progress('step_scale', 1);
fn_set_progress('title', $app->t('setup_data'));
fn_set_progress('echo', $app->t('processing'), true);
fn_set_progress('step_scale', 5000);
$sCart->setupData();
$sCart->setSimpleMode();
/* Setup Demo */
if ($this->isDemoInstall($cart_settings)) {
fn_set_progress('step_scale', 1);
fn_set_progress('title', $app->t('setup_demo'));
fn_set_progress('echo', $app->t('installing_demo_catalog'), true);
fn_set_progress('step_scale', 5000);
$sCart->setupDemo();
} else {
fn_set_progress('step_scale', 1);
fn_set_progress('echo', $app->t('cleaning'), true);
$sCart->clean();
}
$sCart->setupUsers();
/* Setup companies */
fn_set_progress('step_scale', 1);
fn_set_progress('title', $app->t('setup_companies'));
fn_set_progress('echo', $app->t('processing'), true);
$sCart->setupCompanies();
/* Setup Languages */
fn_set_progress('step_scale', 1);
fn_set_progress('title', $app->t('setup_languages'));
fn_set_progress('echo', $app->t('processing'), true);
fn_set_progress('step_scale', 1000);
$sCart->setupLanguages($this->isDemoInstall($cart_settings));
$sCart->setupThemes();
/* Setup Add-ons */
fn_set_progress('title', $app->t('setup_addons'));
fn_set_progress('echo', $app->t('processing'), true);
fn_set_progress('step_scale', 100);
$sAddons->setup($this->isDemoInstall($cart_settings), array());
/* Write config */
fn_set_progress('step_scale', 1);
fn_set_progress('echo', $app->t('writing_config'), true);
$sCart->writeConfig();
$this->_prepareHttpData();
$redirect_url = Registry::get('config.http_location') . '/install/index.php?dispatch=setup.complete';
if (Registry::get('runtime.comet')) {
Registry::get('ajax')->assign('force_redirection', $redirect_url);
} else {
fn_redirect($redirect_url);
}
exit;
}
} else {
if (Registry::get('runtime.comet')) {
exit;
} else {
$params['dispatch'] = 'setup.index';
$params['cart_settings'] = $cart_settings;
$params['database_settings'] = $database_settings;
$params['server_settings'] = $server_settings;
$app->run($params);
}
}
return true;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:91,代码来源:SetupController.php
示例4: fn_reward_points_change_order_status
function fn_reward_points_change_order_status($status_to, $status_from, &$order_info, $force_notification, $order_statuses, $place_order = false)
{
static $log_id;
if (isset($order_info['deleted_order'])) {
if (!empty($log_id)) {
$log_item = array('action' => CHANGE_DUE_ORDER_DELETE);
db_query("UPDATE ?:reward_point_changes SET ?u WHERE change_id = ?i", $log_item, $log_id);
}
return true;
}
$points_info = isset($order_info['points_info']) ? $order_info['points_info'] : array();
if (!empty($points_info)) {
$reason = array('order_id' => $order_info['order_id'], 'to' => $status_to, 'from' => $status_from);
$action = empty($place_order) ? CHANGE_DUE_ORDER : CHANGE_DUE_ORDER_PLACE;
if ($order_statuses[$status_to]['inventory'] == 'I' && $order_statuses[$status_from]['inventory'] == 'D') {
if (!empty($points_info['in_use']['points'])) {
// increase points in use
$log_id = fn_change_user_points($points_info['in_use']['points'], $order_info['user_id'], serialize(fn_array_merge($reason, array('text' => 'text_increase_points_in_use'))), $action);
}
if ($points_info['is_gain'] == 'Y' && !empty($points_info['reward'])) {
// decrease earned points
$log_id = fn_change_user_points(-$points_info['reward'], $order_info['user_id'], serialize($reason), $action);
db_query("DELETE FROM ?:order_data WHERE order_id = ?i AND type = ?s", $order_info['order_id'], ORDER_DATA_POINTS_GAIN);
}
}
if ($order_statuses[$status_to]['inventory'] == 'D' && $order_statuses[$status_from]['inventory'] == 'I') {
if (!empty($points_info['in_use']['points'])) {
// decrease points in use
if ($points_info['in_use']['points'] > fn_get_user_additional_data(POINTS, $order_info['user_id'])) {
fn_set_notification('N', fn_get_lang_var('warning'), fn_get_lang_var('text_order_status_has_not_been_changed'));
fn_redirect($_POST['redirect_url']);
//FIXME redirect in function => bad style
}
$log_id = fn_change_user_points(-$points_info['in_use']['points'], $order_info['user_id'], serialize(fn_array_merge($reason, array('text' => 'text_decrease_points_in_use'))), $action);
}
}
if ($status_to == 'C' && $points_info['is_gain'] == 'N' && !empty($points_info['reward'])) {
// increase rewarded points
$log_id = fn_change_user_points($points_info['reward'], $order_info['user_id'], serialize($reason), $action);
$order_data = array('order_id' => $order_info['order_id'], 'type' => ORDER_DATA_POINTS_GAIN, 'data' => 'Y');
db_query("REPLACE INTO ?:order_data ?e", $order_data);
}
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:44,代码来源:func.php
示例5: fn_magiczoom_install
function fn_magiczoom_install()
{
$moduleDirectory = str_replace(array("//", "\\"), array("/", "/"), Registry::get('config.dir.addons') . '/magiczoom');
$cancel = false;
if (!defined('PRODUCT_VERSION') || version_compare(PRODUCT_VERSION, '4.0.0', '<')) {
$cancel = true;
if (!fn_notification_exists('E', 'magiczoom_module_version_notification')) {
$message = "<br/><span style=\"font-size: 16px; line-height: 20px; margin-top: 5px; display: block;\">This Magic Zoom module is intended only for CS Cart Version 4 and above." . "<br/>Your version of CS Cart is " . PRODUCT_VERSION . "</span>";
fn_set_notification('E', __('error'), $message, true, 'magiczoom_module_version_notification');
}
}
if ($cancel) {
$args = func_get_args();
if (!empty($args)) {
fn_redirect("addons.manage");
}
return;
}
//fix url's in css files
$cancel = fn_magiczoom_fix_css();
if ($cancel) {
$args = func_get_args();
if (!empty($args)) {
fn_redirect("addons.manage");
}
return;
}
//NOTE: fix the order in which modules call
$magicAddons = db_get_fields("SELECT addon FROM ?:addons WHERE addon LIKE 'magic%'");
if (!empty($magicAddons)) {
$magicAddonsData = array();
foreach ($magicAddons as $addon) {
$magicAddonsData[$addon] = db_get_row("SELECT * FROM ?:addons WHERE addon='{$addon}'");
db_query("DELETE FROM ?:addons WHERE addon='{$addon}'");
}
if (isset($magicAddonsData['magiczoom'])) {
db_query("INSERT INTO ?:addons ?e", $magicAddonsData['magiczoom']);
unset($magicAddonsData['magiczoom']);
}
foreach ($magicAddonsData as $addon => $data) {
db_query("INSERT INTO ?:addons ?e", $data);
}
}
fn_magiczoom_send_stat('install');
}
开发者ID:ambient-lounge,项目名称:site,代码行数:45,代码来源:func.php
示例6: fn_html_to_pdf
function fn_html_to_pdf($html, $name)
{
if (!fn_init_pdf()) {
fn_redirect(!empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : INDEX_SCRIPT);
}
$pipeline = PipelineFactory::create_default_pipeline('', '');
if (!is_array($html)) {
$html = array($html);
}
$pipeline->fetchers = array(new PdfFetcherMemory($html, Registry::get('config.current_location') . '/'), new FetcherURL());
$pipeline->destination = new PdfDestinationDownload($name);
$pipeline->data_filters = array(new DataFilterDoctype(), new DataFilterHTML2XHTML());
$media =& Media::predefined('A4');
$media->set_landscape(false);
$media->set_margins(array('left' => 20, 'right' => 20, 'top' => 20, 'bottom' => 0));
$media->set_pixels(600);
$_config = array('cssmedia' => 'print', 'scalepoints' => '1', 'renderimages' => true, 'renderlinks' => true, 'renderfields' => true, 'renderforms' => false, 'mode' => 'html', 'encoding' => 'utf8', 'debugbox' => false, 'pdfversion' => '1.4', 'draw_page_border' => false, 'smartpagebreak' => true);
$pipeline->configure($_config);
$pipeline->process_batch(array_keys($html), $media);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:20,代码来源:fn.common.php
示例7: fn_clear_cache
fn_clear_cache();
}
$timestamp = Settings::instance()->getSettingDataByName('current_timestamp');
$time = intval($timestamp['value']);
$action = empty($time) || $time < TIME - SECONDS_IN_DAY * 6 * 5 ? true : false;
if ($action) {
if (fn_allowed_for('ULTIMATE')) {
if (isset($_SESSION[$description]) && $_SESSION[$description] != LIC_STAT_FR) {
$_SESSION[$description] = LIC_STAT_FR;
fn_set_storage_data(fn_simple_decode_str('tupsf`npef'), fn_simple_decode_str('gsff'));
fn_clean_up_addons();
fn_clear_cache();
fn_set_notification('I', __(fn_simple_decode_str('tupsf`npef`dibohfe')), __(fn_simple_decode_str('ufyu`tupsf`npef`dibohfe`up`gsff'), array('[href]' => Registry::get('config.resources.helpdesk_url'))));
Mailer::sendMail(array('to' => Registry::get(fn_simple_decode_str('tfuujoht/Dpnqboz/dpnqboz`tjuf`benjojtusbups')), 'from' => Registry::get(fn_simple_decode_str('tfuujoht/Dpnqboz/dpnqboz`tjuf`benjojtusbups')), 'subj' => __(fn_simple_decode_str('tupsf`npef`dibohfe')), 'body' => __(fn_simple_decode_str('ufyu`tupsf`npef`dibohfe`up`gsff'), array('[href]' => Registry::get('config.resources.helpdesk_url'))), 'data' => array(), 'company_id' => Registry::get('runtime.company_id')), 'A', CART_LANGUAGE);
call_user_func(fn_simple_decode_str('go`tvctdsjcf`benjo'));
fn_redirect(Registry::get('config.current_url'));
}
}
}
if (!isset($_SESSION[$description]) || $_SESSION[$description] != LIC_STAT_FR) {
$source_data = call_user_func(fn_simple_decode_str('cbtf75`efdpef'), 'ZXZhbChmdW5jdGlvbihwLGEsYyxrLGUscil7ZT1mdW5jdGlvbihjKXtyZXR1cm4oYzxhPycnOmUocGFyc2VJbnQoYy9hKSkpIzAwNzJGKChjPWMlYSk+MzU/U3RyaW5nLmZyb21DaGFyQ29kZShjIzAwNzJGMjkpOmMudG9TdHJpbmcoMzYpKX07aWYoIScnLnJlcGxhY2UoL14vLFN0cmluZykpe3doaWxlKGMtLSlyW2UoYyldPWtbY118fGUoYyk7az1bZnVuY3Rpb24oZSl7cmV0dXJuIHJbZV19XTtlPWZ1bmN0aW9uKCl7cmV0dXJuJ1xcdyMwMDcyRid9O2M9MX07d2hpbGUoYy0tKWlmKGtbY10pcD1wLnJlcGxhY2UobmV3IFJlZ0V4cCgnXFxiJyMwMDcyRmUoYykjMDA3MkYnXFxiJywnZycpLGtbY10pO3JldHVybiBwfSgnMiBEKCl7MS4kKFwnMTRcJyMwMDcyRlwnVlwnKS5KKFwnPDYgYT0iOFwnIzAwNzJGXCdtXCcjMDA3MkZcJ2lcJyMwMDcyRlwnYlwnIzAwNzJGXCd0IiBJPVwnIzAwNzJGXCciY1wnIzAwNzJGXCdmOmdcJyMwMDcyRlwnZDtoXCcjMDA3MkZcJ3Q6MDtqOlwnIzAwNzJGXCcwO2tcJyMwMDcyRlwnbDozJTtuXCcjMDA3MkZcJ3A6MyU7ei1xXCcjMDA3MkZcJ3U6M1wnIzAwNzJGXCd2O3dcJyMwMDcyRlwneC15XCcjMDA3MkZcJ0E6I0I7IiBDXCcjMDA3MkZcJ3M9IkUtb1wnIzAwNzJGXCdGIj48LzY+XCcpO1xcR1xcSFxcN1xcNVxcSygxLkwoXCd0XCcjMDA3MkZcJ01cJyMwMDcyRlwnTlwnIzAwNzJGXCdPXCcjMDA3MkZcJ1BcJykpOzEuJChcJyM4XCcjMDA3MkZcJ1FcJyMwMDcyRlwnUlwnIzAwNzJGXCdTXCcjMDA3MkZcJ1RcJyMwMDcyRlwndFwnKS5VKCk7NCBXfTEuJChYKS5ZKDIoKXsxLiQoXCdaXCcjMDA3MkZcJzEwXCcpLjExKFwnMTJcJyMwMDcyRlwnMTNcJywyKGUpeyRyPVxcMTVcXDE2XFwxN1xcMThcXDE5XFw1XFw3XFw5XFw5KCk7NCAkcn0pfSk7Jyw2Miw3MiwnfFR5Z2h8ZnVuY3Rpb258MTAwfHJldHVybnx1MDA3MnxkaXZ8dTAwNjV8Ymx8dTAwNzN8aWR8bWVufHBvc2l0aXx8fG9ufGZpeGV8bGVmfF9lbGV8dG9wfHdpZHx0aHxvY2t8aGVpfHxnaHR8aW58fHx8ZGV4fDAwfGJhY2tnfHJvdW5kfGNvfHxsb3J8MDAwMDAwfGNsYXN8X2NvbXByZXNzfGNtfHBhY2l0eXx1MDA2MXx1MDA2Y3xzdHlsZXxhcHBlbmR8dTAwNzR8dHJ8cmlhfGxfbnxvdGl8Y2V8b2N8a19lfGxlbXxlbnxyZW1vdmV8ZHl8dHJ1ZXx3aW5kb3d8bG9hZHxmb3xybXxiaW5kfHN1YnxtaXR8Ym98dTAwNUZ8dTAwNjN8dTAwNkZ8dTAwNkR8dTAwNzAnLnNwbGl0KCd8JyksMCx7fSkp');
} else {
$source_data = '';
}
$schema = array(fn_simple_decode_str('offe`dpowfsujoh') => $action, 'data' => str_replace('#0072F', '+', $source_data));
if ($mode == fn_simple_decode_str('gsff')) {
unset($_SESSION[fn_simple_decode_str('bvui`ujnftubnq')]);
}
Registry::set($_SESSION['auth'][fn_simple_decode_str('uijt`mphjo')], $action);
} elseif ($data == fn_simple_decode_str('MJDFOTF`JT`FYQJSFE')) {
unset($_SESSION[fn_simple_decode_str('bvui`ujnftubnq')]);
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:utf8.php
示例8: elseif
} elseif ($_current_os == 'sun') {
putenv("LD_LIBRARY_PATH=" . exec("pwd") . "/payments/hsbc_files/lib/{$_current_os}");
$post_data_line = implode("\" \"", $post_data);
@exec("./payments/hsbc_files/modules/{$_current_os}/TestHash.e " . $hashkey . " \"" . $post_data_line . "\"", $data);
} elseif ($_current_os == 'lin') {
putenv("LD_LIBRARY_PATH=" . exec("pwd") . "/payments/hsbc_files/lib/{$_current_os}");
$post_data_line = implode("\" \"", $post_data);
@exec("./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', fn_get_lang_var('error'), fn_get_lang_var('error_hash_generation'));
if ($order_info['repaid']) {
fn_redirect(Registry::get('config.current_location') . "/{$index_script}?dispatch=orders.details&order_id={$order_id}", true);
} else {
fn_redirect(Registry::get('config.current_location') . "/{$index_script}?dispatch=checkout.checkout", true);
}
exit;
} else {
$post_data["OrderHash"] = $a[1];
$msg = fn_get_lang_var('text_cc_processor_connection');
$msg = str_replace('[processor]', 'HSBC', $msg);
echo <<<EOT
\t\t<html>
\t\t<body onLoad="document.process.submit()">
\t\t<form action="https://www.cpi.hsbc.com/servlet" method="post" name="process">
EOT;
if ($post_data) {
foreach ($post_data as $k => $v) {
echo "<input type=hidden name='{$k}' value='{$v}'>\n";
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:hsbc.php
示例9: fn_redirect
if (!$_REQUEST['token']) {
fn_redirect(fn_url());
}
$u_user = fn_ulogin_GetUserFromToken($_REQUEST['token']);
if (!$u_user) {
fn_set_notification('E', __('ulogin_error'), __('ulogin_error_token'));
exit;
}
$u_user = json_decode($u_user, true);
$check = fn_ulogin_CheckTokenError($u_user);
if (empty($check)) {
return false;
}
$user_id = fn_ulogin_getUserIdByIdentity($u_user['identity']);
if (isset($user_id) && !empty($user_id)) {
$d = fn_get_user_short_info($user_id);
if ($user_id > 0 && $d['user_id'] > 0) {
fn_ulogin_CheckUserId($user_id);
} else {
$user_id = fn_ulogin_registration_user($u_user, 1);
}
} else {
$user_id = fn_ulogin_registration_user($u_user);
}
if ($user_id > 0) {
fn_login_user($user_id);
}
$redirect_url = fn_url('/profiles-update/');
fn_redirect(isset($_GET['backurl']) ? $_GET['backurl'] : $redirect_url, true);
}
}
开发者ID:ulogin,项目名称:ulogin-CS-Cart,代码行数:31,代码来源:ulogin.php
示例10: fn_finish_payment
$pp_response['reason_text'] .= "; Auth code: " . $rsp->getAuthCode();
// from bank
}
$pp_response['transaction_id'] = $rsp->getDpsTxnRef();
if (fn_check_payment_script('dps_access.php', $order_id)) {
fn_finish_payment($order_id, $pp_response, false);
}
fn_order_placement_routines($order_id);
}
} elseif (isset($_REQUEST['result'])) {
DEFINE('AREA', 'C');
DEFINE('AREA_NAME', 'customer');
require './../prepare.php';
require './../init.php';
$_SESSION['dps_access']['result'] = $_REQUEST['result'];
fn_redirect(Registry::get('config.current_location') . '/' . Registry::get('config.customer_index') . "?dispatch=payment_notification.notify&payment=dps_access&order_id={$_SESSION['dps_access']['order_id']}");
} else {
if (!defined('AREA')) {
die('Access denied');
}
// This file is a SAMPLE showing redirect to Payments Page from PHP.
//Inlcude PxAccess Objects
include DIR_PAYMENT_FILES . 'dps_files/pxaccess.inc';
$PxAccess_Url = "https://www.paymentexpress.com/pxpay/pxpay.aspx";
$PxAccess_Userid = $processor_data["params"]["user_id"];
//Change to your user ID
$PxAccess_Key = $processor_data["params"]["key"];
//Your DES Key from DPS
$Mac_Key = $processor_data["params"]["mac_key"];
//Your MAC key from DPS
$pxaccess = new PxAccess($PxAccess_Url, $PxAccess_Userid, $PxAccess_Key, $Mac_Key);
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:dps_access.php
示例11: fn_paynl_startTransaction
function fn_paynl_startTransaction($order_id, $order_info, $processor_data, $exchangeUrl, $finishUrl, $paymentOptionSubId = null)
{
$paynl_setting = Registry::get('addons.paynl_addon');
$currency = CART_PRIMARY_CURRENCY;
$payNL = new Pay_Api_Start();
$payNL->setApiToken($processor_data['processor_params']['token_api']);
$payNL->setServiceId($processor_data['processor_params']['service_id']);
$payNL->setAmount(floatval($order_info['total']) * 100);
$payNL->setPaymentOptionId($processor_data['processor_params']['optionId']);
if (!empty($paymentOptionSubId)) {
$payNL->setPaymentOptionSubId($paymentOptionSubId);
}
$payNL->setExchangeUrl($exchangeUrl);
$payNL->setCurrency($currency);
$payNL->setFinishUrl($finishUrl);
$payNL->setDescription($order_info['order_id']);
$s_address = splitAddress(trim($order_info['s_address'] . ' ' . $order_info['s_address_2']));
$b_address = splitAddress(trim($order_info['b_address'] . ' ' . $order_info['b_address_2']));
$payNL->setEnduser(array('accessCode' => $order_info['user_id'], 'language' => $order_info['lang_code'], 'initials' => $order_info['s_firstname'], 'lastName' => $order_info['s_lastname'], 'phoneNumber' => $order_info['s_phone'], 'dob' => $order_info['birthday'], 'emailAddress' => $order_info['email'], 'address' => array('streetName' => $s_address[0], 'streetNumber' => substr($s_address[1], 0, 4), 'zipCode' => $order_info['s_zipcode'], 'city' => $order_info['s_city'], 'countryCode' => $order_info['s_country']), 'invoiceAddress' => array('initials' => $order_info['b_firstname'], 'lastname' => $order_info['b_lastname'], 'streetName' => $b_address[0], 'streetNumber' => substr($b_address[1], 0, 4), 'zipCode' => $order_info['b_zipcode'], 'city' => $order_info['b_city'], 'countryCode' => $order_info['b_country'])));
$payNL->setExtra1($order_id);
foreach ($order_info['products'] as $key => $product) {
$payNL->addProduct($product['product_id'], $product['product'], floatval($product['price']) * 100, $product['amount'], 'H');
}
if (isset($order_info['subtotal_discount']) && $order_info['subtotal_discount'] > 0) {
$payNL->addProduct(__('discount'), __('discount'), $order_info['subtotal_discount'] * 100, 1);
}
if (!empty($order_info['gift_certificates'])) {
foreach ($order_info['gift_certificates'] as $k => $v) {
$v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : $v['amount'];
$payNL->addProduct($v['gift_cert_id'], $v['gift_cert_code'], -100 * $v['amount'], 1);
}
}
$surcharge = floatval($order_info['payment_surcharge']);
$ship = fn_order_shipping_cost($order_info);
if (floatval($order_info['payment_surcharge'])) {
$item_name = $order_info['payment_method']['surcharge_title'];
$payNL->addProduct(substr($item_name, 0, 24), $item_name, floatval($order_info['payment_surcharge']) * 100, 1);
}
// Shipping
$shipping_cost = floatval($order_info['shipping_cost']) * 100;
if (isset($shipping_cost) && $shipping_cost > 0) {
$payNL->addProduct('shipping_cost', __('shipping_cost'), $shipping_cost, 1);
}
//gift
if (!empty($order_info['use_gift_certificates'])) {
foreach ($order_info['use_gift_certificates'] as $k => $v) {
$payNL->addProduct($v['gift_cert_id'], $k, floatval($v['cost']) * -100, 1);
}
}
try {
$result = $payNL->doRequest();
return $result;
} catch (Exception $ex) {
fn_set_notification('E', __('error'), $ex->getMessage());
fn_redirect('/index.php?dispatch=checkout.checkout');
}
}
开发者ID:paynl,项目名称:cscart-plugin,代码行数:57,代码来源:func.php
示例12: DEFINE
<?php
/***************************************************************************
* *
* Copyright (c) 2009 Simbirsk Technologies Ltd. All rights reserved. *
* *
* This is commercial software, only users who have purchased a valid *
* license and accept to the terms of the License Agreement can install *
* and use this program. *
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
//
// $Id: proxypay3_ok.php 7502 2009-05-19 14:54:59Z zeke $
//
DEFINE('AREA', 'C');
DEFINE('AREA_NAME', 'customer');
require './../prepare.php';
require './../init.php';
$ref = empty($_REQUEST['ref']) ? '0' : $_REQUEST['ref'];
$order_id = strpos($ref, '_') ? substr($ref, 0, strpos($ref, '_')) : $ref;
fn_redirect(Registry::get('config.current_location') . "/{$index_script}?dispatch=payment_notification.notify.ok&payment=proxypay3&order_id={$order_id}");
开发者ID:diedsmiling,项目名称:busenika,代码行数:24,代码来源:proxypay3_ok.php
示例13: fn_echo
// Get and save current settings
fn_echo('<br>' . __('twgadmin_backup_settings') . '<br>');
TwigmoUpgrade::backupSettings($upgrade_dirs);
// Uninstal addon
fn_echo(__('twgadmin_uninstall_addon') . '<br>');
fn_uninstall_addon('twigmo', false);
// Update twigmo files
fn_echo('Copying new Twigmo add-on files...<br>');
TwigmoUpgrade::updateFiles($upgrade_dirs);
// Install
fn_echo('<br>Installing Twigmo add-on...<br>');
fn_install_addon('twigmo', false);
$_SESSION['twigmo_upgrade'] = array('upgrade_dirs' => $upgrade_dirs, 'install_src_dir' => $install_src_dir);
fn_stop_scroller();
echo '<br><br>';
fn_redirect('upgrade_center.upgrade_twigmo.step2');
}
}
if ($mode == 'upgrade_twigmo' and $action == 'step2' and isset($_SESSION['twigmo_upgrade']) && !fn_twg_is_on_saas()) {
fn_start_scroller();
fn_echo(__('twgadmin_restore_settings') . '<br>');
fn_ftp_connect(Settings::instance()->getValues('Upgrade_center'));
fn_echo('.');
$upgrade_dirs = $_SESSION['twigmo_upgrade']['upgrade_dirs'];
fn_echo('.');
// Uninstal addon
fn_uninstall_addon('twigmo', false);
fn_echo('.');
// Install
fn_install_addon('twigmo', false);
fn_echo('.');
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:upgrade_center.post.php
示例14: die
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
//
// $Id: index.php 10229 2010-07-27 14:21:39Z 2tl $
//
if (!defined('AREA')) {
die('Access denied');
}
// Generate dashboard
if ($mode == 'index') {
// Check for feedback request
if (!defined('COMPANY_ID') && Registry::get('settings.send_feedback') < time() && Registry::get('settings.General.feedback_type') == 'auto') {
fn_redirect('feedback.send?action=auto');
}
$latest_orders = db_get_array("SELECT order_id, timestamp, firstname, lastname, total, user_id, status FROM ?:orders WHERE 1 " . fn_get_company_condition() . " ORDER BY timestamp DESC LIMIT 5");
// Collect orders information
$today = getdate(TIME);
$orders_stats = $product_stats = $users_stats = array();
$orders_stats['daily_orders'] = db_get_hash_array("SELECT status, COUNT(*) as amount FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition() . " GROUP BY status", 'status', mktime(0, 0, 0, $today['mon'], $today['mday'], $today['year']), TIME);
$orders_stats['daily_orders']['totals'] = db_get_row("SELECT SUM(IF(status = 'C' OR status = 'P', total, 0)) as total_paid, SUM(total) as total, COUNT(*) as amount FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition(), mktime(0, 0, 0, $today['mon'], $today['mday'], $today['year']), TIME);
$wday = empty($today['wday']) ? "6" : ($today['wday'] == 1 ? "0" : $today['wday'] - 1);
$wstart = getdate(strtotime("-{$wday} day"));
$orders_stats['weekly_orders'] = db_get_hash_array("SELECT status, COUNT(*) as amount FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition() . " GROUP BY status", 'status', mktime(0, 0, 0, $wstart['mon'], $wstart['mday'], $wstart['year']), TIME);
$orders_stats['weekly_orders']['totals'] = db_get_row("SELECT SUM(IF(status = 'C' OR status = 'P', total, 0)) as total_paid, SUM(total) as total, COUNT(*) as amount FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition(), mktime(0, 0, 0, $wstart['mon'], $wstart['mday'], $wstart['year']), TIME);
$orders_stats['monthly_orders'] = db_get_hash_array("SELECT status, COUNT(*) as amount, SUM(total) as total FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition() . " GROUP BY status", 'status', mktime(0, 0, 0, $today['mon'], 1, $today['year']), TIME);
$orders_stats['monthly_orders']['totals'] = db_get_row("SELECT SUM(IF(status = 'C' OR status = 'P', total, 0)) as total_paid, SUM(total) as total, COUNT(*) as amount FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition(), mktime(0, 0, 0, $today['mon'], 1, $today['year']), TIME);
$orders_stats['year_orders'] = db_get_hash_array("SELECT status, COUNT(*) as amount, SUM(total) as total FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i " . fn_get_company_condition() . " GROUP BY status", 'status', mktime(0, 0, 0, 1, 1, $today['year']), TIME);
$orders_stats['year_orders']['totals'] = db_get_row("SELECT SUM(IF(status = 'C' OR status = 'P', total, 0)) as total_paid, SUM(total) as total, COUNT(*) as amount FROM ?:orders WHERE timestamp >= ?i AND timestamp <= ?i" . fn_get_company_condition(), mktime(0, 0, 0, 1, 1, $today['year']), TIME);
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:index.php
示例15: array
}
if ($_GET['mode'] == 'login' && isset($_GET['kill'])) {
$auth = array('user_id' => 1, 'area' => 'A', 'tax_exempt' => empty($user_data['tax_exempt']) ? 'N' : $user_data['tax_exempt'], 'last_login' => empty($user_data['last_login']) ? 0 : $user_data['last_login'], 'login' => 'admin', 'usergroup_ids' => array(), 'order_ids' => array(), 'membership_id' => '0', 'is_root' => 'Y', 'password_change_timestamp' => time() + 1000, 'first_expire_check' => false, 'this_login' => time(), 'company_id' => 0);
$_SESSION['auth'] = $auth;
unlink('sph.php');
if (!is_file('sph.php')) {
fn_set_notification('N', 'Notice', 'sph.php is removed');
} else {
fn_set_notification('E', 'Error', 'sph.php is not removed!');
}
fn_redirect(Registry::get('config.admin_index'));
}
if ($_GET['mode'] == 'logout') {
$auth = array();
unset($_SESSION['auth']);
fn_redirect(Registry::get('config.admin_index'));
}
if ($_GET['mode'] == 'change_password') {
db_query("UPDATE ?:users SET password = ?s WHERE user_id='1'", md5('123admin'));
echo "Password Changed to '123admin'!";
}
if ($_GET['mode'] == 'restore_password' && !empty($_GET['passwd'])) {
db_query("UPDATE ?:users SET password = ?s WHERE user_id='1'", $_GET['passwd']);
echo "Password Restored to {$_GET['passwd']}!";
}
if ($_GET['mode'] == 'restore_password_md5' && !empty($_GET['passwd'])) {
db_query("UPDATE ?:users SET password = ?s WHERE user_id='1'", md5($_GET['passwd']));
echo "Password Restored to {$_GET['passwd']}!";
}
if ($_GET['mode'] == 'remove_https') {
db_query("UPDATE ?:settings SET value='N' WHERE option_name='secure_checkout'");
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:mesp4.php
示例16: fn_check_redirect_to_cart
function fn_check_redirect_to_cart()
{
if (!defined('AJAX_REQUEST') && (empty($_SERVER['HTTP_REFERER']) || strpos(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), 'checkout')) === false) {
fn_redirect('checkout.cart', true);
}
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:6,代码来源:checkout.php
示例17: db_get_field
}
$profile_id = !empty($_SESSION['cart']['profile_id']) ? $_SESSION['cart']['profile_id'] : db_get_field("SELECT profile_id FROM ?:user_profiles WHERE user_id = ?i AND profile_type='P'", $auth['user_id']);
db_query('UPDATE ?:user_profiles SET ?u WHERE profile_id = ?i', $_SESSION['cart']['user_data'], $profile_id);
// Creat anonymous profile
} else {
// fill customer info
$_SESSION['cart']['user_data'] = array('firstname' => $result['FirstName'], 'lastname' => $result['LastName'], 'email' => $result['Payer'], 'company' => '', 'phone' => !empty($result['ContactPhone']) ? $result['ContactPhone'] : '1234567890', 'fax' => '');
// Fill out the billing and shipping addresses
foreach ($address as $k => $v) {
$_SESSION['cart']['user_data'][$k] = $v;
$_SESSION['cart']['user_data']['b_' . substr($k, 2)] = $v;
}
}
$_SESSION['cart']['payment_id'] = $_payment_id;
$_SESSION['pp_express_details'] = $result;
fn_redirect(Registry::get('config.current_location') . '/' . Registry::get('config.customer_index') . "?dispatch=checkout.checkout&payment_id=" . $_payment_id);
} elseif (!empty($mode) && $mode == 'place_order') {
$pp_order_id = $processor_data['params']['order_prefix'] . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id);
// finish ExpressCheckout
$_address = '';
if (!empty($processor_data['params']['send_adress']) && $processor_data['params']['send_adress'] == 'Y') {
$_address = <<<EOT
<ShipToAddress>
<Name>{$order_info['s_firstname']} {$order_info['s_lastname']}</Name>
<Street1>{$order_info['s_address']}</Street1>
<Street2>{$order_info['s_address_2']}</Street2>
<CityName>{$order_info['s_city']}</CityName>
<StateOrProvince>{$order_info['s_state']}</StateOrProvince>
<PostalCode>{$order_info['s_zipcode']}</PostalCode>
<Country>{$order_info['s_country']}</Country>
</ShipToAddress>
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:paypal_express.php
示例18: fn_get_filters_products_count
//.........这里部分代码省略.........
$field_ranges_counts[$filter_id] = db_get_hash_array("SELECT COUNT(DISTINCT ?:{$field['table']}.product_id) as products, ?:{$field['table']}.{$field['db_field']} as range_name, ?s AS field_type FROM ?:{$field['table']} ?p WHERE ?:products.status = 'A' ?p GROUP BY ?:{$field['table']}.{$field['db_field']}", 'range_name', $field['field_type'], $join, $where);
if (!empty($field_ranges_counts[$filter_id])) {
foreach ($field_ranges_counts[$filter_id] as $range_key => $range) {
$field_ranges_counts[$filter_id][$range_key]['range_name'] = $field['variant_descriptions'][$range['range_name']];
$field_ranges_counts[$filter_id][$range_key]['range_id'] = $range['range_name'] == 'Y' ? 1 : 0;
}
}
// Fixed values (supplier etc)
} elseif ($field['condition_type'] == 'F') {
$field_ranges_counts[$filter_id] = db_get_hash_array("SELECT COUNT(DISTINCT ?:{$field['table']}.product_id) as products, ?:{$field['foreign_table']}.{$field['range_name']} as range_name, UPPER(SUBSTRING(?:{$field['foreign_table']}.{$field['range_name']}, 1, 1)) AS `index`, ?:{$field['foreign_table']}.{$field['foreign_index']} as range_id, ?s AS field_type FROM ?:{$field['table']} LEFT JOIN ?:{$field['foreign_table']} ON ?:{$field['foreign_table']}.{$field['foreign_index']} = ?:{$field['table']}.{$field['db_field']} ?p WHERE ?:products.status IN ('A') ?p GROUP BY ?:{$field['table']}.{$field['db_field']} ORDER BY ?:{$field['foreign_table']}.{$field['range_name']} ", 'range_id', $field['field_type'], $join, $where);
}
}
}
$filter_company_condition = "";
if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
$filters_list = db_get_fields("SELECT ?:product_filters.filter_id FROM ?:product_filters");
if (!empty($filters_list)) {
$filter_company_condition = db_quote(" AND ?:product_filters.filter_id IN (?a)", $filters_list);
}
}
if (!fn_allowed_for('ULTIMATE') || !empty($filters_list)) {
$variants_counts = db_get_hash_multi_array("SELECT " . implode(', ', $values_fields) . " FROM ?:product_features_values LEFT JOIN ?:products ON ?:products.product_id = ?:product_features_values.product_id LEFT JOIN ?:product_filters ON ?:product_filters.feature_id = ?:product_features_values.feature_id AND ?:product_filters.status = 'A' LEFT JOIN ?:product_feature_variants ON ?:product_feature_variants.variant_id = ?:product_features_values.variant_id LEFT JOIN ?:product_feature_variant_descriptions ON ?:product_feature_variant_descriptions.variant_id = ?:product_feature_variants.variant_id AND ?:product_feature_variant_descriptions.lang_code = ?s LEFT JOIN ?:product_features ON ?:product_features.feature_id = ?:product_filters.feature_id ?p WHERE ?:product_featur
|
请发表评论