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); } } }
function execute() { global $PHP_SELF, $oscTemplate; $OSCOM_Db = Registry::get('Db'); $OSCOM_Language = Registry::get('Language'); if (isset($_SESSION['customer_id'])) { // retreive the last x products purchased $Qorders = $OSCOM_Db->prepare('select distinct op.products_id from :table_orders o, :table_orders_products op, :table_products p where o.customers_id = :customers_id and o.orders_id = op.orders_id and op.products_id = p.products_id and p.products_status = 1 group by op.products_id order by o.date_purchased desc limit :limit'); $Qorders->bindInt(':customers_id', $_SESSION['customer_id']); $Qorders->bindInt(':limit', MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX); $Qorders->execute(); if ($Qorders->fetch() !== false) { $product_ids = []; do { $product_ids[] = $Qorders->valueInt('products_id'); } while ($Qorders->fetch()); $customer_orders_string = null; $Qproducts = $OSCOM_Db->prepare('select products_id, products_name from :table_products_description where products_id in (' . implode(', ', $product_ids) . ') and language_id = :language_id order by products_name'); $Qproducts->bindInt(':language_id', $OSCOM_Language->getId()); $Qproducts->execute(); while ($Qproducts->fetch()) { $customer_orders_string .= '<li><span class="pull-right"><a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $Qproducts->valueInt('products_id')) . '"><span class="fa fa-shopping-cart"></span></a></span><a href="' . OSCOM::link('product_info.php', 'products_id=' . $Qproducts->valueInt('products_id')) . '">' . $Qproducts->value('products_name') . '</a></li>'; } ob_start(); include 'includes/modules/boxes/templates/order_history.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } } }
function paypal_express() { global $PHP_SELF, $order, $payment, $request_type; $this->_app = new OSCOM_PayPal(); $this->_app->loadLanguageFile('modules/EC/EC.php'); $this->signature = 'paypal|paypal_express|' . $this->_app->getVersion() . '|2.3'; $this->api_version = $this->_app->getApiVersion(); $this->code = 'paypal_express'; $this->title = $this->_app->getDef('module_ec_title'); $this->public_title = $this->_app->getDef('module_ec_public_title'); $this->description = '<div align="center">' . $this->_app->drawButton($this->_app->getDef('module_ec_legacy_admin_app_button'), tep_href_link('paypal.php', 'action=configure&module=EC'), 'primary', null, true) . '</div>'; $this->sort_order = defined('OSCOM_APP_PAYPAL_EC_SORT_ORDER') ? OSCOM_APP_PAYPAL_EC_SORT_ORDER : 0; $this->enabled = defined('OSCOM_APP_PAYPAL_EC_STATUS') && in_array(OSCOM_APP_PAYPAL_EC_STATUS, array('1', '0')) ? true : false; $this->order_status = defined('OSCOM_APP_PAYPAL_EC_ORDER_STATUS_ID') && (int) OSCOM_APP_PAYPAL_EC_ORDER_STATUS_ID > 0 ? (int) OSCOM_APP_PAYPAL_EC_ORDER_STATUS_ID : 0; if (defined('OSCOM_APP_PAYPAL_EC_STATUS')) { if (OSCOM_APP_PAYPAL_EC_STATUS == '0') { $this->title .= ' [Sandbox]'; $this->public_title .= ' (' . $this->code . '; Sandbox)'; } } if (!function_exists('curl_init')) { $this->description .= '<div class="secWarning">' . $this->_app->getDef('module_ec_error_curl') . '</div>'; $this->enabled = false; } if ($this->enabled === true) { if (OSCOM_APP_PAYPAL_GATEWAY == '1') { // PayPal if (!$this->_app->hasCredentials('EC')) { $this->description .= '<div class="secWarning">' . $this->_app->getDef('module_ec_error_credentials') . '</div>'; $this->enabled = false; } } else { // Payflow if (!$this->_app->hasCredentials('EC', 'payflow')) { $this->description .= '<div class="secWarning">' . $this->_app->getDef('module_ec_error_credentials_payflow') . '</div>'; $this->enabled = false; } } } if ($this->enabled === true) { if (isset($order) && is_object($order)) { $this->update_status(); } } if (basename($PHP_SELF) == 'shopping_cart.php') { if (OSCOM_APP_PAYPAL_GATEWAY == '1' && OSCOM_APP_PAYPAL_EC_CHECKOUT_FLOW == '1') { if (isset($request_type) && $request_type != 'SSL' && ENABLE_SSL == true) { tep_redirect(tep_href_link('shopping_cart.php', tep_get_all_get_params(), 'SSL')); } header('X-UA-Compatible: IE=edge', true); } } // When changing the shipping address due to no shipping rates being available, head straight to the checkout confirmation page if (basename($PHP_SELF) == 'checkout_payment.php' && tep_session_is_registered('appPayPalEcRightTurn')) { tep_session_unregister('appPayPalEcRightTurn'); if (tep_session_is_registered('payment') && $payment == $this->code) { tep_redirect(tep_href_link('checkout_confirmation.php', '', 'SSL')); } } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '"><span class="glyphicon glyphicon-remove"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } else { $notif_contents = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '"><span class="glyphicon glyphicon-envelope"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } $data = NULL; if ($this->group == 'boxes_product_page') { $data .= '<div class="col-sm-4 product_box">'; } $data .= '<div class="panel panel-default">' . ' <div class="panel-heading">' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_TITLE . '</a></div>' . ' <div class="panel-body">' . $notif_contents . '</div>' . '</div>'; if ($this->group == 'boxes_product_page') { $data .= '</div>'; } $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $PHP_SELF, $lng, $request_type, $oscTemplate, $language; 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) { $languages_string = ''; reset($lng->catalog_languages); foreach ($lng->catalog_languages as $key => $value) { if ($value['directory'] == $language) { $current_lang_key = $key; break; } } reset($lng->catalog_languages); $home_page_redirect = defined('USU5_HOME_PAGE_REDIRECT') && USU5_HOME_PAGE_REDIRECT == 'true' ? true : false; while (list($key, $value) = each($lng->catalog_languages)) { if (defined('USU5_MULTI_LANGUAGE_SEO_SUPPORT') && USU5_MULTI_LANGUAGE_SEO_SUPPORT == 'true' && defined('USU5_ENABLED') && USU5_ENABLED == 'true') { if (false === ($language == $value['directory'])) { // we don't want to show a link to the currently loaded language if (false !== $home_page_redirect) { // If we are using the root site redirect $link = str_replace(array(FILENAME_DEFAULT, '/' . $current_lang_key), '', tep_href_link(FILENAME_DEFAULT)); } else { $link = str_replace('/' . $current_lang_key, '', tep_href_link(FILENAME_DEFAULT)); } if ($key !== DEFAULT_LANGUAGE) { // if it is not the default language we are dealing with if (false === strpos($link, '.php') && false !== $home_page_redirect) { $link_array = explode('?', $link); $qs = array_key_exists(1, $link_array) ? '?' . $link_array[1] : ''; $link = $link_array[0] . FILENAME_DEFAULT . '/' . $key . $qs; } else { $link_array = explode('?', $link); $qs = array_key_exists(1, $link_array) ? '?' . $link_array[1] : ''; $link = str_replace('.php', '.php/' . $key . $qs, $link); } } // USU5 shows the language link and image $languages_string .= ' <a href="' . $link . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } } else { // Just do the standard osCommerce links // Standard osCommerce shows the language link and image $languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_LANGUAGES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents" style="text-align: center;">' . $languages_string . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
function process_options() { global $g_script, $messageStack; $cStrings =& $this->strings; // Prepare the options array for storage $options_array = array('text_pages' => isset($_POST['text_pages']) ? 1 : 0, 'text_collections' => isset($_POST['text_collections']) ? 1 : 0, 'image_collections' => isset($_POST['image_collections']) ? 1 : 0); // Store user options $this->save_options($options_array); $messageStack->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success'); tep_redirect(tep_href_link($g_script, tep_get_all_get_params(array('action')) . 'action=set_options')); }
function process_options() { extract(tep_load('defs', 'message_stack')); $cStrings =& $this->strings; // Prepare the options array for storage $options_array = array('max_cols' => isset($_POST['max_cols']) && $_POST['max_cols'] > 0 ? (int) $_POST['max_cols'] : $options_array['max_cols'], 'max_drop' => isset($_POST['max_drop']) && $_POST['max_drop'] > 0 ? (int) $_POST['max_drop'] : $options_array['max_drop'], 'max_width' => isset($_POST['max_width']) && $_POST['max_width'] > 0 ? (int) $_POST['max_width'] : $options_array['max_width'], 'border_width' => isset($_POST['border_width']) ? (int) $_POST['border_width'] : $options_array['border_width'], 'font_size' => isset($_POST['font_size']) && $_POST['font_size'] > 0 ? (int) $_POST['font_size'] : $options_array['font_size'], 'font_pad' => isset($_POST['font_pad']) ? (int) $_POST['font_pad'] : $options_array['font_pad']); // Store user options $this->save_options($options_array); $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success'); tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action') . 'action=set_options')); }
function process_options() { extract(tep_load('defs', 'message_stack')); $cStrings =& $this->strings; // Prepare the options array for storage $options_array = $this->load_options(); $options_array['text_pages'] = isset($_POST['text_pages']) ? 1 : 0; $options_array['text_collections'] = isset($_POST['text_collections']) ? 1 : 0; $options_array['image_collections'] = isset($_POST['image_collections']) ? 1 : 0; // Store user options $this->save_options($options_array); $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success'); tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action') . 'action=set_options')); }
function execute() { global $PHP_SELF, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { $languages = $this->lang->getAll(); $languages_string = ''; foreach ($languages as $code => $value) { $languages_string .= ' <a href="' . OSCOM::link($PHP_SELF, tep_get_all_get_params(array('language', 'currency')) . 'language=' . $code) . '">' . $this->lang->getImage($value['code']) . '</a> '; } ob_start(); include 'includes/modules/boxes/templates/languages.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
public function execute() { global $login_customer_id, $oscTemplate, $breadcrumb; $this->page->setFile('login.php'); // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started) if (session_status() !== PHP_SESSION_ACTIVE) { if (!isset($_GET['cookie_test'])) { $all_get = tep_get_all_get_params(['Account', 'LogIn', 'Process']); OSCOM::redirect('index.php', 'Account&LogIn&' . $all_get . (empty($all_get) ? '' : '&') . 'cookie_test=1', 'SSL'); } OSCOM::redirect('cookie_usage.php'); } // login content module must return $login_customer_id as an integer after successful customer authentication $login_customer_id = false; $this->page->data['content'] = $oscTemplate->getContent('login'); require OSCOM::BASE_DIR . 'languages/' . $_SESSION['language'] . '/login.php'; $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('index.php', 'Account&LogIn', 'SSL')); }
function execute() { global $PHP_SELF, $lng, $request_type, $oscTemplate; 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) { $languages_string = ''; foreach ($lng->catalog_languages as $key => $value) { $languages_string .= ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } $data = '<div class="panel panel-default">' . ' <div class="panel-heading">' . MODULE_BOXES_LANGUAGES_BOX_TITLE . '</div>' . ' <div class="panel-body text-center">' . $languages_string . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
function execute() { global $PHP_SELF, $lng, $request_type, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (!isset($lng) || isset($lng) && !is_object($lng)) { $lng = new language(); } if (count($lng->catalog_languages) > 1) { $languages_string = ''; foreach ($lng->catalog_languages as $key => $value) { $languages_string .= ' <a href="' . OSCOM::link($PHP_SELF, tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . HTML::image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name'], NULL, NULL, NULL, false) . '</a> '; } ob_start(); include 'includes/modules/boxes/templates/languages.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } } }
function execute() { global $PHP_SELF, $lng, $request_type, $oscTemplate; 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) { $languages_string = ''; reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { $languages_string .= ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> '; } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_LANGUAGES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents" style="text-align: center;">' . $languages_string . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<table border="0" cellspacing="0" cellpadding="2" class="ui-widget-content infoBoxContents"><tr><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'; } else { $notif_contents = '<table border="0" cellspacing="0" cellpadding="2" class="ui-widget-content infoBoxContents"><tr><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'; } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading"><a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_TITLE . '</a></div>' . ' ' . $notif_contents . '</div>'; $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = ' <ul class="module-content">' . ' <li>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_draw_icon('fa-chain-broken') . '</a>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>' . ' </li>' . ' </ul>'; } else { $notif_contents = ' <ul class="module-content">' . ' <li>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_draw_icon('fa-pencil-square-o') . '</a>' . ' <a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>' . ' </li>' . ' </ul>'; } $data = '<div class="module notify-box">' . ' <h3 class="module-heading"><a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_TITLE . '</a></h3>' . ' ' . $notif_contents . '</div>'; $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $oID; $output = ''; $status = array(); $ppstatus_query = tep_db_query("select comments from orders_status_history where orders_id = '" . (int) $oID . "' and orders_status_id = '" . (int) OSCOM_APP_PAYPAL_TRANSACTIONS_ORDER_STATUS_ID . "' and comments like 'Transaction ID:%' order by date_added desc limit 1"); if (tep_db_num_rows($ppstatus_query)) { $ppstatus = tep_db_fetch_array($ppstatus_query); foreach (explode("\n", $ppstatus['comments']) as $s) { if (!empty($s) && strpos($s, ':') !== false) { $entry = explode(':', $s, 2); $status[trim($entry[0])] = trim($entry[1]); } } if (isset($status['Transaction ID'])) { $order_query = tep_db_query("select o.orders_id, o.payment_method, o.currency, o.currency_value, ot.value as total from orders o, orders_total ot where o.orders_id = '" . (int) $oID . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total'"); $order = tep_db_fetch_array($order_query); $pp_server = strpos(strtolower($order['payment_method']), 'sandbox') !== false ? 'sandbox' : 'live'; $info_button = $this->_app->drawButton($this->_app->getDef('button_details'), tep_href_link('orders.php', 'page=' . $_GET['page'] . '&oID=' . $oID . '&action=edit&tabaction=getTransactionDetails'), 'primary', null, true); $capture_button = $this->getCaptureButton($status, $order); $void_button = $this->getVoidButton($status, $order); $refund_button = $this->getRefundButton($status, $order); $paypal_button = $this->_app->drawButton($this->_app->getDef('button_view_at_paypal'), 'https://www.' . ($pp_server == 'sandbox' ? 'sandbox.' : '') . 'paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=' . $status['Transaction ID'], 'info', 'target="_blank"', true); $tab_title = addslashes($this->_app->getDef('tab_title')); $tab_link = substr(tep_href_link('orders.php', tep_get_all_get_params()), strlen($base_url)) . '#section_paypal_content'; $output = <<<EOD <script> \$(function() { \$('#orderTabs ul').append('<li><a href="{$tab_link}">{$tab_title}</a></li>'); }); </script> <div id="section_paypal_content" style="padding: 10px;"> {$info_button} {$capture_button} {$void_button} {$refund_button} {$paypal_button} </div> EOD; } } return $output; }
function execute() { global $PHP_SELF, $request_type, $oscTemplate; if (isset($_GET['products_id'])) { if (isset($_SESSION['customer_id'])) { $Qcheck = Registry::get('Db')->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $_GET['products_id']]); $notification_exists = $Qcheck->fetch() !== false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '"><span class="glyphicon glyphicon-remove"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($_GET['products_id'])) . '</a>'; } else { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '"><span class="glyphicon glyphicon-envelope"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($_GET['products_id'])) . '</a>'; } ob_start(); include 'includes/modules/boxes/templates/product_notifications.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $PHP_SELF, $oscTemplate; if (isset($_GET['products_id'])) { if (isset($_SESSION['customer_id'])) { $Qcheck = Registry::get('Db')->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => (int) $_GET['products_id']]); $notification_exists = $Qcheck->fetch() !== false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove') . '"><span class="fa fa-remove"></span> ' . OSCOM::getDef('module_boxes_product_notifications_box_notify_remove', ['products_name' => tep_get_products_name($_GET['products_id'])]) . '</a>'; } else { $notif_contents = '<a href="' . OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify') . '"><span class="fa fa-envelope"></span> ' . OSCOM::getDef('module_boxes_product_notifications_box_notify', ['products_name' => tep_get_products_name($_GET['products_id'])]) . '</a>'; } ob_start(); include 'includes/modules/boxes/templates/product_notifications.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
function execute() { global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $notif_contents = ''; if ($notification_exists == true) { $notif_contents = '<a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '"><span class="glyphicon glyphicon-remove"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } else { $notif_contents = '<a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '"><span class="glyphicon glyphicon-envelope"></span> ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a>'; } ob_start(); include DIR_WS_MODULES . 'boxes/templates/product_notifications.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } }
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="module-content box-list">'; $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>' . ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a>' . ' <a class="remove" href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_draw_icon('fa-shopping-cart') . '</a>' . ' </li>'; } $customer_orders_string .= '</ul>'; $data = '<div class="module order-history">' . ' <h3 class="module-heading">' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '</h3>' . ' ' . $customer_orders_string . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
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 = '<table border="0" width="100%" cellspacing="0" cellpadding="1" class="ui-widget-content infoBoxContents">'; $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 .= ' <tr>' . ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' . ' <td align="right" valign="top"><a href="' . tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' . ' </tr>'; } $customer_orders_string .= '</table>'; $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '</div>' . ' ' . $customer_orders_string . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
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 = NULL; $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($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id']) . '"><span class="fa fa-shopping-cart"></span></a></span><a href="' . tep_href_link('product_info.php', 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></li>'; } ob_start(); include 'includes/modules/boxes/templates/order_history.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } } }
} OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action'))); } else { $_SESSION['navigation']->set_snapshot(); OSCOM::redirect('login.php', '', 'SSL'); } break; case 'cust_order': if (isset($_SESSION['customer_id']) && isset($_GET['pid'])) { if (tep_has_product_attributes($_GET['pid'])) { OSCOM::redirect('product_info.php', 'products_id=' . $_GET['pid']); } else { $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid']) + 1); } } OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; } } // include the who's online functions require 'includes/functions/whos_online.php'; tep_update_whos_online(); // include the password crypto functions require 'includes/functions/password_funcs.php'; // include validation functions (right now only email address) require 'includes/functions/validations.php'; // auto activate and expire banners require 'includes/functions/banner.php'; tep_activate_banners(); tep_expire_banners(); // auto expire special products
} new productListingBox($list_box_contents); } if ($flag1 == 0) { echo "Không có phòng thỏa điều kiện tìm kiếm!"; } if ($listing_split->number_of_rows > 0 && (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') && $flag1 == 1) { ?> <?php echo tep_draw_result_bottom(); echo tep_draw_result_top_2(); ?> <table border="0" width="100%" cellspacing="0" cellpadding="0" class="result"> <tr> <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> </td> <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> </td> </tr> </table> <?php echo tep_draw_result_bottom_2(); } ?>
function process_options() { extract(tep_load('defs', 'message_stack')); $cStrings =& $this->strings; if (!isset($_POST['admin_key_length']) || (int) $_POST['admin_key_length'] < $this->admin_min_key_length) { $msg->add_session(sprintf($cStrings->WARNING_PLUGIN_ADMIN_KEY_LENGTH, $this->admin_min_key_length), 'warning'); $_POST['admin_key_length'] = $this->admin_min_key_length; } // Prepare the options array for storage $options_array = array('text_pages' => isset($_POST['text_pages']) ? 1 : 0, 'text_collections' => isset($_POST['text_collections']) ? 1 : 0, 'admin_key' => tep_create_random_value((int) $_POST['admin_key_length'], 'chars_lower'), 'admin_key_length' => (int) $_POST['admin_key_length']); // Store user options $this->save_options($options_array); $msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success'); tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action') . 'action=set_options')); }
</tr> <?php } ?> <tr> <td colspan="9"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"> <?php echo $paginator->display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_RECORDS); ?> </td> <td class="smallText" align="right"> <?php echo $paginator->display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'uid'))); ?> </td> </tr> </table> </td> </tr> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'delete': $heading[] = array('text' => '<strong>' . $nInfo->title . '</strong>'); $contents = array('form' => tep_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
<td class="seoHead"><?php echo HEADING_TITLE_CHECK_LINKS; ?> </td> </tr> <tr> <td class="seo_subHead"><?php echo TEXT_CHECK_LINKS; ?> </td> </tr> </table></td> </tr> <tr> <td align="right" > <?php echo tep_draw_form('check_links', FILENAME_SEO_ASSISTANT, tep_get_all_get_params(array('action2')) . 'action2=' . $form_action, 'post'); ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '10'); ?> </td> </tr> <tr class="infoBoxContents"> <td><table border="0" cellspacing="2" cellpadding="2"> <tr> <td>Enter URL: </td> <td><?php echo tep_draw_input_field('check_page', tep_not_null($searchurl) ? $searchurl : '', 'maxlength="255", size="40"', false);
echo $module_title; ?> </td> <td class="dataTableContent"><?php echo tep_output_string_protected($actions['user_name']) . ' [' . (int) $actions['user_id'] . ']'; ?> </td> <td class="dataTableContent" align="right"><?php echo tep_datetime_short($actions['date_added']); ?> </td> <td class="dataTableContent" align="right"><?php if (isset($aInfo) && is_object($aInfo) && $actions['id'] == $aInfo->id) { echo tep_image('images/icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link('action_recorder.php', tep_get_all_get_params(array('aID')) . 'aID=' . $actions['id']) . '">' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } ?> <tr> <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $actions_split->display_count($actions_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ENTRIES); ?> </td> <td class="smallText" align="right"><?php
Released under the GNU General Public License */ if (isset($HTTP_GET_VARS['products_id'])) { ?> <!-- notifications //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_NOTIFICATIONS); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')); if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int) $customer_id . "'"); $check = tep_db_fetch_array($check_query); $notification_exists = $check['count'] > 0 ? true : false; } else { $notification_exists = false; } $info_box_contents = array(); if ($notification_exists == true) { $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'); } else { $info_box_contents[] = array('text' => '<table border="0" cellspacing="0" cellpadding="2"><tr><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) . '</a></td></tr></table>'); } new infoBox($info_box_contents); ?> </td> </tr> <!-- notifications_eof //--> <?php }
if (tep_not_null($product_info['products_image'])) { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> '); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> <?php } echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>'; ?> </td> </tr> </table> </td> </table></td> </tr> </table></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?> " valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>