本文整理汇总了PHP中tep_href_link函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_href_link函数的具体用法?PHP tep_href_link怎么用?PHP tep_href_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_href_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOutput
function getOutput()
{
$cache_file = DIR_FS_CACHE . 'oscommerce_version_check.cache';
$current_version = tep_get_version();
$new_version = false;
if (file_exists($cache_file)) {
$date_last_checked = tep_datetime_short(date('Y-m-d H:i:s', filemtime($cache_file)));
$releases = unserialize(implode('', file($cache_file)));
foreach ($releases as $version) {
$version_array = explode('|', $version);
if (version_compare($current_version, $version_array[0], '<')) {
$new_version = true;
break;
}
}
} else {
$date_last_checked = MODULE_ADMIN_DASHBOARD_VERSION_CHECK_NEVER;
}
$output = '<table border="0" width="100%" cellspacing="0" cellpadding="4">' . ' <tr class="dataTableHeadingRow">' . ' <td class="dataTableHeadingContent">' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_TITLE . '</td>' . ' <td class="dataTableHeadingContent" align="right">' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_DATE . '</td>' . ' </tr>';
if ($new_version == true) {
$output .= ' <tr>' . ' <td class="messageStackWarning" colspan="2">' . tep_image('images/icons/warning.gif', ICON_WARNING) . ' <strong>' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_UPDATE_AVAILABLE . '</strong></td>' . ' </tr>';
}
$output .= ' <tr class="dataTableRow" onmouseover="rowOverEffect(this);" onmouseout="rowOutEffect(this);">' . ' <td class="dataTableContent"><a href="' . tep_href_link('version_check.php') . '">' . MODULE_ADMIN_DASHBOARD_VERSION_CHECK_CHECK_NOW . '</a></td>' . ' <td class="dataTableContent" align="right">' . $date_last_checked . '</td>' . ' </tr>' . '</table>';
return $output;
}
示例2: getOutput
function getOutput()
{
global $lng;
if (!isset($lng) || isset($lng) && !is_object($lng)) {
include DIR_WS_CLASSES . 'language.php';
$lng = new language();
}
foreach ($lng->catalog_languages as $lkey => $lvalue) {
if ($lvalue['id'] == $_SESSION['languages_id']) {
$language_code = $lkey;
break;
}
}
$output = '<div class="g-plusone" data-href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id'], 'NONSSL', false) . '" data-size="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SIZE) . '" data-annotation="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION) . '"';
if (MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION == 'Inline') {
$output .= ' data-width="' . (int) MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_WIDTH . '" data-align="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ALIGN) . '"';
}
$output .= '></div>';
$output .= '<script type="text/javascript">
if ( typeof window.___gcfg == "undefined" ) {
window.___gcfg = { };
}
if ( typeof window.___gcfg.lang == "undefined" ) {
window.___gcfg.lang = "' . tep_output_string_protected($language_code) . '";
}
(function() {
var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
po.src = \'https://apis.google.com/js/plusone.js\';
var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
})();
</script>';
return $output;
}
示例3: tep_session_start
function tep_session_start() {
global $_GET, $_POST, $HTTP_COOKIE_VARS;
$sane_session_id = true;
if (isset($_GET[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_GET[tep_session_name()]) == false) {
unset($_GET[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($_POST[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_POST[tep_session_name()]) == false) {
unset($_POST[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
$session_data = session_get_cookie_params();
setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);
$sane_session_id = false;
}
}
if ($sane_session_id == false) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
return session_start();
}
示例4: execute
function execute()
{
global $HTTP_GET_VARS, $current_category_id, $languages_id, $oscTemplate;
if (isset($current_category_id) && $current_category_id > 0) {
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int) $current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
} else {
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
}
if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
$bestsellers_list = '<ol style="margin: 0; padding-left: 25px;">';
while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
$bestsellers_list .= '<li><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></li>';
}
$bestsellers_list .= '</ol>';
if ($this->group == 'boxes_footer') {
$data = '<div class="col-sm-3 col-lg-2">' . ' <div class="footerbox best-sellers">' . ' <h2>' . MODULE_BOXES_BEST_SELLERS_BOX_TITLE . '</h2>';
} else {
$data = '<div class="panel panel-default">' . ' <div class="panel-heading">' . MODULE_BOXES_BEST_SELLERS_BOX_TITLE . '</div>';
}
$data .= ' <div class="panel-body">' . $bestsellers_list . '</div>';
$data .= '</div>';
if ($this->group == 'boxes_footer') {
$data .= '</div>';
}
$oscTemplate->addBlock($data, $this->group);
}
}
示例5: tep_display_banner
function tep_display_banner($action, $identifier)
{
if ($action == 'dynamic') {
$banners_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
$banners = tep_db_fetch_array($banners_query);
if ($banners['count'] > 0) {
$banner = tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
} else {
return '<strong>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</strong>';
}
} elseif ($action == 'static') {
if (is_array($identifier)) {
$banner = $identifier;
} else {
$banner_query = tep_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . (int) $identifier . "'");
if (tep_db_num_rows($banner_query)) {
$banner = tep_db_fetch_array($banner_query);
} else {
return '<strong>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</strong>';
}
}
} else {
return '<strong>TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</strong>';
}
if (tep_not_null($banner['banners_html_text'])) {
$banner_string = $banner['banners_html_text'];
} else {
$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
}
tep_update_banner_display_count($banner['banners_id']);
return $banner_string;
}
示例6: get_response_handler_url
function get_response_handler_url()
{
$dummy = 'a';
$admin_folder = tep_href_link($dummy);
$catalog_folder = substr($admin_folder, 0, strlen($admin_folder) - strlen('admin/' . $dummy));
return $catalog_folder . 'googlecheckout/responsehandler.php';
}
示例7: get_search_collections
function get_search_collections()
{
extract(tep_load('defs', 'database', 'sessions'));
$cAbstract = new abstract_zones();
$classes_array = $cAbstract->get_classes();
foreach ($classes_array as $key => $value) {
$cObject = new $value();
}
$keywords = isset($_GET['search']) && !empty($_GET['search']) ? $db->prepare_input($_GET['search']) : '';
$text_query_raw = "select gtext_id, gtext_title from " . TABLE_GTEXT . " where (gtext_title like '%" . $db->input($keywords) . "%' or gtext_alt_title like '%" . $db->input($keywords) . "%') order by gtext_title limit 10";
$text_array = $db->query_to_array($text_query_raw);
$j = count($text_array);
if ($j) {
echo '<div><table class="tabledata">' . "\n";
for ($i = 0; $i < $j; $i++) {
echo '<tr>' . "\n";
echo ' <td><a href="' . tep_href_link(FILENAME_GENERIC_TEXT, 'gtID=' . $text_array[$i]['gtext_id'] . '&action=new_generic_text') . '">' . $text_array[$i]['gtext_title'] . '</a></td>' . "\n";
echo ' <td><a href="' . tep_href_link($cDefs->script, 'cID=' . $text_array[$i]['abstract_zone_id'] . '&action=list') . '">' . $text_array[$i]['abstract_zone_name'] . '</a></td>' . "\n";
echo '<tr>' . "\n";
}
echo '</table></div>' . "\n";
} else {
echo 'Nothing Found';
}
$cSessions->close();
return true;
}
示例8: execute
function execute()
{
global $PHP_SELF, $lng, $request_type, $oscTemplate, $language, $request_type, $HTTP_GET_VARS, $current_lang_key;
if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
if (!isset($lng) || isset($lng) && !is_object($lng)) {
include DIR_WS_CLASSES . 'language.php';
$lng = new language();
}
if (count($lng->catalog_languages) > 1) {
reset($lng->catalog_languages);
$languages_array = array();
while (list($key, $value) = each($lng->catalog_languages)) {
$languages_array[] = array('id' => $key, 'text' => $value['name']);
}
foreach ($lng->catalog_languages as $key => $value) {
if ($value['directory'] == $language) {
$current_lang_key = $key;
break;
}
}
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
if (is_string($value) && $key != 'language' && $key != tep_session_name() && $key != 'x' && $key != 'y') {
$hidden_get_variables .= tep_draw_hidden_field($key, $value);
}
}
$data = '<div class="headerBox languages">' . ' <span class="headerTitle languages-title">' . MODULE_BOXES_HEADER_LANGUAGES_BOX_TITLE . '</span>' . ' <div class="headerBoxContents">' . ' ' . tep_draw_form('languages', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . ' ' . tep_draw_pull_down_menu('language', $languages_array, $current_lang_key, 'onchange="this.form.submit();"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . ' </div>' . '</div>';
$oscTemplate->addBlock($data, $this->group);
}
}
}
示例9: execute
function execute()
{
global $oscTemplate, $languages_id;
$page_query = tep_db_query("select p.pages_id, p.sort_order, p.status, s.pages_title, s.pages_html_text, s.intorext, s.externallink, s.link_target from " . TABLE_PAGES . " p LEFT JOIN " . TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id where p.status = 1 and p.page_type != 1 and s.language_id = '" . (int) $languages_id . "' order by p.sort_order, s.pages_title");
$rows = 0;
$data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_EXTRAINFOPAGE_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents"><table border="0" width="100%" cellspacing="0" cellpadding="1">';
while ($page = tep_db_fetch_array($page_query)) {
$rows++;
$target = "";
if ($page['link_target'] == 1) {
$target = "_blank";
}
if ($page['pages_title'] != 'Contact Us') {
$link = FILENAME_PAGES . '?pages_id=' . $page['pages_id'];
} else {
$link = FILENAME_CONTACT_US;
}
if ($page['intorext'] == 1) {
$data .= '<tr><td class="bg_list2"><a target="' . $target . '" href="' . $page['externallink'] . '">' . $page['pages_title'] . '</a></td></tr>';
} else {
$data .= '<tr><td class="bg_list2"><a target="' . $target . '" href="' . tep_href_link(FILENAME_PAGES, 'pages_id=' . $page['pages_id'], 'NONSSL') . '">' . $page['pages_title'] . '</a></td></tr>';
}
}
$data .= '</table></div>' . '</div>';
$oscTemplate->addBlock($data, $this->group);
}
示例10: execute
function execute()
{
global $currencies, $oscTemplate;
if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {
$random_product['products_name'] = tep_get_products_name($random_product['products_id']);
$random_product['specials_new_products_price'] = tep_get_products_special_price($random_product['products_id']);
if (tep_not_null($random_product['specials_new_products_price'])) {
$whats_new_price = '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br />';
$whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>';
} else {
$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
}
if ($this->group == 'boxes_footer') {
$data = '<div class="col-sm-3 col-lg-2">' . ' <div class="footerbox best-sellers">' . ' <h2><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></h2>';
} else {
$data = '<div class="panel panel-default">' . ' <div class="panel-heading"><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . MODULE_BOXES_WHATS_NEW_BOX_TITLE . '</a></div>';
}
$data .= ' <div class="panel-body text-center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br />' . $whats_new_price . '</div>';
$data .= '</div>';
if ($this->group == 'boxes_footer') {
$data .= '</div>';
}
$oscTemplate->addBlock($data, $this->group);
}
}
示例11: pre_confirmation_check
function pre_confirmation_check()
{
global $HTTP_POST_VARS;
include DIR_WS_CLASSES . 'cc_validation.php';
$cc_validation = new cc_validation();
$result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
$error = '';
switch ($result) {
case -1:
$error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
break;
case -2:
case -3:
case -4:
$error = TEXT_CCVAL_ERROR_INVALID_DATE;
break;
case false:
$error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
break;
}
if ($result == false || $result < 1) {
$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
}
$this->cc_card_type = $cc_validation->cc_type;
$this->cc_card_number = $cc_validation->cc_number;
}
示例12: execute
function execute()
{
global $customer_id, $languages_id, $PHP_SELF, $oscTemplate;
if (tep_session_is_registered('customer_id')) {
// retreive the last x products purchased
$orders_query = tep_db_query("select distinct op.products_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_PRODUCTS . " p where o.customers_id = '" . (int) $customer_id . "' and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = '1' group by products_id order by o.date_purchased desc limit " . MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX);
if (tep_db_num_rows($orders_query)) {
$product_ids = '';
while ($orders = tep_db_fetch_array($orders_query)) {
$product_ids .= (int) $orders['products_id'] . ',';
}
$product_ids = substr($product_ids, 0, -1);
$customer_orders_string = '<ul class="list-unstyled">';
$products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . (int) $languages_id . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
$customer_orders_string .= '<li><span class="pull-right"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '"><span class="glyphicon glyphicon-shopping-cart"></span></a></span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></li>';
}
$customer_orders_string .= '</ul>';
if ($this->group == 'boxes_footer') {
$data = '<div class="col-sm-3 col-lg-2">' . ' <div class="footerbox order-history">' . ' <h2>' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '</h2>';
} else {
$data = '<div class="panel panel-default">' . ' <div class="panel-heading">' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '</div>';
}
$data .= ' <div class="panel-body">' . $customer_orders_string . '</div>';
$data .= '</div>';
if ($this->group == 'boxes_footer') {
$data .= '</div>';
}
$oscTemplate->addBlock($data, $this->group);
}
}
}
示例13: pre_confirmation_check
function pre_confirmation_check()
{
global $oscTemplate, $order;
parent::pre_confirmation_check();
$oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/BrandDetection.js"></script>', 'header_tags');
$oscTemplate->addBlock('<script type="text/javascript" src="ext/modules/payment/paymill/public/javascript/cc.js"></script>', 'header_tags');
$months_array = array();
$months_array[1] = array('01', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JANUARY);
$months_array[2] = array('02', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_FEBRUARY);
$months_array[3] = array('03', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_MARCH);
$months_array[4] = array('04', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_APRIL);
$months_array[5] = array('05', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_MAY);
$months_array[6] = array('06', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JUNE);
$months_array[7] = array('07', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_JULY);
$months_array[8] = array('08', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_AUGUST);
$months_array[9] = array('09', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_SEPTEMBER);
$months_array[10] = array('10', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_OCTOBER);
$months_array[11] = array('11', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_NOVEMBER);
$months_array[12] = array('12', MODULE_PAYMENT_PAYMILL_CC_TEXT_MONTH_DECEMBER);
$today = getdate();
$years_array = array();
for ($i = $today['year']; $i < $today['year'] + 10; $i++) {
$years_array[$i] = array(tep_output_string(strftime('%Y', mktime(0, 0, 0, 1, 1, $i))), tep_output_string_protected(strftime('%Y', mktime(0, 0, 0, 1, 1, $i))));
}
$this->fastCheckout->setFastCheckoutFlag($this->fastCheckoutFlag);
$payment = $this->getPayment($_SESSION['customer_id']);
$script = '<script type="text/javascript">' . 'var cclogging = "' . MODULE_PAYMENT_PAYMILL_CC_LOGGING . '";' . 'var cc_expiery_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_EXPIRY_INVALID . '";' . 'var cc_owner_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_OWNER_INVALID . '";' . 'var cc_card_number_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CARDNUMBER_INVALID . '";' . 'var cc_cvc_number_invalid = "' . MODULE_PAYMENT_PAYMILL_CC_TEXT_CREDITCARD_CVC_INVALID . '";' . 'var brand = "' . $payment['card_type'] . '";' . 'var paymill_total = ' . json_encode($this->format_raw($order->info['total'])) . ';' . 'var paymill_currency = ' . json_encode(strtoupper($order->info['currency'])) . ';' . 'var paymill_cc_months = ' . json_encode($months_array) . ';' . 'var paymill_cc_years = ' . json_encode($years_array) . ';' . 'var paymill_cc_number_val = "' . $payment['last4'] . '";' . 'var paymill_cc_cvc_val = "' . $payment['cvc'] . '";' . 'var paymill_cc_card_type = "' . utf8_decode($payment['card_type']) . '";' . 'var paymill_cc_holder_val = "' . $payment['card_holder'] . '";' . 'var paymill_cc_expiry_month_val = "' . $payment['expire_month'] . '";' . 'var paymill_cc_expiry_year_val = "' . $payment['expire_year'] . '";' . 'var paymill_cc_fastcheckout = ' . ($this->fastCheckout->canCustomerFastCheckoutCc($_SESSION['customer_id']) ? 'true' : 'false') . ';' . 'var checkout_payment_link = "' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'step=step2', 'SSL', true, false) . '&payment_error=' . $this->code . '&error=";' . 'var logos = new Array();' . "logos['amex'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_AMEX) . ";" . "logos['carta-si'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_CARTASI) . ";" . "logos['dankort'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DANKORT) . ";" . "logos['carte-bleue'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_CARTEBLEUE) . ";" . "logos['discover'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DISCOVER) . ";" . "logos['diners-club'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_DINERSCLUB) . ";" . "logos['china-unionpay'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_UNIONPAY) . ";" . "logos['maestro'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_MAESTRO) . ";" . "logos['jcb'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_JCB) . ";" . "logos['mastercard'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_MASTERCARD) . ";" . "logos['visa'] = " . strtolower(MODULE_PAYMENT_PAYMILL_CC_VISA) . ";" . "var allBrandsDisabled = !logos['amex'] && !logos['carta-si'] && !logos['dankort'] && !logos['carte-bleue'] && !logos['discover'] && !logos['diners-club'] && !logos['china-unionpay'] && !logos['maestro'] && !logos['jcb'] && !logos['mastercard'] && !logos['visa'];" . '</script>';
$oscTemplate->addBlock($script, 'header_tags');
$oscTemplate->addBlock('<form id="paymill_form" action="' . tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL') . '" method="post"></form>', 'footer_scripts');
}
示例14: process_button
function process_button()
{
global $order;
$last_order_id = tep_db_query("select orders_id from " . TABLE_ORDERS . " order by orders_id desc limit 1");
$result = tep_db_fetch_array($last_order_id);
$this->orderID = $result['orders_id'] + 1;
$acceptURL = tep_href_link(FILENAME_CHECKOUT_PROCESS, 'referer=mokejimai', 'SSL');
$cancelURL = tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL');
$callbackURL = tep_href_link('mokejimai_validation.php', '', 'SSL', false, false, true);
$acceptURL = str_replace('&', '&', $acceptURL);
$cancelURL = str_replace('&', '&', $cancelURL);
$callbackURL = str_replace('&', '&', $callbackURL);
try {
$request = WebToPay::buildRequest(array('projectid' => $this->projectID, 'sign_password' => $this->projectPass, 'orderid' => $this->orderID, 'amount' => intval(number_format($order->info['total'], 2, '', '')), 'currency' => $order->info['currency'], 'lang' => substr($_SESSION['language'], 0, 2) !== 'lt' ? 'ENG' : 'LTU', 'accepturl' => $acceptURL, 'cancelurl' => $cancelURL, 'callbackurl' => $callbackURL, 'country' => 'LT', 'logo' => '', 'p_firstname' => $order->customer['firstname'], 'p_lastname' => $order->customer['lastname'], 'p_email' => $order->customer['email_address'], 'p_street' => $order->customer['street_address'], 'p_city' => $order->customer['city'], 'p_state' => $order->customer['state'], 'p_zip' => $order->customer['postcode'], 'p_countrycode' => $order->customer['country']['iso_code_2'], 'test' => $this->testMode));
} catch (WebToPayException $e) {
echo get_class($e) . ': ' . $e->getMessage();
}
$html = '';
if ($request) {
foreach ($request as $key => $value) {
$html .= tep_draw_hidden_field($key, $value);
}
}
return $html;
}
示例15: execute
function execute()
{
global $PHP_SELF, $oscTemplate, $languages_id, $currencies, $currency;
if ($PHP_SELF == 'product_info.php' && isset($_GET['products_id'])) {
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_image from products p, products_description pd where p.products_id = '" . (int) $_GET['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int) $languages_id . "'");
if (tep_db_num_rows($product_info_query) === 1) {
$product_info = tep_db_fetch_array($product_info_query);
$data = array('card' => MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_TYPE, 'title' => $product_info['products_name']);
if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID)) {
$data['site'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_SITE_ID;
}
if (tep_not_null(MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID)) {
$data['creator'] = MODULE_HEADER_TAGS_TWITTER_PRODUCT_CARD_USER_ID;
}
$product_description = substr(trim(preg_replace('/\\s\\s+/', ' ', strip_tags($product_info['products_description']))), 0, 197);
if (strlen($product_description) == 197) {
$product_description .= ' ..';
}
$data['description'] = $product_description;
$products_image = $product_info['products_image'];
$pi_query = tep_db_query("select image from products_images where products_id = '" . (int) $product_info['products_id'] . "' order by sort_order limit 1");
if (tep_db_num_rows($pi_query) === 1) {
$pi = tep_db_fetch_array($pi_query);
$products_image = $pi['image'];
}
$data['image'] = tep_href_link('images/' . $products_image, '', 'NONSSL', false, false);
$result = '';
foreach ($data as $key => $value) {
$result .= '<meta name="twitter:' . tep_output_string_protected($key) . '" content="' . tep_output_string_protected($value) . '" />' . "\n";
}
$oscTemplate->addBlock($result, $this->group);
}
}
}