diff --git a/catalog/account.php b/catalog/account.php index b341c672d..210fa1b89 100644 --- a/catalog/account.php +++ b/catalog/account.php @@ -5,26 +5,30 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account.php'); - $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('account.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

+ size('account') > 0) { @@ -41,6 +45,6 @@ diff --git a/catalog/account_edit.php b/catalog/account_edit.php index 6ef438bde..d6b990157 100644 --- a/catalog/account_edit.php +++ b/catalog/account_edit.php @@ -5,29 +5,32 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_edit.php'); - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { - if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); - $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); - $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); - if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); - $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); - $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']); - $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']); + if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { + if (ACCOUNT_GENDER == 'true') $gender = HTML::sanitize($_POST['gender']); + $firstname = HTML::sanitize($_POST['firstname']); + $lastname = HTML::sanitize($_POST['lastname']); + if (ACCOUNT_DOB == 'true') $dob = HTML::sanitize($_POST['dob']); + $email_address = HTML::sanitize($_POST['email_address']); + $telephone = HTML::sanitize($_POST['telephone']); + $fax = HTML::sanitize($_POST['fax']); $error = false; @@ -59,21 +62,18 @@ } } - if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { - $error = true; - - $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR); - } - if (!tep_validate_email($email_address)) { $error = true; $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } - $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . (int)$customer_id . "'"); - $check_email = tep_db_fetch_array($check_email_query); - if ($check_email['total'] > 0) { + $Qcheck = $OSCOM_Db->prepare('select customers_id from :table_customers where customers_email_address = :customers_email_address and customers_id != :customers_id limit 1'); + $Qcheck->bindValue(':customers_email_address', $email_address); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { $error = true; $messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); @@ -95,35 +95,36 @@ if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob); - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'"); - - tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers', $sql_data_array, ['customers_id' => (int)$_SESSION['customer_id']]); + $OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()'], ['customers_info_id' => (int)$_SESSION['customer_id']]); - $sql_data_array = array('entry_firstname' => $firstname, - 'entry_lastname' => $lastname); + $sql_data_array = ['entry_firstname' => $firstname, + 'entry_lastname' => $lastname]; - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$customer_default_address_id . "'"); + $OSCOM_Db->save('address_book', $sql_data_array, ['customers_id' => (int)$_SESSION['customer_id'], 'address_book_id' => (int)$_SESSION['customer_default_address_id']]); // reset the session variables - $customer_first_name = $firstname; + $_SESSION['customer_first_name'] = $firstname; $messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success'); - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } } - $account_query = tep_db_query("select customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_telephone, customers_fax from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); - $account = tep_db_fetch_array($account_query); + $Qaccount = $OSCOM_Db->prepare('select * from :table_customers where customers_id = :customers_id'); + $Qaccount->bindInt(':customers_id', $_SESSION['customer_id']); + $Qaccount->execute(); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_edit.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); - require('includes/form_check.js.php'); + require('includes/template_top.php'); ?> -

+ size('account_edit') > 0) { @@ -131,86 +132,104 @@ } ?> - + true, 'action' => 'process']); ?>
-
-
- -

-
- -
- +
value('customers_gender') == 'm') ? true : false; } $female = !$male; ?> - - - - +
+ +
+ + + + ' . ENTRY_GENDER_TEXT . ''; ?> +
+
- - - - - - - - +
+ +
+ value('customers_firstname'), 'minlength="' . ENTRY_FIRST_NAME_MIN_LENGTH . '" required aria-required="true" id="inputFirstName" placeholder="' . ENTRY_FIRST_NAME_TEXT . '"'); ?> + +
+
+
+ +
+ value('customers_lastname'), 'minlength="' . ENTRY_LAST_NAME_MIN_LENGTH . '" required aria-required="true" id="inputLastName" placeholder="' . ENTRY_LAST_NAME_TEXT . '"'); ?> + +
+
- - - - +
+ +
+ value('customers_dob')), 'minlength="' . ENTRY_DOB_MIN_LENGTH . '" required aria-required="true" id="dob" placeholder="' . ENTRY_DATE_OF_BIRTH_TEXT . '"'); ?> + +
+
- - - - - - - - - - - - -
' . ENTRY_GENDER_TEXT . '': ''); ?>
' . ENTRY_FIRST_NAME_TEXT . '': ''); ?>
' . ENTRY_LAST_NAME_TEXT . '': ''); ?>
' . ENTRY_DATE_OF_BIRTH_TEXT . '': ''); ?>
' . ENTRY_EMAIL_ADDRESS_TEXT . '': ''); ?>
' . ENTRY_TELEPHONE_NUMBER_TEXT . '': ''); ?>
' . ENTRY_FAX_NUMBER_TEXT . '': ''); ?>
+
+ +
+ value('customers_email_address'), 'required aria-required="true" id="inputEmail" placeholder="' . ENTRY_EMAIL_ADDRESS_TEXT . '"', 'email'); ?> + +
+
+
+ +
+ value('customers_telephone'), 'minlength="' . ENTRY_TELEPHONE_MIN_LENGTH . '" required aria-required="true" id="inputTelephone" placeholder="' . ENTRY_TELEPHONE_NUMBER_TEXT . '"', 'tel'); ?> + +
+
+
+ +
+ value('customers_fax'), 'id="inputFax" placeholder="' . ENTRY_FAX_NUMBER_TEXT . '"'); ?> +
+
-
-
- +
- +
+
+
+
-
diff --git a/catalog/account_history.php b/catalog/account_history.php index ce02eea97..c9bc4710e 100644 --- a/catalog/account_history.php +++ b/catalog/account_history.php @@ -5,78 +5,89 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_history.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_history.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

+
0) { - $history_query_raw = "select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.public_flag = '1' order by orders_id DESC"; - $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY); - $history_query = tep_db_query($history_split->sql_query); - - while ($history = tep_db_fetch_array($history_query)) { - $products_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$history['orders_id'] . "'"); - $products = tep_db_fetch_array($products_query); - - if (tep_not_null($history['delivery_name'])) { + $Qorders = $OSCOM_Db->prepare('select SQL_CALC_FOUND_ROWS o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from :table_orders o, :table_orders_total ot, :table_orders_status s where o.customers_id = :customers_id and o.orders_id = ot.orders_id and ot.class = "ot_total" and o.orders_status = s.orders_status_id and s.language_id = :language_id and s.public_flag = "1" order by o.orders_id desc limit :page_set_offset, :page_set_max_results'); + $Qorders->bindInt(':customers_id', $_SESSION['customer_id']); + $Qorders->bindInt(':language_id', $_SESSION['languages_id']); + $Qorders->setPageSet(MAX_DISPLAY_ORDER_HISTORY); + $Qorders->execute(); + + if ($Qorders->getPageSetTotalRows() > 0) { + foreach ($Qorders->fetchAll() as $order) { + $Qproducts = $OSCOM_Db->prepare('select count(*) as count from :table_orders_products where orders_id = :orders_id'); + $Qproducts->bindInt(':orders_id', $order['orders_id']); + $Qproducts->execute(); + + if (tep_not_null($order['delivery_name'])) { $order_type = TEXT_ORDER_SHIPPED_TO; - $order_name = $history['delivery_name']; + $order_name = $order['delivery_name']; } else { $order_type = TEXT_ORDER_BILLED_TO; - $order_name = $history['billing_name']; + $order_name = $order['billing_name']; } ?> -

(' . $history['orders_status_name'] . ')'; ?>

-
- - - - - - -
' . TEXT_ORDER_DATE . ' ' . tep_date_long($history['date_purchased']) . '
' . $order_type . ' ' . tep_output_string_protected($order_name); ?>
' . TEXT_ORDER_PRODUCTS . ' ' . $products['count'] . '
' . TEXT_ORDER_COST . ' ' . strip_tags($history['order_total']); ?>
+
+
(' . HTML::outputProtected($order['orders_status_name']) . ')'; ?>
+
+
+
' . TEXT_ORDER_DATE . ' ' . tep_date_long($order['date_purchased']) . '
' . $order_type . ' ' . HTML::outputProtected($order_name); ?>
+
+
' . TEXT_ORDER_PRODUCTS . ' ' . $Qproducts->valueInt('count') . '
' . TEXT_ORDER_COST . ' ' . strip_tags($order['order_total']); ?>
+
+
+
-
-

display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?>

- -

display_count(TEXT_DISPLAY_NUMBER_OF_ORDERS); ?>

+
+ +
+ + +
-
+

@@ -84,12 +95,12 @@ } ?> -
- +
+
diff --git a/catalog/account_history_info.php b/catalog/account_history_info.php index ff5c6954d..610cb33f8 100644 --- a/catalog/account_history_info.php +++ b/catalog/account_history_info.php @@ -5,102 +5,79 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } - if (!isset($HTTP_GET_VARS['order_id']) || (isset($HTTP_GET_VARS['order_id']) && !is_numeric($HTTP_GET_VARS['order_id']))) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); + if (!isset($_GET['order_id']) || !is_numeric($_GET['order_id'])) { + OSCOM::redirect('account_history.php', '', 'SSL'); } - - $customer_info_query = tep_db_query("select o.customers_id from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.orders_id = '". (int)$HTTP_GET_VARS['order_id'] . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.public_flag = '1'"); - $customer_info = tep_db_fetch_array($customer_info_query); - if ($customer_info['customers_id'] != $customer_id) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); + + $Qcheck = $OSCOM_Db->prepare('select o.customers_id from :table_orders o, :table_orders_status s where o.orders_id = :orders_id and o.orders_status = s.orders_status_id and s.language_id = :language_id and s.public_flag = "1"'); + $Qcheck->bindInt(':orders_id', $_GET['order_id']); + $Qcheck->bindInt(':language_id', $_SESSION['languages_id']); + $Qcheck->execute(); + + if (($Qcheck->fetch() === false) || ($Qcheck->valueInt('customers_id') != $_SESSION['customer_id'])) { + OSCOM::redirect('account_history.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_HISTORY_INFO); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_history_info.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL')); - $breadcrumb->add(sprintf(NAVBAR_TITLE_3, $HTTP_GET_VARS['order_id']), tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $HTTP_GET_VARS['order_id'], 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_history.php', '', 'SSL')); + $breadcrumb->add(sprintf(NAVBAR_TITLE_3, $_GET['order_id']), OSCOM::link('account_history_info.php', 'order_id=' . $_GET['order_id'], 'SSL')); require(DIR_WS_CLASSES . 'order.php'); - $order = new order($HTTP_GET_VARS['order_id']); + $order = new order($_GET['order_id']); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

+
-

(' . $order->info['orders_status'] . ')'; ?>

-
- info['total']; ?> - info['date_purchased']); ?> -
- - - -delivery != false) { -?> - - - - -
- - - - - - -info['shipping_method'])) { -?> - - - - - - - -
delivery['format_id'], $order->delivery, 1, ' ', '
'); ?>
info['shipping_method']; ?>
+
+
' . $order->info['orders_status'] . ''; ?>
+
+
info['tax_groups']) > 1) { ?> - - - + + + - - + + products); $i<$n; $i++) { echo ' ' . "\n" . - ' ' . "\n" . + ' ' . "\n" . ' ' . "\n"; if (sizeof($order->info['tax_groups']) > 1) { - echo ' ' . "\n"; + echo ' ' . "\n"; } - echo ' ' . "\n" . + echo ' ' . "\n" . ' ' . "\n"; } ?> -
' . $order->products[$i]['qty'] . ' x ' . $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name']; if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) { @@ -112,82 +89,126 @@ echo '' . tep_display_tax_value($order->products[$i]['tax']) . '%' . tep_display_tax_value($order->products[$i]['tax']) . '%' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '
-
- -

- -
- - - - - -
- - - - - - - - - - - - -
billing['format_id'], $order->billing, 1, ' ', '
'); ?>
info['payment_method']; ?>
+
+
+ totals); $i<$n; $i++) { echo ' ' . "\n" . - ' ' . "\n" . + ' ' . "\n" . ' ' . "\n" . ' ' . "\n"; } ?> -
' . $order->totals[$i]['title'] . '' . $order->totals[$i]['title'] . ' ' . $order->totals[$i]['text'] . '
+ +
+ +
+ +
+ +
+ +
+ delivery != false) { + ?> +
+
+
' . HEADING_DELIVERY_ADDRESS . ''; ?>
+
+ delivery['format_id'], $order->delivery, 1, ' ', '
'); ?> +
+
+
+ +
+
+
' . HEADING_BILLING_ADDRESS . ''; ?>
+
+ billing['format_id'], $order->billing, 1, ' ', '
'); ?> +
+
+
+ + info['shipping_method']) { + ?> +
+
+
' . HEADING_SHIPPING_METHOD . ''; ?>
+
+ info['shipping_method']; ?> +
+
+
+ +
+
+
' . HEADING_PAYMENT_METHOD . ''; ?>
+
+ info['payment_method']; ?> +
+
+
-

+
+ +
- - - - -
-' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n"; - } -?> -
' . tep_date_short($statuses['date_added']) . '' . $statuses['orders_status_name'] . '' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '
+
    + prepare('select os.orders_status_name, osh.date_added, osh.comments from :table_orders_status os, :table_orders_status_history osh where osh.orders_id = :orders_id and osh.orders_status_id = os.orders_status_id and os.language_id = :language_id and os.public_flag = "1" order by osh.date_added'); + $Qstatuses->bindInt(':orders_id', $_GET['order_id']); + $Qstatuses->bindInt(':language_id', $_SESSION['languages_id']); + $Qstatuses->execute(); + + while ($Qstatuses->fetch()) { + echo '
  • '; + echo '
    '; + echo '
    '; + echo '
    '; + echo '

    ' . tep_date_short($Qstatuses->value('date_added')) . '

    ' . $Qstatuses->value('orders_status_name') . '

    '; + echo '
    '; + echo '
    '; + echo '

    ' . (tep_not_null($Qstatuses->value('comments')) ? nl2br($Qstatuses->valueProtected('comments')) : TEXT_NO_COMMENTS) . '

    '; + echo '
    '; + echo '
    '; + echo '
  • '; + } + ?> +
-
- +
+
+
+h diff --git a/catalog/account_newsletters.php b/catalog/account_newsletters.php index eaa19226e..41fcd8a13 100644 --- a/catalog/account_newsletters.php +++ b/catalog/account_newsletters.php @@ -5,74 +5,80 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NEWSLETTERS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_newsletters.php'); - $newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); - $newsletter = tep_db_fetch_array($newsletter_query); + $Qnewsletter = $OSCOM_Db->prepare('select customers_newsletter from :table_customers where customers_id = :customers_id'); + $Qnewsletter->bindInt(':customers_id', $_SESSION['customer_id']); + $Qnewsletter->execute(); - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { - if (isset($HTTP_POST_VARS['newsletter_general']) && is_numeric($HTTP_POST_VARS['newsletter_general'])) { - $newsletter_general = tep_db_prepare_input($HTTP_POST_VARS['newsletter_general']); - } else { - $newsletter_general = '0'; - } + if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { + $newsletter_general = (isset($_POST['newsletter_general']) && ($_POST['newsletter_general'] == '1')) ? 1 : 0; - if ($newsletter_general != $newsletter['customers_newsletter']) { - $newsletter_general = (($newsletter['customers_newsletter'] == '1') ? '0' : '1'); + if ($newsletter_general !== $Qnewsletter->valueInt('customers_newsletter')) { + $newsletter_general = ($Qnewsletter->valueInt('customers_newsletter') === 1) ? 0 : 1; - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '" . (int)$newsletter_general . "' where customers_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers', ['customers_newsletter' => $newsletter_general], ['customers_id' => $_SESSION['customer_id']]); } $messageStack->add_session('account', SUCCESS_NEWSLETTER_UPDATED, 'success'); - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_newsletters.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

+ - + true, 'action' => 'process']); ?>
-

- - - - - -

+
+ +
+
+ +
+
+
-
- - - +
+
+
+
diff --git a/catalog/account_notifications.php b/catalog/account_notifications.php index 621506301..edce3946f 100644 --- a/catalog/account_notifications.php +++ b/catalog/account_notifications.php @@ -5,137 +5,171 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_NOTIFICATIONS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_notifications.php'); - $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'"); - $global = tep_db_fetch_array($global_query); + $Qglobal = $OSCOM_Db->prepare('select global_product_notifications from :table_customers_info where customers_info_id = :customers_info_id'); + $Qglobal->bindInt(':customers_info_id', $_SESSION['customer_id']); + $Qglobal->execute(); - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { - if (isset($HTTP_POST_VARS['product_global']) && is_numeric($HTTP_POST_VARS['product_global'])) { - $product_global = tep_db_prepare_input($HTTP_POST_VARS['product_global']); + if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { + if (isset($_POST['product_global']) && is_numeric($_POST['product_global']) && in_array($_POST['product_global'], ['0', '1'])) { + $product_global = (int)$_POST['product_global']; } else { - $product_global = '0'; + $product_global = 0; } - (array)$products = $HTTP_POST_VARS['products']; + (array)$products = $_POST['products']; - if ($product_global != $global['global_product_notifications']) { - $product_global = (($global['global_product_notifications'] == '1') ? '0' : '1'); + if ($product_global !== $Qglobal->valueInt('global_product_notifications')) { + $product_global = ($Qglobal->valueInt('global_product_notifications') === 1) ? 0 : 1; - tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set global_product_notifications = '" . (int)$product_global . "' where customers_info_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers_info', ['global_product_notifications' => $product_global], ['customers_info_id' => $_SESSION['customer_id']]); } elseif (sizeof($products) > 0) { $products_parsed = array(); - reset($products); - while (list(, $value) = each($products)) { - if (is_numeric($value)) { + foreach ($products as $value) { + if (is_numeric($value) && !in_array($value, $products_parsed)) { $products_parsed[] = $value; } } if (sizeof($products_parsed) > 0) { - $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "' and products_id not in (" . implode(',', $products_parsed) . ")"); - $check = tep_db_fetch_array($check_query); + $products_id_in = array_map(function($k) { + return ':products_id_' . $k; + }, array_keys($products_parsed)); + + $Qcheck = $OSCOM_Db->prepare('select products_id from :table_products_notifications where customers_id = :customers_id and products_id not in (' . implode(', ', $products_id_in) . ') limit 1'); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); - if ($check['total'] > 0) { - tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "' and products_id not in (" . implode(',', $products_parsed) . ")"); + foreach ($products_parsed as $k => $v) { + $Qcheck->bindInt(':products_id_' . $k, $v); + } + + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { + $Qdelete = $OSCOM_Db->prepare('delete from :table_products_notifications where customers_id = :customers_id and products_id not in (' . implode(', ', $products_id_in) . ')'); + $Qdelete->bindInt(':customers_id', $_SESSION['customer_id']); + + foreach ($products_parsed as $k => $v) { + $Qdelete->bindInt(':products_id_' . $k, $v); + } + + $Qdelete->execute(); } } } else { - $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'"); - $check = tep_db_fetch_array($check_query); + $Qcheck = $OSCOM_Db->prepare('select products_id from :table_products_notifications where customers_id = :customers_id limit 1'); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); - if ($check['total'] > 0) { - tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where customers_id = '" . (int)$customer_id . "'"); + if ($Qcheck->fetch() !== false) { + $OSCOM_Db->delete('products_notifications', ['customers_id' => $_SESSION['customer_id']]); } } $messageStack->add_session('account', SUCCESS_NOTIFICATIONS_UPDATED, 'success'); - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_notifications.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

+ - + true, 'action' => 'process']); ?>
-

- -
+
-

-
- - - - - -

+
+ +
+
+ +
+
+
valueInt('global_product_notifications') !== 1) { ?> -

-
0) { + $Qcheck = $OSCOM_Db->prepare('select products_id from :table_products_notifications where customers_id = :customers_id limit 1'); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { ?> -
+
+
- +
+
+ +
-
- - - + $Qproducts = $OSCOM_Db->prepare('select pd.products_id, pd.products_name from :table_products_description pd, :table_products_notifications pn where pn.customers_id = :customers_id and pn.products_id = pd.products_id and pd.language_id = :language_id order by pd.products_name'); + $Qproducts->bindInt(':customers_id', $_SESSION['customer_id']); + $Qproducts->bindInt(':language_id', $_SESSION['languages_id']); + $Qproducts->execute(); + while ($Qproducts->fetch()) { +?> +
+ +
-
+
+
+
-
+
@@ -149,16 +183,15 @@ } ?> -
- - - +
+
+
diff --git a/catalog/account_password.php b/catalog/account_password.php index 1cc9e2d0b..578257f8b 100644 --- a/catalog/account_password.php +++ b/catalog/account_password.php @@ -5,25 +5,28 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_PASSWORD); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_password.php'); - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { - $password_current = tep_db_prepare_input($HTTP_POST_VARS['password_current']); - $password_new = tep_db_prepare_input($HTTP_POST_VARS['password_new']); - $password_confirmation = tep_db_prepare_input($HTTP_POST_VARS['password_confirmation']); + if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { + $password_current = HTML::sanitize($_POST['password_current']); + $password_new = HTML::sanitize($_POST['password_new']); + $password_confirmation = HTML::sanitize($_POST['password_confirmation']); $error = false; @@ -38,17 +41,17 @@ } if ($error == false) { - $check_customer_query = tep_db_query("select customers_password from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); - $check_customer = tep_db_fetch_array($check_customer_query); - - if (tep_validate_password($password_current, $check_customer['customers_password'])) { - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password_new) . "' where customers_id = '" . (int)$customer_id . "'"); + $Qcheck = $OSCOM_Db->prepare('select customers_password from :table_customers where customers_id = :customers_id'); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); - tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'"); + if (tep_validate_password($password_current, $Qcheck->value('customers_password'))) { + $OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password_new)], ['customers_id' => (int)$_SESSION['customer_id']]); + $OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()'], ['customers_info_id' => (int)$_SESSION['customer_id']]); $messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success'); - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } else { $error = true; @@ -57,14 +60,15 @@ } } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_password.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); - require('includes/form_check.js.php'); + require('includes/template_top.php'); ?> -

+ size('account_password') > 0) { @@ -72,41 +76,46 @@ } ?> - + true, 'action' => 'process']); ?>
-
- -

-
+ +

- - - - - - - - - - - - - -
' . ENTRY_PASSWORD_CURRENT_TEXT . '': ''); ?>
' . ENTRY_PASSWORD_NEW_TEXT . '': ''); ?>
' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '': ''); ?>
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
-
- - - +
+
+
+
diff --git a/catalog/address_book.php b/catalog/address_book.php index c91aff935..fc54221b4 100644 --- a/catalog/address_book.php +++ b/catalog/address_book.php @@ -5,27 +5,32 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/address_book.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('address_book.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

+ size('addressbook') > 0) { @@ -34,63 +39,74 @@ ?>
-

+ -
-
-
+
+
+
+
+
+
+
-
- '); ?> +
+ '); ?> +
- -
-
+
-

+ -
+
+
- -
- -

' . PRIMARY_ADDRESS . ''; ?>

-

'); ?>

-
+ $Qab = $OSCOM_Db->prepare('select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from :table_address_book where customers_id = :customers_id order by firstname, lastname'); + $Qab->bindInt(':customers_id', $_SESSION['customer_id']); + $Qab->execute(); + while ($Qab->fetch()) { + $format_id = tep_get_address_format_id($Qab->valueInt('country_id')); +?> +
+
+
value('firstname') . ' ' . $Qab->value('lastname')); ?>valueInt('address_book_id') == $_SESSION['customer_default_address_id']) echo ' ' . PRIMARY_ADDRESS . ''; ?>
+
+ toArray(), true, ' ', '
'); ?> +
+ +
+
-
-
+
+
- +
- - +
-

diff --git a/catalog/address_book_process.php b/catalog/address_book_process.php index 13c9b40b2..f83825cba 100644 --- a/catalog/address_book_process.php +++ b/catalog/address_book_process.php @@ -5,55 +5,58 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/address_book_process.php'); - if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'deleteconfirm') && isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete']) && isset($HTTP_GET_VARS['formid']) && ($HTTP_GET_VARS['formid'] == md5($sessiontoken))) { - if ((int)$HTTP_GET_VARS['delete'] == $customer_default_address_id) { + if (isset($_GET['action']) && ($_GET['action'] == 'deleteconfirm') && isset($_GET['delete']) && is_numeric($_GET['delete']) && isset($_GET['formid']) && ($_GET['formid'] == md5($_SESSION['sessiontoken']))) { + if ((int)$_GET['delete'] == $_SESSION['customer_default_address_id']) { $messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning'); } else { - tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->delete('address_book', ['address_book_id' => (int)$_GET['delete'], 'customers_id' => (int)$_SESSION['customer_id']]); $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success'); } - tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + OSCOM::redirect('address_book.php', '', 'SSL'); } // error checking when updating or adding an entry $process = false; - if (isset($HTTP_POST_VARS['action']) && (($HTTP_POST_VARS['action'] == 'process') || ($HTTP_POST_VARS['action'] == 'update')) && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { + if (isset($_POST['action']) && (($_POST['action'] == 'process') || ($_POST['action'] == 'update')) && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { $process = true; $error = false; - if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); - if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']); - $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); - $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); - $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); - if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); - $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); - $city = tep_db_prepare_input($HTTP_POST_VARS['city']); - $country = tep_db_prepare_input($HTTP_POST_VARS['country']); + if (ACCOUNT_GENDER == 'true') $gender = HTML::sanitize($_POST['gender']); + if (ACCOUNT_COMPANY == 'true') $company = HTML::sanitize($_POST['company']); + $firstname = HTML::sanitize($_POST['firstname']); + $lastname = HTML::sanitize($_POST['lastname']); + $street_address = HTML::sanitize($_POST['street_address']); + if (ACCOUNT_SUBURB == 'true') $suburb = HTML::sanitize($_POST['suburb']); + $postcode = HTML::sanitize($_POST['postcode']); + $city = HTML::sanitize($_POST['city']); + $country = HTML::sanitize($_POST['country']); if (ACCOUNT_STATE == 'true') { - if (isset($HTTP_POST_VARS['zone_id'])) { - $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); + if (isset($_POST['zone_id'])) { + $zone_id = HTML::sanitize($_POST['zone_id']); } else { $zone_id = false; } - $state = tep_db_prepare_input($HTTP_POST_VARS['state']); + $state = HTML::sanitize($_POST['state']); } if (ACCOUNT_GENDER == 'true') { @@ -102,14 +105,22 @@ if (ACCOUNT_STATE == 'true') { $zone_id = 0; - $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'"); - $check = tep_db_fetch_array($check_query); - $entry_state_has_zones = ($check['total'] > 0); + + $Qcheck = $OSCOM_Db->prepare('select zone_id from :table_zones where zone_country_id = :zone_country_id'); + $Qcheck->bindInt(':zone_country_id', $country); + $Qcheck->execute(); + + $entry_state_has_zones = ($Qcheck->fetch() !== false); + if ($entry_state_has_zones == true) { - $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')"); - if (tep_db_num_rows($zone_query) == 1) { - $zone = tep_db_fetch_array($zone_query); - $zone_id = $zone['zone_id']; + $Qzone = $OSCOM_Db->prepare('select distinct zone_id from :table_zones where zone_country_id = :zone_country_id and (zone_name = :zone_name or zone_code = :zone_code)'); + $Qzone->bindInt(':zone_country_id', $country); + $Qzone->bindValue(':zone_name', $state); + $Qzone->bindValue(':zone_code', $state); + $Qzone->execute(); + + if (count($Qzone->fetchAll()) === 1) { + $zone_id = $Qzone->valueInt('zone_id'); } else { $error = true; @@ -145,116 +156,125 @@ } } - if ($HTTP_POST_VARS['action'] == 'update') { - $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "' and customers_id = '" . (int)$customer_id . "' limit 1"); - if (tep_db_num_rows($check_query) == 1) { - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "' and customers_id ='" . (int)$customer_id . "'"); + if ($_POST['action'] == 'update') { + $Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qcheck->bindInt(':address_book_id', $_GET['edit']); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { + $OSCOM_Db->save('address_book', $sql_data_array, ['address_book_id' => (int)$_GET['edit'], 'customers_id' => (int)$_SESSION['customer_id']]); // reregister session variables - if ( (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) || ($HTTP_GET_VARS['edit'] == $customer_default_address_id) ) { - $customer_first_name = $firstname; - $customer_country_id = $country; - $customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0'); - $customer_default_address_id = (int)$HTTP_GET_VARS['edit']; + if ( (isset($_POST['primary']) && ($_POST['primary'] == 'on')) || ($_GET['edit'] == $_SESSION['customer_default_address_id']) ) { + $_SESSION['customer_first_name'] = $firstname; + $_SESSION['customer_country_id'] = $country; + $_SESSION['customer_zone_id'] = (($zone_id > 0) ? (int)$zone_id : '0'); + $_SESSION['customer_default_address_id'] = (int)$_GET['edit']; $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, - 'customers_default_address_id' => (int)$HTTP_GET_VARS['edit']); + 'customers_default_address_id' => (int)$_GET['edit']); if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers', $sql_data_array, ['customers_id' => (int)$_SESSION['customer_id']]); } $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success'); } } else { if (tep_count_customer_address_book_entries() < MAX_ADDRESS_BOOK_ENTRIES) { - $sql_data_array['customers_id'] = (int)$customer_id; - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); + $sql_data_array['customers_id'] = (int)$_SESSION['customer_id']; - $new_address_book_id = tep_db_insert_id(); + $OSCOM_Db->save('address_book', $sql_data_array); + + $new_address_book_id = $OSCOM_Db->lastInsertId(); // reregister session variables - if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) { - $customer_first_name = $firstname; - $customer_country_id = $country; - $customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0'); - if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $customer_default_address_id = $new_address_book_id; + if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) { + $_SESSION['customer_first_name'] = $firstname; + $_SESSION['customer_country_id'] = $country; + $_SESSION['customer_zone_id'] = (($zone_id > 0) ? (int)$zone_id : '0'); + if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) $_SESSION['customer_default_address_id'] = $new_address_book_id; $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname); if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; - if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $sql_data_array['customers_default_address_id'] = $new_address_book_id; + if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) $sql_data_array['customers_default_address_id'] = $new_address_book_id; - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers', $sql_data_array, ['customers_id' => (int)$_SESSION['customer_id']]); $messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_UPDATED, 'success'); } } } - tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + OSCOM::redirect('address_book.php', '', 'SSL'); } } - if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) { - $entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'"); + if (isset($_GET['edit']) && is_numeric($_GET['edit'])) { + $Qentry = $OSCOM_Db->prepare('select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qentry->bindInt(':address_book_id', $_GET['edit']); + $Qentry->bindInt(':customers_id', $_SESSION['customer_id']); + $Qentry->execute(); - if (!tep_db_num_rows($entry_query)) { + if ($Qentry->fetch() === false) { $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY); - tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + OSCOM::redirect('address_book.php', '', 'SSL'); } - $entry = tep_db_fetch_array($entry_query); - } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) { - if ($HTTP_GET_VARS['delete'] == $customer_default_address_id) { + $entry = $Qentry->toArray(); + } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) { + if ($_GET['delete'] == $_SESSION['customer_default_address_id']) { $messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning'); - tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + OSCOM::redirect('address_book.php', '', 'SSL'); } else { - $check_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'"); - $check = tep_db_fetch_array($check_query); + $Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qcheck->bindInt(':address_book_id', $_GET['delete']); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); - if ($check['total'] < 1) { + if ($Qcheck->fetch() === false) { $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY); - tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + OSCOM::redirect('address_book.php', '', 'SSL'); } } } else { $entry = array(); } - if (!isset($HTTP_GET_VARS['delete']) && !isset($HTTP_GET_VARS['edit'])) { + if (!isset($_GET['delete']) && !isset($_GET['edit'])) { if (tep_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) { $messageStack->add_session('addressbook', ERROR_ADDRESS_BOOK_FULL); - tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + OSCOM::redirect('address_book.php', '', 'SSL'); } } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('address_book.php', '', 'SSL')); - if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) { - $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $HTTP_GET_VARS['edit'], 'SSL')); - } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) { - $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'], 'SSL')); + if (isset($_GET['edit']) && is_numeric($_GET['edit'])) { + $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, OSCOM::link('address_book_process.php', 'edit=' . $_GET['edit'], 'SSL')); + } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) { + $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, OSCOM::link('address_book_process.php', 'delete=' . $_GET['delete'], 'SSL')); } else { - $breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, OSCOM::link('address_book_process.php', '', 'SSL')); } - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); - if (!isset($HTTP_GET_VARS['delete'])) { - include('includes/form_check.js.php'); - } ?> -

+ size('addressbook') > 0) { @@ -263,58 +283,85 @@ ?>
-

-
-

- -

'); ?>

+
+
+
+
+
+
+
+ +
+ '); ?> +
+
+
-
- - - +
+
+
+
- + true]); ?>
+ +
+
+
+
+
+
+
+ +
+ '); ?> +
+
+
+
+ + -
- - - +
+
+
snapshot) > 0) { - $back_link = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); + if (sizeof($_SESSION['navigation']->snapshot) > 0) { + $back_link = OSCOM::link($_SESSION['navigation']->snapshot['page'], tep_array_to_string($_SESSION['navigation']->snapshot['get'], array(session_name())), $_SESSION['navigation']->snapshot['mode']); } else { - $back_link = tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'); + $back_link = OSCOM::link('address_book.php', '', 'SSL'); } ?> -
- - - +
+
+
diff --git a/catalog/admin/action_recorder.php b/catalog/admin/action_recorder.php index 767be0a66..cde45af65 100644 --- a/catalog/admin/action_recorder.php +++ b/catalog/admin/action_recorder.php @@ -52,18 +52,18 @@ 'text' => (is_object(${$modules['module']}) ? ${$modules['module']}->title : $modules['module'])); } - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'expire': $expired_entries = 0; - if (isset($HTTP_GET_VARS['module']) && in_array($HTTP_GET_VARS['module'], $modules_array)) { - if (is_object(${$HTTP_GET_VARS['module']})) { - $expired_entries += ${$HTTP_GET_VARS['module']}->expireEntries(); + if (isset($_GET['module']) && in_array($_GET['module'], $modules_array)) { + if (is_object(${$_GET['module']})) { + $expired_entries += ${$_GET['module']}->expireEntries(); } else { - $delete_query = tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . tep_db_input($HTTP_GET_VARS['module']) . "'"); + $delete_query = tep_db_query("delete from " . TABLE_ACTION_RECORDER . " where module = '" . tep_db_input($_GET['module']) . "'"); $expired_entries += tep_db_affected_rows(); } } else { @@ -110,7 +110,7 @@ - + @@ -128,16 +128,16 @@ title; } - if ((!isset($HTTP_GET_VARS['aID']) || (isset($HTTP_GET_VARS['aID']) && ($HTTP_GET_VARS['aID'] == $actions['id']))) && !isset($aInfo)) { + if ((!isset($_GET['aID']) || (isset($_GET['aID']) && ($_GET['aID'] == $actions['id']))) && !isset($aInfo)) { $actions_extra_query = tep_db_query("select identifier from " . TABLE_ACTION_RECORDER . " where id = '" . (int)$actions['id'] . "'"); $actions_extra = tep_db_fetch_array($actions_extra_query); @@ -173,8 +173,8 @@ - - + +
display_count($actions_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ENTRIES); ?>display_links($actions_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], (isset($HTTP_GET_VARS['module']) && in_array($HTTP_GET_VARS['module'], $modules_array) && is_object(${$HTTP_GET_VARS['module']}) ? 'module=' . $HTTP_GET_VARS['module'] : null) . '&' . (isset($HTTP_GET_VARS['search']) && !empty($HTTP_GET_VARS['search']) ? 'search=' . $HTTP_GET_VARS['search'] : null)); ?>display_count($actions_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ENTRIES); ?>display_links($actions_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], (isset($_GET['module']) && in_array($_GET['module'], $modules_array) && is_object(${$_GET['module']}) ? 'module=' . $_GET['module'] : null) . '&' . (isset($_GET['search']) && !empty($_GET['search']) ? 'search=' . $_GET['search'] : null)); ?>
diff --git a/catalog/admin/administrators.php b/catalog/admin/administrators.php index a399ddbd3..e7b1fba18 100644 --- a/catalog/admin/administrators.php +++ b/catalog/admin/administrators.php @@ -14,7 +14,7 @@ $htaccess_array = null; $htpasswd_array = null; - $is_iis = stripos($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'iis'); + $is_iis = stripos($_SERVER['SERVER_SOFTWARE'], 'iis'); $authuserfile_array = array('##### OSCOMMERCE ADMIN PROTECTION - BEGIN #####', 'AuthType Basic', @@ -44,15 +44,15 @@ } } - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': require('includes/functions/password_funcs.php'); - $username = tep_db_prepare_input($HTTP_POST_VARS['username']); - $password = tep_db_prepare_input($HTTP_POST_VARS['password']); + $username = tep_db_prepare_input($_POST['username']); + $password = tep_db_prepare_input($_POST['password']); $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($username) . "' limit 1"); @@ -68,7 +68,7 @@ } } - if (isset($HTTP_POST_VARS['htaccess']) && ($HTTP_POST_VARS['htaccess'] == 'true')) { + if (isset($_POST['htaccess']) && ($_POST['htaccess'] == 'true')) { $htpasswd_array[] = $username . ':' . tep_crypt_apr_md5($password); } @@ -99,10 +99,10 @@ case 'save': require('includes/functions/password_funcs.php'); - $username = tep_db_prepare_input($HTTP_POST_VARS['username']); - $password = tep_db_prepare_input($HTTP_POST_VARS['password']); + $username = tep_db_prepare_input($_POST['username']); + $password = tep_db_prepare_input($_POST['password']); - $check_query = tep_db_query("select id, user_name from " . TABLE_ADMINISTRATORS . " where id = '" . (int)$HTTP_GET_VARS['aID'] . "'"); + $check_query = tep_db_query("select id, user_name from " . TABLE_ADMINISTRATORS . " where id = '" . (int)$_GET['aID'] . "'"); $check = tep_db_fetch_array($check_query); // update username in current session if changed @@ -121,7 +121,7 @@ } } - tep_db_query("update " . TABLE_ADMINISTRATORS . " set user_name = '" . tep_db_input($username) . "' where id = '" . (int)$HTTP_GET_VARS['aID'] . "'"); + tep_db_query("update " . TABLE_ADMINISTRATORS . " set user_name = '" . tep_db_input($username) . "' where id = '" . (int)$_GET['aID'] . "'"); if (tep_not_null($password)) { // update password in htpasswd @@ -134,13 +134,13 @@ } } - if (isset($HTTP_POST_VARS['htaccess']) && ($HTTP_POST_VARS['htaccess'] == 'true')) { + if (isset($_POST['htaccess']) && ($_POST['htaccess'] == 'true')) { $htpasswd_array[] = $username . ':' . tep_crypt_apr_md5($password); } } - tep_db_query("update " . TABLE_ADMINISTRATORS . " set user_password = '" . tep_db_input(tep_encrypt_password($password)) . "' where id = '" . (int)$HTTP_GET_VARS['aID'] . "'"); - } elseif (!isset($HTTP_POST_VARS['htaccess']) || ($HTTP_POST_VARS['htaccess'] != 'true')) { + tep_db_query("update " . TABLE_ADMINISTRATORS . " set user_password = '" . tep_db_input(tep_encrypt_password($password)) . "' where id = '" . (int)$_GET['aID'] . "'"); + } elseif (!isset($_POST['htaccess']) || ($_POST['htaccess'] != 'true')) { if (is_array($htpasswd_array)) { for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) { list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2); @@ -173,10 +173,10 @@ fclose($fp); } - tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS, 'aID=' . (int)$HTTP_GET_VARS['aID'])); + tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS, 'aID=' . (int)$_GET['aID'])); break; case 'deleteconfirm': - $id = tep_db_prepare_input($HTTP_GET_VARS['aID']); + $id = tep_db_prepare_input($_GET['aID']); $check_query = tep_db_query("select id, user_name from " . TABLE_ADMINISTRATORS . " where id = '" . (int)$id . "'"); $check = tep_db_fetch_array($check_query); @@ -261,7 +261,7 @@ $info ) { $schema .= ',' . "\n"; $columns = implode($info['columns'], ', '); @@ -105,8 +105,7 @@ while ($rows = tep_db_fetch_array($rows_query)) { $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values ('; - reset($table_list); - while (list(,$i) = each($table_list)) { + foreach ( $table_list as $i ) { if (!isset($rows[$i])) { $schema .= 'NULL, '; } elseif (tep_not_null($rows[$i])) { @@ -127,8 +126,8 @@ fclose($fp); - if (isset($HTTP_POST_VARS['download']) && ($HTTP_POST_VARS['download'] == 'yes')) { - switch ($HTTP_POST_VARS['compress']) { + if (isset($_POST['download']) && ($_POST['download'] == 'yes')) { + switch ($_POST['compress']) { case 'gzip': exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file); $backup_file .= '.gz'; @@ -146,7 +145,7 @@ exit; } else { - switch ($HTTP_POST_VARS['compress']) { + switch ($_POST['compress']) { case 'gzip': exec(LOCAL_EXE_GZIP . ' ' . DIR_FS_BACKUP . $backup_file); break; @@ -165,11 +164,11 @@ tep_set_time_limit(0); if ($action == 'restorenow') { - $read_from = $HTTP_GET_VARS['file']; + $read_from = $_GET['file']; - if (file_exists(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])) { - $restore_file = DIR_FS_BACKUP . $HTTP_GET_VARS['file']; - $extension = substr($HTTP_GET_VARS['file'], -3); + if (file_exists(DIR_FS_BACKUP . $_GET['file'])) { + $restore_file = DIR_FS_BACKUP . $_GET['file']; + $extension = substr($_GET['file'], -3); if ( ($extension == 'sql') || ($extension == '.gz') || ($extension == 'zip') ) { switch ($extension) { @@ -264,7 +263,7 @@ tep_db_query($sql_array[$i]); } - tep_session_close(); + session_write_close(); tep_db_query("delete from " . TABLE_WHOS_ONLINE); tep_db_query("delete from " . TABLE_SESSIONS); @@ -282,15 +281,15 @@ tep_redirect(tep_href_link(FILENAME_BACKUP)); break; case 'download': - $extension = substr($HTTP_GET_VARS['file'], -3); + $extension = substr($_GET['file'], -3); if ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) { - if ($fp = fopen(DIR_FS_BACKUP . $HTTP_GET_VARS['file'], 'rb')) { - $buffer = fread($fp, filesize(DIR_FS_BACKUP . $HTTP_GET_VARS['file'])); + if ($fp = fopen(DIR_FS_BACKUP . $_GET['file'], 'rb')) { + $buffer = fread($fp, filesize(DIR_FS_BACKUP . $_GET['file'])); fclose($fp); header('Content-type: application/x-octet-stream'); - header('Content-disposition: attachment; filename=' . $HTTP_GET_VARS['file']); + header('Content-disposition: attachment; filename=' . $_GET['file']); echo $buffer; @@ -301,9 +300,9 @@ } break; case 'deleteconfirm': - if (strstr($HTTP_GET_VARS['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP)); + if (strstr($_GET['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP)); - tep_remove(DIR_FS_BACKUP . '/' . $HTTP_GET_VARS['file']); + tep_remove(DIR_FS_BACKUP . '/' . $_GET['file']); if (!$tep_remove_error) { $messageStack->add_session(SUCCESS_BACKUP_DELETED, 'success'); @@ -364,7 +363,7 @@ $check = 0; - if ((!isset($HTTP_GET_VARS['file']) || (isset($HTTP_GET_VARS['file']) && ($HTTP_GET_VARS['file'] == $entry))) && !isset($buInfo) && ($action != 'backup') && ($action != 'restorelocal')) { + if ((!isset($_GET['file']) || (isset($_GET['file']) && ($_GET['file'] == $entry))) && !isset($buInfo) && ($action != 'backup') && ($action != 'restorelocal')) { $file_array['file'] = $entry; $file_array['date'] = date(PHP_DATE_TIME_FORMAT, filemtime(DIR_FS_BACKUP . $entry)); $file_array['size'] = number_format(filesize(DIR_FS_BACKUP . $entry)) . ' bytes'; diff --git a/catalog/admin/banner_manager.php b/catalog/admin/banner_manager.php index dcbfde030..941f0b572 100644 --- a/catalog/admin/banner_manager.php +++ b/catalog/admin/banner_manager.php @@ -12,37 +12,37 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); $banner_extension = tep_banner_image_extension(); if (tep_not_null($action)) { switch ($action) { case 'setflag': - if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { - tep_set_banner_status($HTTP_GET_VARS['bID'], $HTTP_GET_VARS['flag']); + if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) { + tep_set_banner_status($_GET['bID'], $_GET['flag']); $messageStack->add_session(SUCCESS_BANNER_STATUS_UPDATED, 'success'); } else { $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error'); } - tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID'])); + tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID'])); break; case 'insert': case 'update': - if (isset($HTTP_POST_VARS['banners_id'])) $banners_id = tep_db_prepare_input($HTTP_POST_VARS['banners_id']); - $banners_title = tep_db_prepare_input($HTTP_POST_VARS['banners_title']); - $banners_url = tep_db_prepare_input($HTTP_POST_VARS['banners_url']); - $new_banners_group = tep_db_prepare_input($HTTP_POST_VARS['new_banners_group']); - $banners_group = (empty($new_banners_group)) ? tep_db_prepare_input($HTTP_POST_VARS['banners_group']) : $new_banners_group; - $banners_html_text = tep_db_prepare_input($HTTP_POST_VARS['banners_html_text']); - $banners_image_local = tep_db_prepare_input($HTTP_POST_VARS['banners_image_local']); - $banners_image_target = tep_db_prepare_input($HTTP_POST_VARS['banners_image_target']); + if (isset($_POST['banners_id'])) $banners_id = tep_db_prepare_input($_POST['banners_id']); + $banners_title = tep_db_prepare_input($_POST['banners_title']); + $banners_url = tep_db_prepare_input($_POST['banners_url']); + $new_banners_group = tep_db_prepare_input($_POST['new_banners_group']); + $banners_group = (empty($new_banners_group)) ? tep_db_prepare_input($_POST['banners_group']) : $new_banners_group; + $banners_html_text = tep_db_prepare_input($_POST['banners_html_text']); + $banners_image_local = tep_db_prepare_input($_POST['banners_image_local']); + $banners_image_target = tep_db_prepare_input($_POST['banners_image_target']); $db_image_location = ''; - $expires_date = tep_db_prepare_input($HTTP_POST_VARS['expires_date']); - $expires_impressions = tep_db_prepare_input($HTTP_POST_VARS['expires_impressions']); - $date_scheduled = tep_db_prepare_input($HTTP_POST_VARS['date_scheduled']); + $expires_date = tep_db_prepare_input($_POST['expires_date']); + $expires_impressions = tep_db_prepare_input($_POST['expires_impressions']); + $date_scheduled = tep_db_prepare_input($_POST['date_scheduled']); $banner_error = false; if (empty($banners_title)) { @@ -107,15 +107,15 @@ tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_scheduled = '" . tep_db_input($date_scheduled) . "' where banners_id = '" . (int)$banners_id . "'"); } - tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'bID=' . $banners_id)); + tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'bID=' . $banners_id)); } else { $action = 'new'; } break; case 'deleteconfirm': - $banners_id = tep_db_prepare_input($HTTP_GET_VARS['bID']); + $banners_id = tep_db_prepare_input($_GET['bID']); - if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) { + if (isset($_POST['delete_image']) && ($_POST['delete_image'] == 'on')) { $banner_query = tep_db_query("select banners_image from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'"); $banner = tep_db_fetch_array($banner_query); @@ -161,7 +161,7 @@ $messageStack->add_session(SUCCESS_BANNER_REMOVED, 'success'); - tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'])); break; } } @@ -213,17 +213,17 @@ function popupImageWindow(url) { $bInfo = new objectInfo($parameters); - if (isset($HTTP_GET_VARS['bID'])) { + if (isset($_GET['bID'])) { $form_action = 'update'; - $bID = tep_db_prepare_input($HTTP_GET_VARS['bID']); + $bID = tep_db_prepare_input($_GET['bID']); $banner_query = tep_db_query("select banners_title, banners_url, banners_image, banners_group, banners_html_text, status, date_format(date_scheduled, '%Y/%m/%d') as date_scheduled, date_format(expires_date, '%Y/%m/%d') as expires_date, expires_impressions, date_status_change from " . TABLE_BANNERS . " where banners_id = '" . (int)$bID . "'"); $banner = tep_db_fetch_array($banner_query); $bInfo->objectInfo($banner); - } elseif (tep_not_null($HTTP_POST_VARS)) { - $bInfo->objectInfo($HTTP_POST_VARS); + } elseif (tep_not_null($_POST)) { + $bInfo->objectInfo($_POST); } $groups_array = array(); @@ -235,7 +235,7 @@ function popupImageWindow(url) { - + @@ -304,7 +304,7 @@ function popupImageWindow(url) { @@ -324,13 +324,13 @@ function popupImageWindow(url) { banners_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> @@ -350,12 +350,12 @@ function popupImageWindow(url) { - + @@ -86,7 +86,7 @@ - +
- +
' . TEXT_BANNERS_INSERT_NOTE . '
' . TEXT_BANNERS_EXPIRCY_NOTE . '
' . TEXT_BANNERS_SCHEDULE_NOTE; ?>
' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . ' ' . $banners['banners_title']; ?> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', 'Set Inactive', 10, 10) . ''; + echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Active', 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', 'Set Inactive', 10, 10) . ''; } else { - echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', 'Set Active', 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10); + echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', 'Set Active', 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10); } ?>' . tep_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . ' '; if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> ' . tep_image(DIR_WS_ICONS . 'statistics.gif', ICON_STATISTICS) . ' '; if (isset($bInfo) && is_object($bInfo) && ($banners['banners_id'] == $bInfo->banners_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
- - + + @@ -379,17 +379,17 @@ function popupImageWindow(url) { case 'delete': $heading[] = array('text' => '' . $bInfo->banners_title . ''); - $contents = array('form' => tep_draw_form('banners', FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('banners', FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
' . $bInfo->banners_title . ''); if ($bInfo->banners_image) $contents[] = array('text' => '
' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE); - $contents[] = array('align' => 'center', 'text' => '
' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $HTTP_GET_VARS['bID']))); + $contents[] = array('align' => 'center', 'text' => '
' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']))); break; default: if (is_object($bInfo)) { $heading[] = array('text' => '' . $bInfo->banners_title . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id . '&action=delete')) . tep_draw_button(IMAGE_DETAILS, 'info', tep_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $HTTP_GET_VARS['page'] . '&bID=' . $bInfo->banners_id))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=delete')) . tep_draw_button(IMAGE_DETAILS, 'info', tep_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id))); $contents[] = array('text' => '
' . TEXT_BANNERS_DATE_ADDED . ' ' . tep_date_short($bInfo->date_added)); if ( (function_exists('imagecreate')) && ($dir_ok) && ($banner_extension) ) { diff --git a/catalog/admin/banner_statistics.php b/catalog/admin/banner_statistics.php index 8d5a62f4b..4931e70db 100644 --- a/catalog/admin/banner_statistics.php +++ b/catalog/admin/banner_statistics.php @@ -12,7 +12,7 @@ require('includes/application_top.php'); - $type = (isset($HTTP_GET_VARS['type']) ? $HTTP_GET_VARS['type'] : ''); + $type = (isset($_GET['type']) ? $_GET['type'] : ''); $banner_extension = tep_banner_image_extension(); @@ -30,11 +30,11 @@ } } - $banner_query = tep_db_query("select banners_title from " . TABLE_BANNERS . " where banners_id = '" . (int)$HTTP_GET_VARS['bID'] . "'"); + $banner_query = tep_db_query("select banners_title from " . TABLE_BANNERS . " where banners_id = '" . (int)$_GET['bID'] . "'"); $banner = tep_db_fetch_array($banner_query); $years_array = array(); - $years_query = tep_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$HTTP_GET_VARS['bID'] . "'"); + $years_query = tep_db_query("select distinct year(banners_history_date) as banner_year from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$_GET['bID'] . "'"); while ($years = tep_db_fetch_array($years_query)) { $years_array[] = array('id' => $years['banner_year'], 'text' => $years['banner_year']); @@ -67,16 +67,16 @@ switch ($type) { case 'yearly': break; case 'monthly': - echo TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onchange="this.form.submit();"') . ''; + echo TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($_GET['year']) ? $_GET['year'] : date('Y')), 'onchange="this.form.submit();"') . ''; break; default: case 'daily': - echo TITLE_MONTH . ' ' . tep_draw_pull_down_menu('month', $months_array, (isset($HTTP_GET_VARS['month']) ? $HTTP_GET_VARS['month'] : date('n')), 'onchange="this.form.submit();"') . '
' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($HTTP_GET_VARS['year']) ? $HTTP_GET_VARS['year'] : date('Y')), 'onchange="this.form.submit();"') . ''; + echo TITLE_MONTH . ' ' . tep_draw_pull_down_menu('month', $months_array, (isset($_GET['month']) ? $_GET['month'] : date('n')), 'onchange="this.form.submit();"') . '
' . TITLE_YEAR . ' ' . tep_draw_pull_down_menu('year', $years_array, (isset($_GET['year']) ? $_GET['year'] : date('Y')), 'onchange="this.form.submit();"') . ''; break; } ?> - +
display_count($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?>display_links($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_BANNERS); ?>display_links($banners_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
diff --git a/catalog/admin/cache.php b/catalog/admin/cache.php index 7dd4f3a0c..ff91848ba 100644 --- a/catalog/admin/cache.php +++ b/catalog/admin/cache.php @@ -12,11 +12,11 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { if ($action == 'reset') { - tep_reset_cache_block($HTTP_GET_VARS['block']); + tep_reset_cache_block($_GET['block']); } tep_redirect(tep_href_link(FILENAME_CACHE)); diff --git a/catalog/admin/categories.php b/catalog/admin/categories.php index dfc9054d9..95de13021 100644 --- a/catalog/admin/categories.php +++ b/catalog/admin/categories.php @@ -17,16 +17,16 @@ require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); $OSCOM_Hooks->call('products', 'productPreAction'); if (tep_not_null($action)) { switch ($action) { case 'setflag': - if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { - if (isset($HTTP_GET_VARS['pID'])) { - tep_set_product_status($HTTP_GET_VARS['pID'], $HTTP_GET_VARS['flag']); + if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) { + if (isset($_GET['pID'])) { + tep_set_product_status($_GET['pID'], $_GET['flag']); } if (USE_CACHE == 'true') { @@ -35,12 +35,12 @@ } } - tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $HTTP_GET_VARS['cPath'] . '&pID=' . $HTTP_GET_VARS['pID'])); + tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'])); break; case 'insert_category': case 'update_category': - if (isset($HTTP_POST_VARS['categories_id'])) $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); - $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); + if (isset($_POST['categories_id'])) $categories_id = tep_db_prepare_input($_POST['categories_id']); + $sort_order = tep_db_prepare_input($_POST['sort_order']); $sql_data_array = array('sort_order' => (int)$sort_order); @@ -63,7 +63,7 @@ $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { - $categories_name_array = $HTTP_POST_VARS['categories_name']; + $categories_name_array = $_POST['categories_name']; $language_id = $languages[$i]['id']; @@ -96,8 +96,8 @@ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id)); break; case 'delete_category_confirm': - if (isset($HTTP_POST_VARS['categories_id'])) { - $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); + if (isset($_POST['categories_id'])) { + $categories_id = tep_db_prepare_input($_POST['categories_id']); $categories = tep_get_category_tree($categories_id, '', '0', '', true); $products = array(); @@ -111,8 +111,7 @@ } } - reset($products); - while (list($key, $value) = each($products)) { + foreach ( $products as $key => $value ) { $category_ids = ''; for ($i=0, $n=sizeof($value['categories']); $i<$n; $i++) { @@ -133,8 +132,7 @@ tep_remove_category($categories[$i]['id']); } - reset($products_delete); - while (list($key) = each($products_delete)) { + foreach ( array_keys ($products_delete) as $key ) { tep_remove_product($key); } } @@ -147,9 +145,9 @@ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath)); break; case 'delete_product_confirm': - if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['product_categories']) && is_array($HTTP_POST_VARS['product_categories'])) { - $product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); - $product_categories = $HTTP_POST_VARS['product_categories']; + if (isset($_POST['products_id']) && isset($_POST['product_categories']) && is_array($_POST['product_categories'])) { + $product_id = tep_db_prepare_input($_POST['products_id']); + $product_categories = $_POST['product_categories']; for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) { tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'"); @@ -173,9 +171,9 @@ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath)); break; case 'move_category_confirm': - if (isset($HTTP_POST_VARS['categories_id']) && ($HTTP_POST_VARS['categories_id'] != $HTTP_POST_VARS['move_to_category_id'])) { - $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); - $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']); + if (isset($_POST['categories_id']) && ($_POST['categories_id'] != $_POST['move_to_category_id'])) { + $categories_id = tep_db_prepare_input($_POST['categories_id']); + $new_parent_id = tep_db_prepare_input($_POST['move_to_category_id']); $path = explode('_', tep_get_generated_category_path_ids($new_parent_id)); @@ -197,8 +195,8 @@ break; case 'move_product_confirm': - $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); - $new_parent_id = tep_db_prepare_input($HTTP_POST_VARS['move_to_category_id']); + $products_id = tep_db_prepare_input($_POST['products_id']); + $new_parent_id = tep_db_prepare_input($_POST['move_to_category_id']); $duplicate_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$new_parent_id . "'"); $duplicate_check = tep_db_fetch_array($duplicate_check_query); @@ -215,19 +213,19 @@ break; case 'insert_product': case 'update_product': - if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']); - $products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']); + if (isset($_GET['pID'])) $products_id = tep_db_prepare_input($_GET['pID']); + $products_date_available = tep_db_prepare_input($_POST['products_date_available']); $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null'; - $sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($HTTP_POST_VARS['products_quantity']), - 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']), - 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']), + $sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($_POST['products_quantity']), + 'products_model' => tep_db_prepare_input($_POST['products_model']), + 'products_price' => tep_db_prepare_input($_POST['products_price']), 'products_date_available' => $products_date_available, - 'products_weight' => (float)tep_db_prepare_input($HTTP_POST_VARS['products_weight']), - 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']), - 'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']), - 'manufacturers_id' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id'])); + 'products_weight' => (float)tep_db_prepare_input($_POST['products_weight']), + 'products_status' => tep_db_prepare_input($_POST['products_status']), + 'products_tax_class_id' => tep_db_prepare_input($_POST['products_tax_class_id']), + 'manufacturers_id' => (int)tep_db_prepare_input($_POST['manufacturers_id'])); $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); @@ -256,9 +254,9 @@ for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $language_id = $languages[$i]['id']; - $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), - 'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]), - 'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id])); + $sql_data_array = array('products_name' => tep_db_prepare_input($_POST['products_name'][$language_id]), + 'products_description' => tep_db_prepare_input($_POST['products_description'][$language_id]), + 'products_url' => tep_db_prepare_input($_POST['products_url'][$language_id])); if ($action == 'insert_product') { $insert_sql_data = array('products_id' => $products_id, @@ -275,12 +273,12 @@ $pi_sort_order = 0; $piArray = array(0); - foreach ($HTTP_POST_FILES as $key => $value) { + foreach ($_FILES as $key => $value) { // Update existing large product images if (preg_match('/^products_image_large_([0-9]+)$/', $key, $matches)) { $pi_sort_order++; - $sql_data_array = array('htmlcontent' => tep_db_prepare_input($HTTP_POST_VARS['products_image_htmlcontent_' . $matches[1]]), + $sql_data_array = array('htmlcontent' => tep_db_prepare_input($_POST['products_image_htmlcontent_' . $matches[1]]), 'sort_order' => $pi_sort_order); $t = new upload($key); @@ -295,7 +293,7 @@ } elseif (preg_match('/^products_image_large_new_([0-9]+)$/', $key, $matches)) { // Insert new large product images $sql_data_array = array('products_id' => (int)$products_id, - 'htmlcontent' => tep_db_prepare_input($HTTP_POST_VARS['products_image_htmlcontent_new_' . $matches[1]])); + 'htmlcontent' => tep_db_prepare_input($_POST['products_image_htmlcontent_new_' . $matches[1]])); $t = new upload($key); $t->set_destination(DIR_FS_CATALOG_IMAGES); @@ -338,11 +336,11 @@ tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id)); break; case 'copy_to_confirm': - if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) { - $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); - $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); + if (isset($_POST['products_id']) && isset($_POST['categories_id'])) { + $products_id = tep_db_prepare_input($_POST['products_id']); + $categories_id = tep_db_prepare_input($_POST['categories_id']); - if ($HTTP_POST_VARS['copy_as'] == 'link') { + if ($_POST['copy_as'] == 'link') { if ($categories_id != $current_category_id) { $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'"); $check = tep_db_fetch_array($check_query); @@ -352,7 +350,7 @@ } else { $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error'); } - } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { + } elseif ($_POST['copy_as'] == 'duplicate') { $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); @@ -419,8 +417,8 @@ $pInfo = new objectInfo($parameters); - if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) { - $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); + if (isset($_GET['pID']) && empty($_POST)) { + $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product = tep_db_fetch_array($product_query); $pInfo->objectInfo($product); @@ -457,7 +455,7 @@ default: $in_status = true; $out_status = false; } - $form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product'; + $form_action = (isset($_GET['pID'])) ? 'update_product' : 'insert_product'; ?> - +

-
    +
    • ' . SECTION_HEADING_GENERAL . ''; ?>
    • ' . SECTION_HEADING_DATA . ''; ?>
    • ' . SECTION_HEADING_IMAGES . ''; ?>
    • @@ -699,7 +697,7 @@ function showPiDelConfirm(piId) {
      - products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : ''))); ?> + products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : ''))); ?>
      '; - $global_button = tep_draw_button(BUTTON_GLOBAL, 'circle-triangle-n', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm&global=true'), 'primary'); + $global_button = tep_draw_button(BUTTON_GLOBAL, 'circle-triangle-n', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm&global=true'), 'primary'); - $cancel_button = tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'])); + $cancel_button = tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])); - $choose_audience_string .= '
      ' . "\n" . + $choose_audience_string .= '
      ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . @@ -89,11 +89,10 @@ function selectAll(FormName, SelectBox) { } function confirm() { - global $HTTP_GET_VARS, $HTTP_POST_VARS; $audience = array(); - if (isset($HTTP_GET_VARS['global']) && ($HTTP_GET_VARS['global'] == 'true')) { + if (isset($_GET['global']) && ($_GET['global'] == 'true')) { $products_query = tep_db_query("select distinct customers_id from " . TABLE_PRODUCTS_NOTIFICATIONS); while ($products = tep_db_fetch_array($products_query)) { $audience[$products['customers_id']] = '1'; @@ -104,7 +103,7 @@ function confirm() { $audience[$customers['customers_info_id']] = '1'; } } else { - $chosen = $HTTP_POST_VARS['chosen']; + $chosen = $_POST['chosen']; $ids = implode(',', $chosen); @@ -138,10 +137,10 @@ function confirm() { ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . - ' ' . tep_draw_form('confirm', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=confirm_send') . "\n" . + ' ' . tep_draw_form('confirm', FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . "\n" . ' ' . "\n" . + $confirm_string .= tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=send')) . '' . "\n" . ' ' . "\n" . '
      ' . TEXT_PRODUCTS . '
      ' . tep_draw_pull_down_menu('products', $products_array, '', 'size="20" style="width: 20em;" multiple') . '
       
      ' . $global_button . '







      ' . tep_draw_button(IMAGE_SEND, 'mail-closed', null, 'primary') . '

      ' . $cancel_button . '
      ' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
      '; if (sizeof($audience) > 0) { - if (isset($HTTP_GET_VARS['global']) && ($HTTP_GET_VARS['global'] == 'true')) { + if (isset($_GET['global']) && ($_GET['global'] == 'true')) { $confirm_string .= tep_draw_hidden_field('global', 'true'); } else { for ($i = 0, $n = sizeof($chosen); $i < $n; $i++) { @@ -150,7 +149,7 @@ function confirm() { } $confirm_string .= tep_draw_button(IMAGE_SEND, 'mail-closed', null, 'primary'); } - $confirm_string .= tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'] . '&action=send')) . '
      '; @@ -158,11 +157,10 @@ function confirm() { } function send($newsletter_id) { - global $HTTP_POST_VARS; $audience = array(); - if (isset($HTTP_POST_VARS['global']) && ($HTTP_POST_VARS['global'] == 'true')) { + if (isset($_POST['global']) && ($_POST['global'] == 'true')) { $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id"); while ($products = tep_db_fetch_array($products_query)) { $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], @@ -177,7 +175,7 @@ function send($newsletter_id) { 'email_address' => $customers['customers_email_address']); } } else { - $chosen = $HTTP_POST_VARS['chosen']; + $chosen = $_POST['chosen']; $ids = implode(',', $chosen); @@ -208,8 +206,7 @@ function send($newsletter_id) { $mimemessage->build_message(); - reset($audience); - while (list($key, $value) = each ($audience)) { + foreach ( $audience as $key => $value ) { $mimemessage->send($value['firstname'] . ' ' . $value['lastname'], $value['email_address'], '', EMAIL_FROM, $this->title); } diff --git a/catalog/admin/includes/modules/security_check/extended/admin_backup_directory_listing.php b/catalog/admin/includes/modules/security_check/extended/admin_backup_directory_listing.php index 8653305c9..921475062 100644 --- a/catalog/admin/includes/modules/security_check/extended/admin_backup_directory_listing.php +++ b/catalog/admin/includes/modules/security_check/extended/admin_backup_directory_listing.php @@ -33,7 +33,6 @@ function getMessage() { } function getHttpRequest($url) { - global $HTTP_SERVER_VARS; $server = parse_url($url); @@ -54,8 +53,8 @@ function getHttpRequest($url) { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'HEAD'); curl_setopt($curl, CURLOPT_NOBODY, true); - if ( isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) ) { - curl_setopt($curl, CURLOPT_USERPWD, $HTTP_SERVER_VARS['PHP_AUTH_USER'] . ':' . $HTTP_SERVER_VARS['PHP_AUTH_PW']); + if ( isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) ) { + curl_setopt($curl, CURLOPT_USERPWD, $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW']); $this->type = 'warning'; } diff --git a/catalog/admin/includes/modules/security_check/extended/admin_backup_file.php b/catalog/admin/includes/modules/security_check/extended/admin_backup_file.php index 8e2a0805f..4d9ff77c0 100644 --- a/catalog/admin/includes/modules/security_check/extended/admin_backup_file.php +++ b/catalog/admin/includes/modules/security_check/extended/admin_backup_file.php @@ -67,7 +67,6 @@ function getMessage() { } function getHttpRequest($url) { - global $HTTP_SERVER_VARS; $server = parse_url($url); @@ -88,8 +87,8 @@ function getHttpRequest($url) { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'HEAD'); curl_setopt($curl, CURLOPT_NOBODY, true); - if ( isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) ) { - curl_setopt($curl, CURLOPT_USERPWD, $HTTP_SERVER_VARS['PHP_AUTH_USER'] . ':' . $HTTP_SERVER_VARS['PHP_AUTH_PW']); + if ( isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) ) { + curl_setopt($curl, CURLOPT_USERPWD, $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW']); $this->type = 'warning'; } diff --git a/catalog/admin/includes/modules/security_check/extended/admin_http_authentication.php b/catalog/admin/includes/modules/security_check/extended/admin_http_authentication.php index 1b95c47af..81fe66838 100644 --- a/catalog/admin/includes/modules/security_check/extended/admin_http_authentication.php +++ b/catalog/admin/includes/modules/security_check/extended/admin_http_authentication.php @@ -22,9 +22,8 @@ function securityCheckExtended_admin_http_authentication() { } function pass() { - global $HTTP_SERVER_VARS; - return isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']); + return isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']); } function getMessage() { diff --git a/catalog/admin/invoice.php b/catalog/admin/invoice.php index d708663eb..367e4e436 100644 --- a/catalog/admin/invoice.php +++ b/catalog/admin/invoice.php @@ -15,7 +15,7 @@ require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); + $oID = tep_db_prepare_input($_GET['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); include(DIR_WS_CLASSES . 'order.php'); @@ -35,8 +35,8 @@ - - + +
      ' . nl2br(STORE_ADDRESS) . '
      ' . STORE_PHONE; ?>
      diff --git a/catalog/admin/languages.php b/catalog/admin/languages.php index fdcc0b3c0..51af290db 100644 --- a/catalog/admin/languages.php +++ b/catalog/admin/languages.php @@ -12,16 +12,16 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': - $name = tep_db_prepare_input($HTTP_POST_VARS['name']); - $code = tep_db_prepare_input(substr($HTTP_POST_VARS['code'], 0, 2)); - $image = tep_db_prepare_input($HTTP_POST_VARS['image']); - $directory = tep_db_prepare_input($HTTP_POST_VARS['directory']); - $sort_order = (int)tep_db_prepare_input($HTTP_POST_VARS['sort_order']); + $name = tep_db_prepare_input($_POST['name']); + $code = tep_db_prepare_input(substr($_POST['code'], 0, 2)); + $image = tep_db_prepare_input($_POST['image']); + $directory = tep_db_prepare_input($_POST['directory']); + $sort_order = (int)tep_db_prepare_input($_POST['sort_order']); tep_db_query("insert into " . TABLE_LANGUAGES . " (name, code, image, directory, sort_order) values ('" . tep_db_input($name) . "', '" . tep_db_input($code) . "', '" . tep_db_input($image) . "', '" . tep_db_input($directory) . "', '" . tep_db_input($sort_order) . "')"); $insert_id = tep_db_insert_id(); @@ -62,30 +62,30 @@ tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . (int)$orders_status['orders_status_id'] . "', '" . (int)$insert_id . "', '" . tep_db_input($orders_status['orders_status_name']) . "')"); } - if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) { + if (isset($_POST['default']) && ($_POST['default'] == 'on')) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($code) . "' where configuration_key = 'DEFAULT_LANGUAGE'"); } - tep_redirect(tep_href_link(FILENAME_LANGUAGES, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'lID=' . $insert_id)); + tep_redirect(tep_href_link(FILENAME_LANGUAGES, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'lID=' . $insert_id)); break; case 'save': - $lID = tep_db_prepare_input($HTTP_GET_VARS['lID']); - $name = tep_db_prepare_input($HTTP_POST_VARS['name']); - $code = tep_db_prepare_input(substr($HTTP_POST_VARS['code'], 0, 2)); - $image = tep_db_prepare_input($HTTP_POST_VARS['image']); - $directory = tep_db_prepare_input($HTTP_POST_VARS['directory']); - $sort_order = (int)tep_db_prepare_input($HTTP_POST_VARS['sort_order']); + $lID = tep_db_prepare_input($_GET['lID']); + $name = tep_db_prepare_input($_POST['name']); + $code = tep_db_prepare_input(substr($_POST['code'], 0, 2)); + $image = tep_db_prepare_input($_POST['image']); + $directory = tep_db_prepare_input($_POST['directory']); + $sort_order = (int)tep_db_prepare_input($_POST['sort_order']); tep_db_query("update " . TABLE_LANGUAGES . " set name = '" . tep_db_input($name) . "', code = '" . tep_db_input($code) . "', image = '" . tep_db_input($image) . "', directory = '" . tep_db_input($directory) . "', sort_order = '" . tep_db_input($sort_order) . "' where languages_id = '" . (int)$lID . "'"); - if ($HTTP_POST_VARS['default'] == 'on') { + if ($_POST['default'] == 'on') { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($code) . "' where configuration_key = 'DEFAULT_LANGUAGE'"); } - tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $HTTP_GET_VARS['lID'])); + tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID'])); break; case 'deleteconfirm': - $lID = tep_db_prepare_input($HTTP_GET_VARS['lID']); + $lID = tep_db_prepare_input($_GET['lID']); $lng_query = tep_db_query("select languages_id from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_CURRENCY . "'"); $lng = tep_db_fetch_array($lng_query); @@ -101,10 +101,10 @@ tep_db_query("delete from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$lID . "'"); tep_db_query("delete from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'"); - tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'])); break; case 'delete': - $lID = tep_db_prepare_input($HTTP_GET_VARS['lID']); + $lID = tep_db_prepare_input($_GET['lID']); $lng_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'"); $lng = tep_db_fetch_array($lng_query); @@ -141,18 +141,18 @@ languages_id) ) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } if (DEFAULT_LANGUAGE == $languages['code']) { @@ -162,7 +162,7 @@ } ?> - languages_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>  + languages_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>  - - + + - + '
      ' . TEXT_INFO_LANGUAGE_DIRECTORY . '
      ' . tep_draw_input_field('directory')); $contents[] = array('text' => '
      ' . TEXT_INFO_LANGUAGE_SORT_ORDER . '
      ' . tep_draw_input_field('sort_order')); $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $HTTP_GET_VARS['lID']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID']))); break; case 'edit': $heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_LANGUAGE . ''); - $contents = array('form' => tep_draw_form('languages', FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=save')); + $contents = array('form' => tep_draw_form('languages', FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_LANGUAGE_NAME . '
      ' . tep_draw_input_field('name', $lInfo->name)); $contents[] = array('text' => '
      ' . TEXT_INFO_LANGUAGE_CODE . '
      ' . tep_draw_input_field('code', $lInfo->code)); @@ -214,20 +214,20 @@ $contents[] = array('text' => '
      ' . TEXT_INFO_LANGUAGE_DIRECTORY . '
      ' . tep_draw_input_field('directory', $lInfo->directory)); $contents[] = array('text' => '
      ' . TEXT_INFO_LANGUAGE_SORT_ORDER . '
      ' . tep_draw_input_field('sort_order', $lInfo->sort_order)); if (DEFAULT_LANGUAGE != $lInfo->code) $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id))); break; case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_LANGUAGE . ''); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $lInfo->name . ''); - $contents[] = array('align' => 'center', 'text' => '
      ' . (($remove_language) ? tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=deleteconfirm'), 'primary') : '') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . (($remove_language) ? tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=deleteconfirm'), 'primary') : '') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id))); break; default: if (is_object($lInfo)) { $heading[] = array('text' => '' . $lInfo->name . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_LANGUAGES, 'page=' . $HTTP_GET_VARS['page'] . '&lID=' . $lInfo->languages_id . '&action=delete')) . tep_draw_button(IMAGE_DETAILS, 'info', tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $lInfo->directory))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $lInfo->languages_id . '&action=delete')) . tep_draw_button(IMAGE_DETAILS, 'info', tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $lInfo->directory))); $contents[] = array('text' => '
      ' . TEXT_INFO_LANGUAGE_NAME . ' ' . $lInfo->name); $contents[] = array('text' => TEXT_INFO_LANGUAGE_CODE . ' ' . $lInfo->code); $contents[] = array('text' => '
      ' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $lInfo->directory . '/images/' . $lInfo->image, '', 'SSL'), $lInfo->name)); diff --git a/catalog/admin/login.php b/catalog/admin/login.php index 2f76f85b3..d1042d521 100644 --- a/catalog/admin/login.php +++ b/catalog/admin/login.php @@ -15,7 +15,7 @@ require('includes/application_top.php'); require('includes/functions/password_funcs.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); // prepare to logout an active administrator if the login page is accessed again if (tep_session_is_registered('admin')) { @@ -25,12 +25,12 @@ if (tep_not_null($action)) { switch ($action) { case 'process': - if (tep_session_is_registered('redirect_origin') && isset($redirect_origin['auth_user']) && !isset($HTTP_POST_VARS['username'])) { + if (tep_session_is_registered('redirect_origin') && isset($redirect_origin['auth_user']) && !isset($_POST['username'])) { $username = tep_db_prepare_input($redirect_origin['auth_user']); $password = tep_db_prepare_input($redirect_origin['auth_pw']); } else { - $username = tep_db_prepare_input($HTTP_POST_VARS['username']); - $password = tep_db_prepare_input($HTTP_POST_VARS['password']); + $username = tep_db_prepare_input($_POST['username']); + $password = tep_db_prepare_input($_POST['password']); } $actionRecorder = new actionRecorderAdmin('ar_admin_login', null, $username); @@ -72,14 +72,14 @@ } } - if (isset($HTTP_POST_VARS['username'])) { + if (isset($_POST['username'])) { $messageStack->add(ERROR_INVALID_ADMINISTRATOR, 'error'); } } else { $messageStack->add(sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_ADMIN_LOGIN_MINUTES') ? (int)MODULE_ACTION_RECORDER_ADMIN_LOGIN_MINUTES : 5))); } - if (isset($HTTP_POST_VARS['username'])) { + if (isset($_POST['username'])) { $actionRecorder->record(false); } @@ -88,7 +88,7 @@ case 'logoff': tep_session_unregister('admin'); - if (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && !empty($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) && !empty($HTTP_SERVER_VARS['PHP_AUTH_PW'])) { + if (isset($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) && !empty($_SERVER['PHP_AUTH_PW'])) { tep_session_register('auth_ignore'); $auth_ignore = true; } @@ -101,8 +101,8 @@ $check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1"); if (tep_db_num_rows($check_query) == 0) { - $username = tep_db_prepare_input($HTTP_POST_VARS['username']); - $password = tep_db_prepare_input($HTTP_POST_VARS['password']); + $username = tep_db_prepare_input($_POST['username']); + $password = tep_db_prepare_input($_POST['password']); if ( !empty($username) ) { tep_db_query("insert into " . TABLE_ADMINISTRATORS . " (user_name, user_password) values ('" . tep_db_input($username) . "', '" . tep_db_input(tep_encrypt_password($password)) . "')"); diff --git a/catalog/admin/mail.php b/catalog/admin/mail.php index 026638bcd..0db007a14 100644 --- a/catalog/admin/mail.php +++ b/catalog/admin/mail.php @@ -12,10 +12,10 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); - if ( ($action == 'send_email_to_user') && isset($HTTP_POST_VARS['customers_email_address']) && !isset($HTTP_POST_VARS['back_x']) ) { - switch ($HTTP_POST_VARS['customers_email_address']) { + if ( ($action == 'send_email_to_user') && isset($_POST['customers_email_address']) && !isset($_POST['back_x']) ) { + switch ($_POST['customers_email_address']) { case '***': $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS); $mail_sent_to = TEXT_ALL_CUSTOMERS; @@ -25,16 +25,16 @@ $mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS; break; default: - $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']); + $customers_email_address = tep_db_prepare_input($_POST['customers_email_address']); $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'"); - $mail_sent_to = $HTTP_POST_VARS['customers_email_address']; + $mail_sent_to = $_POST['customers_email_address']; break; } - $from = tep_db_prepare_input($HTTP_POST_VARS['from']); - $subject = tep_db_prepare_input($HTTP_POST_VARS['subject']); - $message = tep_db_prepare_input($HTTP_POST_VARS['message']); + $from = tep_db_prepare_input($_POST['from']); + $subject = tep_db_prepare_input($_POST['subject']); + $message = tep_db_prepare_input($_POST['message']); //Let's build a message object using the email class $mimemessage = new email(array('X-Mailer: osCommerce')); @@ -55,12 +55,12 @@ tep_redirect(tep_href_link(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to))); } - if ( ($action == 'preview') && !isset($HTTP_POST_VARS['customers_email_address']) ) { + if ( ($action == 'preview') && !isset($_POST['customers_email_address']) ) { $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error'); } - if (isset($HTTP_GET_VARS['mail_sent_to'])) { - $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'success'); + if (isset($_GET['mail_sent_to'])) { + $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $_GET['mail_sent_to']), 'success'); } require(DIR_WS_INCLUDES . 'template_top.php'); @@ -78,8 +78,8 @@
      display_count($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_LANGUAGES); ?>display_links($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_LANGUAGES); ?>display_links($languages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      languages_id . '&action=new')); ?>languages_id . '&action=new')); ?>
      @@ -103,19 +103,19 @@ - + - + - + @@ -124,9 +124,8 @@ - + diff --git a/catalog/admin/manufacturers.php b/catalog/admin/manufacturers.php index ca79c1594..1bff22296 100644 --- a/catalog/admin/manufacturers.php +++ b/catalog/admin/manufacturers.php @@ -12,14 +12,14 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': case 'save': - if (isset($HTTP_GET_VARS['mID'])) $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']); - $manufacturers_name = tep_db_prepare_input($HTTP_POST_VARS['manufacturers_name']); + if (isset($_GET['mID'])) $manufacturers_id = tep_db_prepare_input($_GET['mID']); + $manufacturers_name = tep_db_prepare_input($_POST['manufacturers_name']); $sql_data_array = array('manufacturers_name' => $manufacturers_name); @@ -47,7 +47,7 @@ $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { - $manufacturers_url_array = $HTTP_POST_VARS['manufacturers_url']; + $manufacturers_url_array = $_POST['manufacturers_url']; $language_id = $languages[$i]['id']; $sql_data_array = array('manufacturers_url' => tep_db_prepare_input($manufacturers_url_array[$language_id])); @@ -68,12 +68,12 @@ tep_reset_cache_block('manufacturers'); } - tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'mID=' . $manufacturers_id)); + tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'mID=' . $manufacturers_id)); break; case 'deleteconfirm': - $manufacturers_id = tep_db_prepare_input($HTTP_GET_VARS['mID']); + $manufacturers_id = tep_db_prepare_input($_GET['mID']); - if (isset($HTTP_POST_VARS['delete_image']) && ($HTTP_POST_VARS['delete_image'] == 'on')) { + if (isset($_POST['delete_image']) && ($_POST['delete_image'] == 'on')) { $manufacturer_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'"); $manufacturer = tep_db_fetch_array($manufacturer_query); @@ -85,7 +85,7 @@ tep_db_query("delete from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'"); tep_db_query("delete from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$manufacturers_id . "'"); - if (isset($HTTP_POST_VARS['delete_products']) && ($HTTP_POST_VARS['delete_products'] == 'on')) { + if (isset($_POST['delete_products']) && ($_POST['delete_products'] == 'on')) { $products_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where manufacturers_id = '" . (int)$manufacturers_id . "'"); while ($products = tep_db_fetch_array($products_query)) { tep_remove_product($products['products_id']); @@ -98,7 +98,7 @@ tep_reset_cache_block('manufacturers'); } - tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'])); break; } } @@ -125,10 +125,10 @@ manufacturers_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - + @@ -160,7 +160,7 @@ if (empty($action)) { ?> - + '
      ' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $HTTP_GET_VARS['mID']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $_GET['mID']))); break; case 'edit': $heading[] = array('text' => '' . TEXT_HEADING_EDIT_MANUFACTURER . ''); - $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=save', 'post', 'enctype="multipart/form-data"')); + $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=save', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_EDIT_INTRO); $contents[] = array('text' => '
      ' . TEXT_MANUFACTURERS_NAME . '
      ' . tep_draw_input_field('manufacturers_name', $mInfo->manufacturers_name)); $contents[] = array('text' => '
      ' . TEXT_MANUFACTURERS_IMAGE . '
      ' . tep_draw_file_field('manufacturers_image') . '
      ' . $mInfo->manufacturers_image); @@ -203,12 +203,12 @@ } $contents[] = array('text' => '
      ' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id))); break; case 'delete': $heading[] = array('text' => '' . TEXT_HEADING_DELETE_MANUFACTURER . ''); - $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('manufacturers', FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_DELETE_INTRO); $contents[] = array('text' => '
      ' . $mInfo->manufacturers_name . ''); $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE); @@ -218,13 +218,13 @@ $contents[] = array('text' => '
      ' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count)); } - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id))); break; default: if (isset($mInfo) && is_object($mInfo)) { $heading[] = array('text' => '' . $mInfo->manufacturers_name . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $HTTP_GET_VARS['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=delete'))); $contents[] = array('text' => '
      ' . TEXT_DATE_ADDED . ' ' . tep_date_short($mInfo->date_added)); if (tep_not_null($mInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($mInfo->last_modified)); $contents[] = array('text' => '
      ' . tep_info_image($mInfo->manufacturers_image, $mInfo->manufacturers_name)); diff --git a/catalog/admin/modules.php b/catalog/admin/modules.php index ffad5089e..2e7417541 100644 --- a/catalog/admin/modules.php +++ b/catalog/admin/modules.php @@ -12,7 +12,7 @@ require('includes/application_top.php'); - $set = (isset($HTTP_GET_VARS['set']) ? $HTTP_GET_VARS['set'] : ''); + $set = (isset($_GET['set']) ? $_GET['set'] : ''); $modules = $cfgModules->getAll(); @@ -27,21 +27,20 @@ define('HEADING_TITLE', $cfgModules->get($set, 'title')); $template_integration = $cfgModules->get($set, 'template_integration'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'save': - reset($HTTP_POST_VARS['configuration']); - while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { + foreach( $_POST['configuration'] as $key => $value ) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); } - tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])); + tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $_GET['module'])); break; case 'install': case 'remove': $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); - $class = basename($HTTP_GET_VARS['module']); + $class = basename($_GET['module']); if (file_exists($module_directory . $class . $file_extension)) { include($module_directory . $class . $file_extension); $module = new $class; @@ -89,7 +88,7 @@ while ($file = $dir->read()) { if (!is_dir($module_directory . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { - if (isset($HTTP_GET_VARS['list']) && ($HTTP_GET_VARS['list'] = 'new')) { + if (isset($_GET['list']) && ($_GET['list'] = 'new')) { if (!in_array($file, $modules_installed)) { $directory_array[] = $file; } @@ -115,7 +114,7 @@ ' . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_MODULES, 'set=' . $set)) . ''; } else { echo ' '; @@ -152,7 +151,7 @@ } } - if ((!isset($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['module'] == $class))) && !isset($mInfo)) { + if ((!isset($_GET['module']) || (isset($_GET['module']) && ($_GET['module'] == $class))) && !isset($mInfo)) { $module_info = array('code' => $module->code, 'title' => $module->title, 'description' => $module->description, @@ -186,18 +185,18 @@ echo ' ' . "\n"; } } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - + keys); - while (list($key, $value) = each($mInfo->keys)) { + foreach( $mInfo->keys as $key => $value ) { $keys .= '' . $value['title'] . '
      ' . $value['description'] . '
      '; if ($value['set_function']) { @@ -251,17 +249,16 @@ $heading[] = array('text' => '' . $mInfo->title . ''); - $contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save')); + $contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $_GET['module'] . '&action=save')); $contents[] = array('text' => $keys); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $_GET['module']))); break; default: $heading[] = array('text' => '' . $mInfo->title . ''); if (in_array($mInfo->code . $file_extension, $modules_installed) && ($mInfo->status > 0)) { $keys = ''; - reset($mInfo->keys); - while (list(, $value) = each($mInfo->keys)) { + foreach( $mInfo->keys as $value ) { $keys .= '' . $value['title'] . '
      '; if ($value['use_function']) { $use_function = $value['use_function']; @@ -294,7 +291,7 @@ $contents[] = array('text' => '
      ' . $mInfo->description); $contents[] = array('text' => '
      ' . $keys); - } elseif (isset($HTTP_GET_VARS['list']) && ($HTTP_GET_VARS['list'] == 'new')) { + } elseif (isset($_GET['list']) && ($_GET['list'] == 'new')) { if (isset($mInfo)) { $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_MODULE_INSTALL, 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $mInfo->code . '&action=install'))); diff --git a/catalog/admin/modules_content.php b/catalog/admin/modules_content.php index 420211482..8b3ff706e 100644 --- a/catalog/admin/modules_content.php +++ b/catalog/admin/modules_content.php @@ -88,16 +88,16 @@ function _sortContentModuleFiles($a, $b) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . implode(';', $_installed) . "' where configuration_key = 'MODULE_CONTENT_INSTALLED'"); } - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'save': - $class = basename($HTTP_GET_VARS['module']); + $class = basename($_GET['module']); foreach ( $modules['installed'] as $m ) { if ( $m['code'] == $class ) { - foreach ($HTTP_POST_VARS['configuration'] as $key => $value) { + foreach ($_POST['configuration'] as $key => $value) { $key = tep_db_prepare_input($key); $value = tep_db_prepare_input($value); @@ -113,7 +113,7 @@ function _sortContentModuleFiles($a, $b) { break; case 'install': - $class = basename($HTTP_GET_VARS['module']); + $class = basename($_GET['module']); foreach ( $modules['new'] as $m ) { if ( $m['code'] == $class ) { @@ -134,7 +134,7 @@ function _sortContentModuleFiles($a, $b) { break; case 'remove': - $class = basename($HTTP_GET_VARS['module']); + $class = basename($_GET['module']); foreach ( $modules['installed'] as $m ) { if ( $m['code'] == $class ) { @@ -196,7 +196,7 @@ function _sortContentModuleFiles($a, $b) { foreach ( $modules['new'] as $m ) { $module = new $m['code'](); - if ((!isset($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['module'] == $module->code))) && !isset($mInfo)) { + if ((!isset($_GET['module']) || (isset($_GET['module']) && ($_GET['module'] == $module->code))) && !isset($mInfo)) { $module_info = array('code' => $module->code, 'title' => $module->title, 'description' => $module->description, @@ -234,7 +234,7 @@ function _sortContentModuleFiles($a, $b) { foreach ( $modules['installed'] as $m ) { $module = new $m['code'](); - if ((!isset($HTTP_GET_VARS['module']) || (isset($HTTP_GET_VARS['module']) && ($HTTP_GET_VARS['module'] == $module->code))) && !isset($mInfo)) { + if ((!isset($_GET['module']) || (isset($_GET['module']) && ($_GET['module'] == $module->code))) && !isset($mInfo)) { $module_info = array('code' => $module->code, 'title' => $module->title, 'description' => $module->description, diff --git a/catalog/admin/newsletters.php b/catalog/admin/newsletters.php index 26c7c7057..f9fdc710c 100644 --- a/catalog/admin/newsletters.php +++ b/catalog/admin/newsletters.php @@ -12,25 +12,25 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'lock': case 'unlock': - $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']); + $newsletter_id = tep_db_prepare_input($_GET['nID']); $status = (($action == 'lock') ? '1' : '0'); tep_db_query("update " . TABLE_NEWSLETTERS . " set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'"); - tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'])); + tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])); break; case 'insert': case 'update': - if (isset($HTTP_POST_VARS['newsletter_id'])) $newsletter_id = tep_db_prepare_input($HTTP_POST_VARS['newsletter_id']); - $newsletter_module = tep_db_prepare_input($HTTP_POST_VARS['module']); - $title = tep_db_prepare_input($HTTP_POST_VARS['title']); - $content = tep_db_prepare_input($HTTP_POST_VARS['content']); + if (isset($_POST['newsletter_id'])) $newsletter_id = tep_db_prepare_input($_POST['newsletter_id']); + $newsletter_module = tep_db_prepare_input($_POST['module']); + $title = tep_db_prepare_input($_POST['title']); + $content = tep_db_prepare_input($_POST['content']); $newsletter_error = false; if (empty($title)) { @@ -59,23 +59,23 @@ tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'"); } - tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'nID=' . $newsletter_id)); + tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'nID=' . $newsletter_id)); } else { $action = 'new'; } break; case 'deleteconfirm': - $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']); + $newsletter_id = tep_db_prepare_input($_GET['nID']); tep_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'"); - tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'])); break; case 'delete': - case 'new': if (!isset($HTTP_GET_VARS['nID'])) break; + case 'new': if (!isset($_GET['nID'])) break; case 'send': case 'confirm_send': - $newsletter_id = tep_db_prepare_input($HTTP_GET_VARS['nID']); + $newsletter_id = tep_db_prepare_input($_GET['nID']); $check_query = tep_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'"); $check = tep_db_fetch_array($check_query); @@ -90,7 +90,7 @@ $messageStack->add_session($error, 'error'); - tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID'])); + tep_redirect(tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])); } break; } @@ -118,17 +118,17 @@ $nInfo = new objectInfo($parameters); - if (isset($HTTP_GET_VARS['nID'])) { + if (isset($_GET['nID'])) { $form_action = 'update'; - $nID = tep_db_prepare_input($HTTP_GET_VARS['nID']); + $nID = tep_db_prepare_input($_GET['nID']); $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'"); $newsletter = tep_db_fetch_array($newsletter_query); $nInfo->objectInfo($newsletter); - } elseif ($HTTP_POST_VARS) { - $nInfo->objectInfo($HTTP_POST_VARS); + } elseif ($_POST) { + $nInfo->objectInfo($_POST); } $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); @@ -152,7 +152,7 @@ - +






      $value ) { + if (!is_array($_POST[$key])) { echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value))); } } @@ -158,7 +157,7 @@ ?>
      manufacturers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> manufacturers_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + +
      display_count($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS); ?>display_links($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS); ?>display_links($manufacturers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      manufacturers_id . '&action=new')); ?>manufacturers_id . '&action=new')); ?>
      ' . tep_draw_button(IMAGE_MODULE_INSTALL . ' (' . $new_modules_counter . ')', 'plus', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&list=new')) . '
      title; ?> code . $file_extension, $modules_installed) && is_numeric($module->sort_order)) echo $module->sort_order; ?>code) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> code) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      @@ -180,13 +180,13 @@ - + - + - + newsletters_id) ) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - + - +
      - +
      content); ?>
      ' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . $newsletters['title']; ?>' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . $newsletters['title']; ?> 0) { echo tep_image(DIR_WS_ICONS . 'locked.gif', ICON_LOCKED); } else { echo tep_image(DIR_WS_ICONS . 'unlocked.gif', ICON_UNLOCKED); } ?>newsletters_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> newsletters_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + + @@ -335,19 +335,19 @@ case 'delete': $heading[] = array('text' => '' . $nInfo->title . ''); - $contents = array('form' => tep_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('newsletters', FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $nInfo->title . ''); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $HTTP_GET_VARS['nID']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']))); break; default: if (isset($nInfo) && is_object($nInfo)) { $heading[] = array('text' => '' . $nInfo->title . ''); if ($nInfo->locked > 0) { - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete')) . tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_SEND, 'mail-closed', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send')) . tep_draw_button(IMAGE_UNLOCK, 'unlocked', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete')) . tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_SEND, 'mail-closed', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send')) . tep_draw_button(IMAGE_UNLOCK, 'unlocked', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock'))); } else { - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_LOCK, 'locked', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $HTTP_GET_VARS['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_LOCK, 'locked', tep_href_link(FILENAME_NEWSLETTERS, 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock'))); } $contents[] = array('text' => '
      ' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added)); if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . tep_date_short($nInfo->date_sent)); diff --git a/catalog/admin/orders.php b/catalog/admin/orders.php index a9eeb1dd0..068ac4eb9 100644 --- a/catalog/admin/orders.php +++ b/catalog/admin/orders.php @@ -26,14 +26,14 @@ $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; } - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'update_order': - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); - $status = tep_db_prepare_input($HTTP_POST_VARS['status']); - $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); + $oID = tep_db_prepare_input($_GET['oID']); + $status = tep_db_prepare_input($_POST['status']); + $comments = tep_db_prepare_input($_POST['comments']); $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); @@ -43,9 +43,9 @@ tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'"); $customer_notified = '0'; - if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) { + if (isset($_POST['notify']) && ($_POST['notify'] == 'on')) { $notify_comments = ''; - if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) { + if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on')) { $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n"; } @@ -70,17 +70,17 @@ tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit')); break; case 'deleteconfirm': - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); + $oID = tep_db_prepare_input($_GET['oID']); - tep_remove_order($oID, $HTTP_POST_VARS['restock']); + tep_remove_order($oID, $_POST['restock']); tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')))); break; } } - if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) { - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); + if (($action == 'edit') && isset($_GET['oID'])) { + $oID = tep_db_prepare_input($_GET['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $order_exists = true; @@ -104,7 +104,7 @@

      info['total'] . ')'; ?>

      -
      true)) . tep_draw_button(IMAGE_ORDERS_PACKINGSLIP, 'document', tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')))); ?>
      +
      true)) . tep_draw_button(IMAGE_ORDERS_PACKINGSLIP, 'document', tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $_GET['oID']), null, array('newwindow' => true)) . tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')))); ?>
        @@ -351,19 +351,19 @@
      0)) { - $status = tep_db_prepare_input($HTTP_GET_VARS['status']); + } elseif (isset($_GET['status']) && is_numeric($_GET['status']) && ($_GET['status'] > 0)) { + $status = tep_db_prepare_input($_GET['status']); $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } else { $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } - $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows); + $orders_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows); $orders_query = tep_db_query($orders_query_raw); while ($orders = tep_db_fetch_array($orders_query)) { - if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) { + if ((!isset($_GET['oID']) || (isset($_GET['oID']) && ($_GET['oID'] == $orders['orders_id']))) && !isset($oInfo)) { $oInfo = new objectInfo($orders); } @@ -385,8 +385,8 @@ diff --git a/catalog/admin/orders_status.php b/catalog/admin/orders_status.php index e170d4b50..a7f281dee 100644 --- a/catalog/admin/orders_status.php +++ b/catalog/admin/orders_status.php @@ -12,22 +12,22 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': case 'save': - if (isset($HTTP_GET_VARS['oID'])) $orders_status_id = tep_db_prepare_input($HTTP_GET_VARS['oID']); + if (isset($_GET['oID'])) $orders_status_id = tep_db_prepare_input($_GET['oID']); $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { - $orders_status_name_array = $HTTP_POST_VARS['orders_status_name']; + $orders_status_name_array = $_POST['orders_status_name']; $language_id = $languages[$i]['id']; $sql_data_array = array('orders_status_name' => tep_db_prepare_input($orders_status_name_array[$language_id]), - 'public_flag' => ((isset($HTTP_POST_VARS['public_flag']) && ($HTTP_POST_VARS['public_flag'] == '1')) ? '1' : '0'), - 'downloads_flag' => ((isset($HTTP_POST_VARS['downloads_flag']) && ($HTTP_POST_VARS['downloads_flag'] == '1')) ? '1' : '0')); + 'public_flag' => ((isset($_POST['public_flag']) && ($_POST['public_flag'] == '1')) ? '1' : '0'), + 'downloads_flag' => ((isset($_POST['downloads_flag']) && ($_POST['downloads_flag'] == '1')) ? '1' : '0')); if ($action == 'insert') { if (empty($orders_status_id)) { @@ -47,14 +47,14 @@ } } - if (isset($HTTP_POST_VARS['default']) && ($HTTP_POST_VARS['default'] == 'on')) { + if (isset($_POST['default']) && ($_POST['default'] == 'on')) { tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($orders_status_id) . "' where configuration_key = 'DEFAULT_ORDERS_STATUS_ID'"); } - tep_redirect(tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $orders_status_id)); + tep_redirect(tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $orders_status_id)); break; case 'deleteconfirm': - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); + $oID = tep_db_prepare_input($_GET['oID']); $orders_status_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_ORDERS_STATUS_ID'"); $orders_status = tep_db_fetch_array($orders_status_query); @@ -65,10 +65,10 @@ tep_db_query("delete from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . tep_db_input($oID) . "'"); - tep_redirect(tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'])); break; case 'delete': - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); + $oID = tep_db_prepare_input($_GET['oID']); $status_query = tep_db_query("select count(*) as count from " . TABLE_ORDERS . " where orders_status = '" . (int)$oID . "'"); $status = tep_db_fetch_array($status_query); @@ -116,17 +116,17 @@ orders_status_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } if (DEFAULT_ORDERS_STATUS_ID == $orders_status['orders_status_id']) { @@ -137,7 +137,7 @@ ?> - + ' . "\n"; - } - } - } else { - $tableBox_string .= ' table_data_parameters)) { - $tableBox_string .= ' ' . $this->table_data_parameters; - } - $tableBox_string .= '>' . $contents[$i]['text'] . '' . "\n"; - } - - $tableBox_string .= ' ' . "\n"; - if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '' . "\n"; - } - - $tableBox_string .= '
      display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?>display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?>display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
       
      - - + +
      display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?>display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?>display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?>display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?>
      orders_status_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> orders_status_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + + - + '' . TEXT_INFO_HEADING_NEW_ORDERS_STATUS . ''); - $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert')); + $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); $orders_status_inputs_string = ''; @@ -181,12 +181,12 @@ $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('public_flag', '1') . ' ' . TEXT_SET_PUBLIC_STATUS); $contents[] = array('text' => tep_draw_checkbox_field('downloads_flag', '1') . ' ' . TEXT_SET_DOWNLOADS_STATUS); $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page']))); break; case 'edit': $heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_ORDERS_STATUS . ''); - $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=save')); + $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $orders_status_inputs_string = ''; @@ -199,21 +199,21 @@ $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('public_flag', '1', $oInfo->public_flag) . ' ' . TEXT_SET_PUBLIC_STATUS); $contents[] = array('text' => tep_draw_checkbox_field('downloads_flag', '1', $oInfo->downloads_flag) . ' ' . TEXT_SET_DOWNLOADS_STATUS); if (DEFAULT_ORDERS_STATUS_ID != $oInfo->orders_status_id) $contents[] = array('text' => '
      ' . tep_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id))); break; case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_ORDERS_STATUS . ''); - $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('status', FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $oInfo->orders_status_name . ''); - if ($remove_status) $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id))); + if ($remove_status) $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id))); break; default: if (isset($oInfo) && is_object($oInfo)) { $heading[] = array('text' => '' . $oInfo->orders_status_name . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $HTTP_GET_VARS['page'] . '&oID=' . $oInfo->orders_status_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id . '&action=delete'))); $orders_status_inputs_string = ''; $languages = tep_get_languages(); diff --git a/catalog/admin/packingslip.php b/catalog/admin/packingslip.php index 7b24a5195..0e302a5d1 100644 --- a/catalog/admin/packingslip.php +++ b/catalog/admin/packingslip.php @@ -15,7 +15,7 @@ require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); - $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); + $oID = tep_db_prepare_input($_GET['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); include(DIR_WS_CLASSES . 'order.php'); @@ -34,8 +34,8 @@ diff --git a/catalog/admin/popup_image.php b/catalog/admin/popup_image.php deleted file mode 100644 index 587136fdc..000000000 --- a/catalog/admin/popup_image.php +++ /dev/null @@ -1,55 +0,0 @@ - - -> - -<?php echo $page_title; ?> - - - - - - - - - - diff --git a/catalog/admin/products_attributes.php b/catalog/admin/products_attributes.php index d7aa680cb..c225d1a5d 100644 --- a/catalog/admin/products_attributes.php +++ b/catalog/admin/products_attributes.php @@ -13,19 +13,19 @@ require('includes/application_top.php'); $languages = tep_get_languages(); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); - $option_page = (isset($HTTP_GET_VARS['option_page']) && is_numeric($HTTP_GET_VARS['option_page'])) ? $HTTP_GET_VARS['option_page'] : 1; - $value_page = (isset($HTTP_GET_VARS['value_page']) && is_numeric($HTTP_GET_VARS['value_page'])) ? $HTTP_GET_VARS['value_page'] : 1; - $attribute_page = (isset($HTTP_GET_VARS['attribute_page']) && is_numeric($HTTP_GET_VARS['attribute_page'])) ? $HTTP_GET_VARS['attribute_page'] : 1; + $option_page = (isset($_GET['option_page']) && is_numeric($_GET['option_page'])) ? $_GET['option_page'] : 1; + $value_page = (isset($_GET['value_page']) && is_numeric($_GET['value_page'])) ? $_GET['value_page'] : 1; + $attribute_page = (isset($_GET['attribute_page']) && is_numeric($_GET['attribute_page'])) ? $_GET['attribute_page'] : 1; $page_info = 'option_page=' . $option_page . '&value_page=' . $value_page . '&attribute_page=' . $attribute_page; if (tep_not_null($action)) { switch ($action) { case 'add_product_options': - $products_options_id = tep_db_prepare_input($HTTP_POST_VARS['products_options_id']); - $option_name_array = $HTTP_POST_VARS['option_name']; + $products_options_id = tep_db_prepare_input($_POST['products_options_id']); + $option_name_array = $_POST['option_name']; for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); @@ -35,9 +35,9 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'add_product_option_values': - $value_name_array = $HTTP_POST_VARS['value_name']; - $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']); - $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']); + $value_name_array = $_POST['value_name']; + $value_id = tep_db_prepare_input($_POST['value_id']); + $option_id = tep_db_prepare_input($_POST['option_id']); for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]); @@ -50,20 +50,20 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'add_product_attributes': - $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); - $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']); - $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']); - $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']); - $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']); + $products_id = tep_db_prepare_input($_POST['products_id']); + $options_id = tep_db_prepare_input($_POST['options_id']); + $values_id = tep_db_prepare_input($_POST['values_id']); + $value_price = tep_db_prepare_input($_POST['value_price']); + $price_prefix = tep_db_prepare_input($_POST['price_prefix']); tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')"); if (DOWNLOAD_ENABLED == 'true') { $products_attributes_id = tep_db_insert_id(); - $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']); - $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']); - $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']); + $products_attributes_filename = tep_db_prepare_input($_POST['products_attributes_filename']); + $products_attributes_maxdays = tep_db_prepare_input($_POST['products_attributes_maxdays']); + $products_attributes_maxcount = tep_db_prepare_input($_POST['products_attributes_maxcount']); if (tep_not_null($products_attributes_filename)) { tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "')"); @@ -73,8 +73,8 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'update_option_name': - $option_name_array = $HTTP_POST_VARS['option_name']; - $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']); + $option_name_array = $_POST['option_name']; + $option_id = tep_db_prepare_input($_POST['option_id']); for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); @@ -85,9 +85,9 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'update_value': - $value_name_array = $HTTP_POST_VARS['value_name']; - $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']); - $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']); + $value_name_array = $_POST['value_name']; + $value_id = tep_db_prepare_input($_POST['value_id']); + $option_id = tep_db_prepare_input($_POST['option_id']); for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]); @@ -100,19 +100,19 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'update_product_attribute': - $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); - $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']); - $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']); - $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']); - $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']); - $attribute_id = tep_db_prepare_input($HTTP_POST_VARS['attribute_id']); + $products_id = tep_db_prepare_input($_POST['products_id']); + $options_id = tep_db_prepare_input($_POST['options_id']); + $values_id = tep_db_prepare_input($_POST['values_id']); + $value_price = tep_db_prepare_input($_POST['value_price']); + $price_prefix = tep_db_prepare_input($_POST['price_prefix']); + $attribute_id = tep_db_prepare_input($_POST['attribute_id']); tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . (float)tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "' where products_attributes_id = '" . (int)$attribute_id . "'"); if (DOWNLOAD_ENABLED == 'true') { - $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']); - $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']); - $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']); + $products_attributes_filename = tep_db_prepare_input($_POST['products_attributes_filename']); + $products_attributes_maxdays = tep_db_prepare_input($_POST['products_attributes_maxdays']); + $products_attributes_maxcount = tep_db_prepare_input($_POST['products_attributes_maxcount']); if (tep_not_null($products_attributes_filename)) { tep_db_query("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . tep_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . tep_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . tep_db_input($products_attributes_maxcount) . "'"); @@ -122,14 +122,14 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'delete_option': - $option_id = tep_db_prepare_input($HTTP_GET_VARS['option_id']); + $option_id = tep_db_prepare_input($_GET['option_id']); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "'"); tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'delete_value': - $value_id = tep_db_prepare_input($HTTP_GET_VARS['value_id']); + $value_id = tep_db_prepare_input($_GET['value_id']); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . (int)$value_id . "'"); @@ -137,7 +137,7 @@ tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'delete_attribute': - $attribute_id = tep_db_prepare_input($HTTP_GET_VARS['attribute_id']); + $attribute_id = tep_db_prepare_input($_GET['attribute_id']); tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . (int)$attribute_id . "'"); @@ -161,7 +161,7 @@ @@ -173,7 +173,7 @@ @@ -213,7 +213,7 @@ - + '; $inputs = ''; for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { @@ -319,7 +319,7 @@ @@ -331,7 +331,7 @@ @@ -370,7 +370,7 @@ - + '; $inputs = ''; for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { @@ -556,7 +556,7 @@ ?> @@ -640,7 +640,7 @@ - + diff --git a/catalog/admin/products_expected.php b/catalog/admin/products_expected.php index add8c4d1b..a72d770af 100644 --- a/catalog/admin/products_expected.php +++ b/catalog/admin/products_expected.php @@ -37,22 +37,22 @@ products_id)) { echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - + diff --git a/catalog/admin/reviews.php b/catalog/admin/reviews.php index 99580396c..05d44ae2b 100644 --- a/catalog/admin/reviews.php +++ b/catalog/admin/reviews.php @@ -12,37 +12,37 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'setflag': - if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) { - if (isset($HTTP_GET_VARS['rID'])) { - tep_set_review_status($HTTP_GET_VARS['rID'], $HTTP_GET_VARS['flag']); + if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) { + if (isset($_GET['rID'])) { + tep_set_review_status($_GET['rID'], $_GET['flag']); } } - tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID'])); + tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID'])); break; case 'update': - $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']); - $reviews_rating = tep_db_prepare_input($HTTP_POST_VARS['reviews_rating']); - $reviews_text = tep_db_prepare_input($HTTP_POST_VARS['reviews_text']); - $reviews_status = tep_db_prepare_input($HTTP_POST_VARS['reviews_status']); + $reviews_id = tep_db_prepare_input($_GET['rID']); + $reviews_rating = tep_db_prepare_input($_POST['reviews_rating']); + $reviews_text = tep_db_prepare_input($_POST['reviews_text']); + $reviews_status = tep_db_prepare_input($_POST['reviews_status']); tep_db_query("update " . TABLE_REVIEWS . " set reviews_rating = '" . tep_db_input($reviews_rating) . "', reviews_status = '" . tep_db_input($reviews_status) . "', last_modified = now() where reviews_id = '" . (int)$reviews_id . "'"); tep_db_query("update " . TABLE_REVIEWS_DESCRIPTION . " set reviews_text = '" . tep_db_input($reviews_text) . "' where reviews_id = '" . (int)$reviews_id . "'"); - tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $reviews_id)); + tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews_id)); break; case 'deleteconfirm': - $reviews_id = tep_db_prepare_input($HTTP_GET_VARS['rID']); + $reviews_id = tep_db_prepare_input($_GET['rID']); tep_db_query("delete from " . TABLE_REVIEWS . " where reviews_id = '" . (int)$reviews_id . "'"); tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$reviews_id . "'"); - tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'])); break; } } @@ -61,7 +61,7 @@ - + '; + while (dowCnt < this.weekStart + 7) { + html += ''; + } + html += ''; + this.picker.find('.datepicker-days thead').append(html); + }, + + fillMonths: function(){ + var html = ''; + var i = 0 + while (i < 12) { + html += ''+DPGlobal.dates.monthsShort[i++]+''; + } + this.picker.find('.datepicker-months td').append(html); + }, + + fill: function() { + var d = new Date(this.viewDate), + year = d.getFullYear(), + month = d.getMonth(), + currentDate = this.date.valueOf(); + this.picker.find('.datepicker-days th:eq(1)') + .text(DPGlobal.dates.months[month]+' '+year); + var prevMonth = new Date(year, month-1, 28,0,0,0,0), + day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth()); + prevMonth.setDate(day); + prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7); + var nextMonth = new Date(prevMonth); + nextMonth.setDate(nextMonth.getDate() + 42); + nextMonth = nextMonth.valueOf(); + var html = []; + var clsName, + prevY, + prevM; + while(prevMonth.valueOf() < nextMonth) { + if (prevMonth.getDay() === this.weekStart) { + html.push(''); + } + clsName = this.onRender(prevMonth); + prevY = prevMonth.getFullYear(); + prevM = prevMonth.getMonth(); + if ((prevM < month && prevY === year) || prevY < year) { + clsName += ' old'; + } else if ((prevM > month && prevY === year) || prevY > year) { + clsName += ' new'; + } + if (prevMonth.valueOf() === currentDate) { + clsName += ' active'; + } + html.push(''); + if (prevMonth.getDay() === this.weekEnd) { + html.push(''); + } + prevMonth.setDate(prevMonth.getDate()+1); + } + this.picker.find('.datepicker-days tbody').empty().append(html.join('')); + var currentYear = this.date.getFullYear(); + + var months = this.picker.find('.datepicker-months') + .find('th:eq(1)') + .text(year) + .end() + .find('span').removeClass('active'); + if (currentYear === year) { + months.eq(this.date.getMonth()).addClass('active'); + } + + html = ''; + year = parseInt(year/10, 10) * 10; + var yearCont = this.picker.find('.datepicker-years') + .find('th:eq(1)') + .text(year + '-' + (year + 9)) + .end() + .find('td'); + year -= 1; + for (var i = -1; i < 11; i++) { + html += ''+year+''; + year += 1; + } + yearCont.html(html); + }, + + click: function(e) { + e.stopPropagation(); + e.preventDefault(); + var target = $(e.target).closest('span, td, th'); + if (target.length === 1) { + switch(target[0].nodeName.toLowerCase()) { + case 'th': + switch(target[0].className) { + case 'switch': + this.showMode(1); + break; + case 'prev': + case 'next': + this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call( + this.viewDate, + this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) + + DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1) + ); + this.fill(); + this.set(); + break; + } + break; + case 'span': + if (target.is('.month')) { + var month = target.parent().find('span').index(target); + this.viewDate.setMonth(month); + } else { + var year = parseInt(target.text(), 10)||0; + this.viewDate.setFullYear(year); + } + if (this.viewMode !== 0) { + this.date = new Date(this.viewDate); + this.element.trigger({ + type: 'changeDate', + date: this.date, + viewMode: DPGlobal.modes[this.viewMode].clsName + }); + } + this.showMode(-1); + this.fill(); + this.set(); + break; + case 'td': + if (target.is('.day') && !target.is('.disabled')){ + var day = parseInt(target.text(), 10)||1; + var month = this.viewDate.getMonth(); + if (target.is('.old')) { + month -= 1; + } else if (target.is('.new')) { + month += 1; + } + var year = this.viewDate.getFullYear(); + this.date = new Date(year, month, day,0,0,0,0); + this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0); + this.fill(); + this.set(); + this.element.trigger({ + type: 'changeDate', + date: this.date, + viewMode: DPGlobal.modes[this.viewMode].clsName + }); + } + break; + } + } + }, + + mousedown: function(e){ + e.stopPropagation(); + e.preventDefault(); + }, + + showMode: function(dir) { + if (dir) { + this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir)); + } + this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); + } + }; + + $.fn.datepicker = function ( option, val ) { + return this.each(function () { + var $this = $(this), + data = $this.data('datepicker'), + options = typeof option === 'object' && option; + if (!data) { + $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options)))); + } + if (typeof option === 'string') data[option](val); + }); + }; + + $.fn.datepicker.defaults = { + onRender: function(date) { + return ''; + } + }; + $.fn.datepicker.Constructor = Datepicker; + + var DPGlobal = { + modes: [ + { + clsName: 'days', + navFnc: 'Month', + navStep: 1 + }, + { + clsName: 'months', + navFnc: 'FullYear', + navStep: 1 + }, + { + clsName: 'years', + navFnc: 'FullYear', + navStep: 10 + }], + dates:{ + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + }, + isLeapYear: function (year) { + return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) + }, + getDaysInMonth: function (year, month) { + return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] + }, + parseFormat: function(format){ + var separator = format.match(/[.\/\-\s].*?/), + parts = format.split(/\W+/); + if (!separator || !parts || parts.length === 0){ + throw new Error("Invalid date format."); + } + return {separator: separator, parts: parts}; + }, + parseDate: function(date, format) { + var parts = date.split(format.separator), + date = new Date(), + val; + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + date.setMilliseconds(0); + if (parts.length === format.parts.length) { + var year = date.getFullYear(), day = date.getDate(), month = date.getMonth(); + for (var i=0, cnt = format.parts.length; i < cnt; i++) { + val = parseInt(parts[i], 10)||1; + switch(format.parts[i]) { + case 'dd': + case 'd': + day = val; + date.setDate(val); + break; + case 'mm': + case 'm': + month = val - 1; + date.setMonth(val - 1); + break; + case 'yy': + year = 2000 + val; + date.setFullYear(2000 + val); + break; + case 'yyyy': + year = val; + date.setFullYear(val); + break; + } + } + date = new Date(year, month, day, 0 ,0 ,0); + } + return date; + }, + formatDate: function(date, format){ + var val = { + d: date.getDate(), + m: date.getMonth() + 1, + yy: date.getFullYear().toString().substring(2), + yyyy: date.getFullYear() + }; + val.dd = (val.d < 10 ? '0' : '') + val.d; + val.mm = (val.m < 10 ? '0' : '') + val.m; + var date = []; + for (var i=0, cnt = format.parts.length; i < cnt; i++) { + date.push(val[format.parts[i]]); + } + return date.join(format.separator); + }, + headTemplate: ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '', + contTemplate: '' + }; + DPGlobal.template = '
      display_count($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS); ?>display_links($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS_STATUS); ?>display_links($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      - - + +
      ' . nl2br(STORE_ADDRESS) . '
      ' . STORE_PHONE; ?>


       

       


       

       
                           
      products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + +
      display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED); ?>display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS_EXPECTED); ?>display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      @@ -116,14 +116,14 @@ - + - +
      products_name; ?>
      customers_name; ?>

      date_added); ?>
      reviews_id) . tep_draw_hidden_field('products_id', $rInfo->products_id) . tep_draw_hidden_field('customers_name', $rInfo->customers_name) . tep_draw_hidden_field('products_name', $rInfo->products_name) . tep_draw_hidden_field('products_image', $rInfo->products_image) . tep_draw_hidden_field('date_added', $rInfo->date_added) . tep_draw_button(IMAGE_PREVIEW, 'document') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $HTTP_GET_VARS['rID'])); ?>reviews_id) . tep_draw_hidden_field('products_id', $rInfo->products_id) . tep_draw_hidden_field('customers_name', $rInfo->customers_name) . tep_draw_hidden_field('products_name', $rInfo->products_name) . tep_draw_hidden_field('products_image', $rInfo->products_image) . tep_draw_hidden_field('date_added', $rInfo->date_added) . tep_draw_button(IMAGE_PREVIEW, 'document') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID'])); ?>
      @@ -164,22 +164,22 @@ $value ) echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value))); ?> - + reviews_id; + $back_url_params = 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id; } ?> @@ -202,10 +202,10 @@ reviews_id) ) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - + - + @@ -262,16 +262,16 @@ case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_REVIEW . ''); - $contents = array('form' => tep_draw_form('reviews', FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('reviews', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_REVIEW_INTRO); $contents[] = array('text' => '
      ' . $rInfo->products_name . ''); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id))); break; default: if (isset($rInfo) && is_object($rInfo)) { $heading[] = array('text' => '' . $rInfo->products_name . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_REVIEWS, 'page=' . $HTTP_GET_VARS['page'] . '&rID=' . $rInfo->reviews_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=delete'))); $contents[] = array('text' => '
      ' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($rInfo->date_added)); if (tep_not_null($rInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($rInfo->last_modified)); $contents[] = array('text' => '
      ' . tep_info_image($rInfo->products_image, $rInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); diff --git a/catalog/admin/server_info.php b/catalog/admin/server_info.php index d85973c0a..ae8257bec 100644 --- a/catalog/admin/server_info.php +++ b/catalog/admin/server_info.php @@ -12,7 +12,7 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); switch ($action) { case 'export': diff --git a/catalog/admin/specials.php b/catalog/admin/specials.php index d1281a64d..a5d58990f 100644 --- a/catalog/admin/specials.php +++ b/catalog/admin/specials.php @@ -15,20 +15,20 @@ require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'setflag': - tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']); + tep_set_specials_status($_GET['id'], $_GET['flag']); - tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'])); + tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'sID=' . $_GET['id'])); break; case 'insert': - $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); - $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']); - $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']); - $expdate = tep_db_prepare_input($HTTP_POST_VARS['expdate']); + $products_id = tep_db_prepare_input($_POST['products_id']); + $products_price = tep_db_prepare_input($_POST['products_price']); + $specials_price = tep_db_prepare_input($_POST['specials_price']); + $expdate = tep_db_prepare_input($_POST['expdate']); if (substr($specials_price, -1) == '%') { $new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); @@ -45,13 +45,13 @@ tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), " . (tep_not_null($expires_date) ? "'" . tep_db_input($expires_date) . "'" : 'null') . ", '1')"); - tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'])); break; case 'update': - $specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']); - $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']); - $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']); - $expdate = tep_db_prepare_input($HTTP_POST_VARS['expdate']); + $specials_id = tep_db_prepare_input($_POST['specials_id']); + $products_price = tep_db_prepare_input($_POST['products_price']); + $specials_price = tep_db_prepare_input($_POST['specials_price']); + $expdate = tep_db_prepare_input($_POST['expdate']); if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price)); @@ -62,14 +62,14 @@ tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = " . (tep_not_null($expires_date) ? "'" . tep_db_input($expires_date) . "'" : 'null') . " where specials_id = '" . (int)$specials_id . "'"); - tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id)); + tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $specials_id)); break; case 'deleteconfirm': - $specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']); + $specials_id = tep_db_prepare_input($_GET['sID']); tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'"); - tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'])); break; } } @@ -89,10 +89,10 @@ - method="post"> + method="post">tax_class_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo' ' . "\n"; + echo' ' . "\n"; } ?> - + +
      products_name; ?>
      customers_name; ?>

      date_added); ?>
      reviews_id)); ?>reviews_id)); ?>
      ' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . tep_get_products_name($reviews['products_id']); ?>' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . ' ' . tep_get_products_name($reviews['products_id']); ?> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . ''; + echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . ''; } else { - echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); + echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); } ?>reviews_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> reviews_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + +
      display_count($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?>display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS); ?>display_links($reviews_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>

      @@ -136,7 +136,7 @@ @@ -155,10 +155,10 @@ specials_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> @@ -181,7 +181,7 @@ echo '' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); } ?> - + - + @@ -85,7 +84,7 @@ - +
        - +



      specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> specials_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + + - + '' . TEXT_INFO_HEADING_DELETE_SPECIALS . ''); - $contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('specials', FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $sInfo->products_name . ''); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id))); break; default: if (is_object($sInfo)) { $heading[] = array('text' => '' . $sInfo->products_name . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $sInfo->specials_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=delete'))); $contents[] = array('text' => '
      ' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($sInfo->specials_date_added)); $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($sInfo->specials_last_modified)); $contents[] = array('align' => 'center', 'text' => '
      ' . tep_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)); diff --git a/catalog/admin/stats_customers.php b/catalog/admin/stats_customers.php index 0833edbba..3d0df6736 100644 --- a/catalog/admin/stats_customers.php +++ b/catalog/admin/stats_customers.php @@ -37,9 +37,9 @@ 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; + if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; $customers_query_raw = "select c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC"; - $customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows); + $customers_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows); // fix counted customers $customers_query_numrows = tep_db_query("select customers_id from " . TABLE_ORDERS . " group by customers_id"); $customers_query_numrows = tep_db_num_rows($customers_query_numrows); @@ -66,8 +66,8 @@ diff --git a/catalog/admin/stats_products_purchased.php b/catalog/admin/stats_products_purchased.php index 0ca5f48d7..502fcf265 100644 --- a/catalog/admin/stats_products_purchased.php +++ b/catalog/admin/stats_products_purchased.php @@ -34,9 +34,9 @@ 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; + if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; $products_query_raw = "select p.products_id, p.products_ordered, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id. "' and p.products_ordered > 0 group by pd.products_id order by p.products_ordered DESC, pd.products_name"; - $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); + $products_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $rows = 0; $products_query = tep_db_query($products_query_raw); @@ -47,9 +47,9 @@ $rows = '0' . $rows; } ?> - + - + diff --git a/catalog/admin/stats_products_viewed.php b/catalog/admin/stats_products_viewed.php index 45fec795c..62bbfd9b8 100644 --- a/catalog/admin/stats_products_viewed.php +++ b/catalog/admin/stats_products_viewed.php @@ -34,10 +34,10 @@ 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; + if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS; $rows = 0; $products_query_raw = "select p.products_id, pd.products_name, pd.products_viewed, l.name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC"; - $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); + $products_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $rows++; @@ -46,9 +46,9 @@ $rows = '0' . $rows; } ?> - + - + diff --git a/catalog/admin/store_logo.php b/catalog/admin/store_logo.php index 009ff4833..0958b51a6 100644 --- a/catalog/admin/store_logo.php +++ b/catalog/admin/store_logo.php @@ -5,14 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2014 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { @@ -20,14 +20,13 @@ $error = false; $store_logo = new upload('store_logo'); - $store_logo->set_extensions('png'); + $store_logo->set_extensions(array('png', 'gif', 'jpg')); $store_logo->set_destination(DIR_FS_CATALOG_IMAGES); if ($store_logo->parse()) { - $store_logo->set_filename('store_logo.png'); - if ($store_logo->save()) { $messageStack->add_session(SUCCESS_LOGO_UPDATED, 'success'); + tep_db_query("update configuration set configuration_value = '" . tep_db_input($store_logo->filename) . "', last_modified = now() where configuration_value = '" . STORE_LOGO . "'"); } else { $error = true; } @@ -59,7 +58,7 @@
      display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?>display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?>display_links($specials_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
       
      - - + +
      display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?>display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?> display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?>display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> 
       
      .' . $products['products_name'] . ''; ?>' . $products['products_name'] . ''; ?>  
      - - + +
      display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?> display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> 
       
      .' . $products['products_name'] . ' (' . $products['name'] . ')'; ?>' . $products['products_name'] . ' (' . $products['name'] . ')'; ?>  
      - - + +
      display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?>display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      diff --git a/catalog/admin/tax_classes.php b/catalog/admin/tax_classes.php index 20f4e3174..325fc70a5 100644 --- a/catalog/admin/tax_classes.php +++ b/catalog/admin/tax_classes.php @@ -12,33 +12,33 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': - $tax_class_title = tep_db_prepare_input($HTTP_POST_VARS['tax_class_title']); - $tax_class_description = tep_db_prepare_input($HTTP_POST_VARS['tax_class_description']); + $tax_class_title = tep_db_prepare_input($_POST['tax_class_title']); + $tax_class_description = tep_db_prepare_input($_POST['tax_class_description']); tep_db_query("insert into " . TABLE_TAX_CLASS . " (tax_class_title, tax_class_description, date_added) values ('" . tep_db_input($tax_class_title) . "', '" . tep_db_input($tax_class_description) . "', now())"); tep_redirect(tep_href_link(FILENAME_TAX_CLASSES)); break; case 'save': - $tax_class_id = tep_db_prepare_input($HTTP_GET_VARS['tID']); - $tax_class_title = tep_db_prepare_input($HTTP_POST_VARS['tax_class_title']); - $tax_class_description = tep_db_prepare_input($HTTP_POST_VARS['tax_class_description']); + $tax_class_id = tep_db_prepare_input($_GET['tID']); + $tax_class_title = tep_db_prepare_input($_POST['tax_class_title']); + $tax_class_description = tep_db_prepare_input($_POST['tax_class_description']); tep_db_query("update " . TABLE_TAX_CLASS . " set tax_class_id = '" . (int)$tax_class_id . "', tax_class_title = '" . tep_db_input($tax_class_title) . "', tax_class_description = '" . tep_db_input($tax_class_description) . "', last_modified = now() where tax_class_id = '" . (int)$tax_class_id . "'"); - tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tax_class_id)); + tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tax_class_id)); break; case 'deleteconfirm': - $tax_class_id = tep_db_prepare_input($HTTP_GET_VARS['tID']); + $tax_class_id = tep_db_prepare_input($_GET['tID']); tep_db_query("delete from " . TABLE_TAX_CLASS . " where tax_class_id = '" . (int)$tax_class_id . "'"); - tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'])); break; } } @@ -65,21 +65,21 @@
      tax_class_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> tax_class_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + + - + '' . TEXT_INFO_HEADING_NEW_TAX_CLASS . ''); - $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert')); + $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_TITLE . '
      ' . tep_draw_input_field('tax_class_title')); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_DESCRIPTION . '
      ' . tep_draw_input_field('tax_class_description')); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'plus', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'plus', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page']))); break; case 'edit': $heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_TAX_CLASS . ''); - $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=save')); + $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_TITLE . '
      ' . tep_draw_input_field('tax_class_title', $tcInfo->tax_class_title)); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_DESCRIPTION . '
      ' . tep_draw_input_field('tax_class_description', $tcInfo->tax_class_description)); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id))); break; case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_TAX_CLASS . ''); - $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $tcInfo->tax_class_title . ''); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id))); break; default: if (isset($tcInfo) && is_object($tcInfo)) { $heading[] = array('text' => '' . $tcInfo->tax_class_title . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=delete'))); $contents[] = array('text' => '
      ' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($tcInfo->date_added)); $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($tcInfo->last_modified)); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_DESCRIPTION . '
      ' . $tcInfo->tax_class_description); diff --git a/catalog/admin/tax_rates.php b/catalog/admin/tax_rates.php index 30d03f85e..53473fb17 100644 --- a/catalog/admin/tax_rates.php +++ b/catalog/admin/tax_rates.php @@ -12,39 +12,39 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': - $tax_zone_id = tep_db_prepare_input($HTTP_POST_VARS['tax_zone_id']); - $tax_class_id = tep_db_prepare_input($HTTP_POST_VARS['tax_class_id']); - $tax_rate = tep_db_prepare_input($HTTP_POST_VARS['tax_rate']); - $tax_description = tep_db_prepare_input($HTTP_POST_VARS['tax_description']); - $tax_priority = tep_db_prepare_input($HTTP_POST_VARS['tax_priority']); + $tax_zone_id = tep_db_prepare_input($_POST['tax_zone_id']); + $tax_class_id = tep_db_prepare_input($_POST['tax_class_id']); + $tax_rate = tep_db_prepare_input($_POST['tax_rate']); + $tax_description = tep_db_prepare_input($_POST['tax_description']); + $tax_priority = tep_db_prepare_input($_POST['tax_priority']); tep_db_query("insert into " . TABLE_TAX_RATES . " (tax_zone_id, tax_class_id, tax_rate, tax_description, tax_priority, date_added) values ('" . (int)$tax_zone_id . "', '" . (int)$tax_class_id . "', '" . tep_db_input($tax_rate) . "', '" . tep_db_input($tax_description) . "', '" . tep_db_input($tax_priority) . "', now())"); tep_redirect(tep_href_link(FILENAME_TAX_RATES)); break; case 'save': - $tax_rates_id = tep_db_prepare_input($HTTP_GET_VARS['tID']); - $tax_zone_id = tep_db_prepare_input($HTTP_POST_VARS['tax_zone_id']); - $tax_class_id = tep_db_prepare_input($HTTP_POST_VARS['tax_class_id']); - $tax_rate = tep_db_prepare_input($HTTP_POST_VARS['tax_rate']); - $tax_description = tep_db_prepare_input($HTTP_POST_VARS['tax_description']); - $tax_priority = tep_db_prepare_input($HTTP_POST_VARS['tax_priority']); + $tax_rates_id = tep_db_prepare_input($_GET['tID']); + $tax_zone_id = tep_db_prepare_input($_POST['tax_zone_id']); + $tax_class_id = tep_db_prepare_input($_POST['tax_class_id']); + $tax_rate = tep_db_prepare_input($_POST['tax_rate']); + $tax_description = tep_db_prepare_input($_POST['tax_description']); + $tax_priority = tep_db_prepare_input($_POST['tax_priority']); tep_db_query("update " . TABLE_TAX_RATES . " set tax_rates_id = '" . (int)$tax_rates_id . "', tax_zone_id = '" . (int)$tax_zone_id . "', tax_class_id = '" . (int)$tax_class_id . "', tax_rate = '" . tep_db_input($tax_rate) . "', tax_description = '" . tep_db_input($tax_description) . "', tax_priority = '" . tep_db_input($tax_priority) . "', last_modified = now() where tax_rates_id = '" . (int)$tax_rates_id . "'"); - tep_redirect(tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tax_rates_id)); + tep_redirect(tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $tax_rates_id)); break; case 'deleteconfirm': - $tax_rates_id = tep_db_prepare_input($HTTP_GET_VARS['tID']); + $tax_rates_id = tep_db_prepare_input($_GET['tID']); tep_db_query("delete from " . TABLE_TAX_RATES . " where tax_rates_id = '" . (int)$tax_rates_id . "'"); - tep_redirect(tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'])); break; } } @@ -74,24 +74,24 @@ tax_rates_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - +
      display_count($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES); ?>display_links($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_TAX_CLASSES); ?>display_links($classes_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      %tax_rates_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> tax_rates_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + + - + '' . TEXT_INFO_HEADING_NEW_TAX_RATE . ''); - $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert')); + $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_TITLE . '
      ' . tep_tax_classes_pull_down('name="tax_class_id" style="font-size:10px"')); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONE_NAME . '
      ' . tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"')); $contents[] = array('text' => '
      ' . TEXT_INFO_TAX_RATE . '
      ' . tep_draw_input_field('tax_rate')); $contents[] = array('text' => '
      ' . TEXT_INFO_RATE_DESCRIPTION . '
      ' . tep_draw_input_field('tax_description')); $contents[] = array('text' => '
      ' . TEXT_INFO_TAX_RATE_PRIORITY . '
      ' . tep_draw_input_field('tax_priority')); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page']))); break; case 'edit': $heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_TAX_RATE . ''); - $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=save')); + $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_CLASS_TITLE . '
      ' . tep_tax_classes_pull_down('name="tax_class_id" style="font-size:10px"', $trInfo->tax_class_id)); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONE_NAME . '
      ' . tep_geo_zones_pull_down('name="tax_zone_id" style="font-size:10px"', $trInfo->geo_zone_id)); $contents[] = array('text' => '
      ' . TEXT_INFO_TAX_RATE . '
      ' . tep_draw_input_field('tax_rate', $trInfo->tax_rate)); $contents[] = array('text' => '
      ' . TEXT_INFO_RATE_DESCRIPTION . '
      ' . tep_draw_input_field('tax_description', $trInfo->tax_description)); $contents[] = array('text' => '
      ' . TEXT_INFO_TAX_RATE_PRIORITY . '
      ' . tep_draw_input_field('tax_priority', $trInfo->tax_priority)); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id))); break; case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_TAX_RATE . ''); - $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('rates', FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $trInfo->tax_class_title . ' ' . number_format($trInfo->tax_rate, TAX_DECIMAL_PLACES) . '%'); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id))); break; default: if (is_object($trInfo)) { $heading[] = array('text' => '' . $trInfo->tax_class_title . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_TAX_RATES, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=delete'))); $contents[] = array('text' => '
      ' . TEXT_INFO_DATE_ADDED . ' ' . tep_date_short($trInfo->date_added)); $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . tep_date_short($trInfo->last_modified)); $contents[] = array('text' => '
      ' . TEXT_INFO_RATE_DESCRIPTION . '
      ' . $trInfo->tax_description); diff --git a/catalog/admin/whos_online.php b/catalog/admin/whos_online.php index 12cef4cd6..3a519b4d9 100644 --- a/catalog/admin/whos_online.php +++ b/catalog/admin/whos_online.php @@ -49,7 +49,7 @@ $whos_online_query = tep_db_query("select customer_id, full_name, ip_address, time_entry, time_last_click, last_page_url, session_id from " . TABLE_WHOS_ONLINE); while ($whos_online = tep_db_fetch_array($whos_online_query)) { $time_online = (time() - $whos_online['time_entry']); - if ((!isset($HTTP_GET_VARS['info']) || (isset($HTTP_GET_VARS['info']) && ($HTTP_GET_VARS['info'] == $whos_online['session_id']))) && !isset($info)) { + if ((!isset($_GET['info']) || (isset($_GET['info']) && ($_GET['info'] == $whos_online['session_id']))) && !isset($info)) { $info = new ObjectInfo($whos_online); } diff --git a/catalog/admin/zones.php b/catalog/admin/zones.php index 7de127c5a..c1cda2ce8 100644 --- a/catalog/admin/zones.php +++ b/catalog/admin/zones.php @@ -12,35 +12,35 @@ require('includes/application_top.php'); - $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); + $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'insert': - $zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']); - $zone_code = tep_db_prepare_input($HTTP_POST_VARS['zone_code']); - $zone_name = tep_db_prepare_input($HTTP_POST_VARS['zone_name']); + $zone_country_id = tep_db_prepare_input($_POST['zone_country_id']); + $zone_code = tep_db_prepare_input($_POST['zone_code']); + $zone_name = tep_db_prepare_input($_POST['zone_name']); tep_db_query("insert into " . TABLE_ZONES . " (zone_country_id, zone_code, zone_name) values ('" . (int)$zone_country_id . "', '" . tep_db_input($zone_code) . "', '" . tep_db_input($zone_name) . "')"); tep_redirect(tep_href_link(FILENAME_ZONES)); break; case 'save': - $zone_id = tep_db_prepare_input($HTTP_GET_VARS['cID']); - $zone_country_id = tep_db_prepare_input($HTTP_POST_VARS['zone_country_id']); - $zone_code = tep_db_prepare_input($HTTP_POST_VARS['zone_code']); - $zone_name = tep_db_prepare_input($HTTP_POST_VARS['zone_name']); + $zone_id = tep_db_prepare_input($_GET['cID']); + $zone_country_id = tep_db_prepare_input($_POST['zone_country_id']); + $zone_code = tep_db_prepare_input($_POST['zone_code']); + $zone_name = tep_db_prepare_input($_POST['zone_name']); tep_db_query("update " . TABLE_ZONES . " set zone_country_id = '" . (int)$zone_country_id . "', zone_code = '" . tep_db_input($zone_code) . "', zone_name = '" . tep_db_input($zone_name) . "' where zone_id = '" . (int)$zone_id . "'"); - tep_redirect(tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $zone_id)); + tep_redirect(tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $zone_id)); break; case 'deleteconfirm': - $zone_id = tep_db_prepare_input($HTTP_GET_VARS['cID']); + $zone_id = tep_db_prepare_input($_GET['cID']); tep_db_query("delete from " . TABLE_ZONES . " where zone_id = '" . (int)$zone_id . "'"); - tep_redirect(tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'])); + tep_redirect(tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page'])); break; } } @@ -69,23 +69,23 @@ zone_id)) { - echo ' ' . "\n"; + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - + - -
      display_count($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_TAX_RATES); ?>display_links($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_TAX_RATES); ?>display_links($rates_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      zone_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> zone_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
      - - + + - + '' . TEXT_INFO_HEADING_NEW_ZONE . ''); - $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&action=insert')); + $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONES_NAME . '
      ' . tep_draw_input_field('zone_name')); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONES_CODE . '
      ' . tep_draw_input_field('zone_code')); $contents[] = array('text' => '
      ' . TEXT_INFO_COUNTRY_NAME . '
      ' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries())); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page']))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page']))); break; case 'edit': $heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_ZONE . ''); - $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=save')); + $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONES_NAME . '
      ' . tep_draw_input_field('zone_name', $cInfo->zone_name)); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONES_CODE . '
      ' . tep_draw_input_field('zone_code', $cInfo->zone_code)); $contents[] = array('text' => '
      ' . TEXT_INFO_COUNTRY_NAME . '
      ' . tep_draw_pull_down_menu('zone_country_id', tep_get_countries(), $cInfo->countries_id)); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id))); break; case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_ZONE . ''); - $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
      ' . $cInfo->zone_name . ''); - $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id))); + $contents[] = array('align' => 'center', 'text' => '
      ' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id))); break; default: if (isset($cInfo) && is_object($cInfo)) { $heading[] = array('text' => '' . $cInfo->zone_name . ''); - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_ZONES, 'page=' . $HTTP_GET_VARS['page'] . '&cID=' . $cInfo->zone_id . '&action=delete'))); + $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=delete'))); $contents[] = array('text' => '
      ' . TEXT_INFO_ZONES_NAME . '
      ' . $cInfo->zone_name . ' (' . $cInfo->zone_code . ')'); $contents[] = array('text' => '
      ' . TEXT_INFO_COUNTRY_NAME . ' ' . $cInfo->countries_name); } diff --git a/catalog/advanced_search.php b/catalog/advanced_search.php index d4cf2675c..b9219e47c 100644 --- a/catalog/advanced_search.php +++ b/catalog/advanced_search.php @@ -5,109 +5,26 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/advanced_search.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH)); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('advanced_search.php')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> - - - -

      +size('search') > 0) { @@ -115,76 +32,118 @@ function popupWindow(url) { } ?> - + true]); ?>
      -

      -
      - + +

      + +
      + +
      + +

      -
      - ' . TEXT_SEARCH_HELP_LINK . ''; ?> - +
      +
      +
      -
      -

      + - -
      -
      display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ZONES); ?>display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?>display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_ZONES); ?>display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      '', 'text' => TEXT_ALL_CATEGORIES)))); ?>
       
      '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?>
      +
      + +
      + +
      + '', 'text' => TEXT_ALL_CATEGORIES))), null, 'id="entryCategories"'); + ?> +
      +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      + '', 'text' => TEXT_ALL_MANUFACTURERS))), null, 'id="entryManufacturers"'); + ?> +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      + + diff --git a/catalog/advanced_search_result.php b/catalog/advanced_search_result.php index d4bf90686..5c071f588 100644 --- a/catalog/advanced_search_result.php +++ b/catalog/advanced_search_result.php @@ -5,22 +5,25 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/advanced_search.php'); $error = false; - if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) && - (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) && - (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) && - (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) && - (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) { + if ( (isset($_GET['keywords']) && empty($_GET['keywords'])) && + (isset($_GET['dfrom']) && (empty($_GET['dfrom']) || ($_GET['dfrom'] == DOB_FORMAT_STRING))) && + (isset($_GET['dto']) && (empty($_GET['dto']) || ($_GET['dto'] == DOB_FORMAT_STRING))) && + (isset($_GET['pfrom']) && !is_numeric($_GET['pfrom'])) && + (isset($_GET['pto']) && !is_numeric($_GET['pto'])) ) { $error = true; $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT); @@ -31,24 +34,24 @@ $pto = ''; $keywords = ''; - if (isset($HTTP_GET_VARS['dfrom'])) { - $dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']); + if (isset($_GET['dfrom'])) { + $dfrom = (($_GET['dfrom'] == DOB_FORMAT_STRING) ? '' : $_GET['dfrom']); } - if (isset($HTTP_GET_VARS['dto'])) { - $dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']); + if (isset($_GET['dto'])) { + $dto = (($_GET['dto'] == DOB_FORMAT_STRING) ? '' : $_GET['dto']); } - if (isset($HTTP_GET_VARS['pfrom'])) { - $pfrom = $HTTP_GET_VARS['pfrom']; + if (isset($_GET['pfrom'])) { + $pfrom = $_GET['pfrom']; } - if (isset($HTTP_GET_VARS['pto'])) { - $pto = $HTTP_GET_VARS['pto']; + if (isset($_GET['pto'])) { + $pto = $_GET['pto']; } - if (isset($HTTP_GET_VARS['keywords'])) { - $keywords = tep_db_prepare_input($HTTP_GET_VARS['keywords']); + if (isset($_GET['keywords'])) { + $keywords = HTML::sanitize($_GET['keywords']); } $date_check_error = false; @@ -106,7 +109,9 @@ } if (tep_not_null($keywords)) { - if (!tep_parse_search_string($keywords, $search_keywords)) { + $search_keywords = explode(' ', $keywords); + + if (empty($search_keywords)) { $error = true; $messageStack->add_session('search', ERROR_INVALID_KEYWORDS); @@ -121,16 +126,18 @@ } if ($error == true) { - tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false)); + OSCOM::redirect('advanced_search.php', tep_get_all_get_params(), 'NONSSL', true, false); } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH)); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false)); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('advanced_search.php')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('advanced_search_result.php', tep_get_all_get_params(), 'NONSSL', true, false)); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      +
      @@ -148,179 +155,244 @@ asort($define_list); $column_list = array(); - reset($define_list); - while (list($key, $value) = each($define_list)) { + + foreach($define_list as $key => $value) { if ($value > 0) $column_list[] = $key; } - $select_column_list = ''; + $search_query = 'select SQL_CALC_FOUND_ROWS distinct'; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PRODUCT_LIST_MODEL': - $select_column_list .= 'p.products_model, '; + $search_query .= ' p.products_model,'; break; case 'PRODUCT_LIST_MANUFACTURER': - $select_column_list .= 'm.manufacturers_name, '; + $search_query .= ' m.manufacturers_name,'; break; case 'PRODUCT_LIST_QUANTITY': - $select_column_list .= 'p.products_quantity, '; + $search_query .= ' p.products_quantity,'; break; case 'PRODUCT_LIST_IMAGE': - $select_column_list .= 'p.products_image, '; + $search_query .= ' p.products_image,'; break; case 'PRODUCT_LIST_WEIGHT': - $select_column_list .= 'p.products_weight, '; + $search_query .= ' p.products_weight,'; break; } } - $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price "; + $search_query .= ' m.manufacturers_id, p.products_id, SUBSTRING_INDEX(pd.products_description, " ", 20) as products_description, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price'; if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { - $select_str .= ", SUM(tr.tax_rate) as tax_rate "; + $search_query .= ', SUM(tr.tax_rate) as tax_rate'; } - $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id"; + $search_query .= ' from :table_products p left join :table_manufacturers m using(manufacturers_id) left join :table_specials s on p.products_id = s.products_id'; if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { - if (!tep_session_is_registered('customer_country_id')) { - $customer_country_id = STORE_COUNTRY; - $customer_zone_id = STORE_ZONE; + if (!isset($_SESSION['customer_country_id'])) { + $_SESSION['customer_country_id'] = STORE_COUNTRY; + $_SESSION['customer_zone_id'] = STORE_ZONE; } - $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')"; + $search_query .= ' left join :table_tax_rates tr on p.products_tax_class_id = tr.tax_class_id left join :table_zones_to_geo_zones gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = "0" or gz.zone_country_id = :zone_country_id) and (gz.zone_id is null or gz.zone_id = "0" or gz.zone_id = :zone_id)'; } - $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; + $search_query .= ', :table_products_description pd, :table_categories c, :table_products_to_categories p2c where p.products_status = "1" and p.products_id = pd.products_id and pd.language_id = :language_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id'; - $where_str = " where p.products_status = '1' 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 "; - - if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) { - if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) { + if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) { + if (isset($_GET['inc_subcat']) && ($_GET['inc_subcat'] == '1')) { $subcategories_array = array(); - tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']); + tep_get_subcategories($subcategories_array, $_GET['categories_id']); - $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'"; + $search_query .= ' and (p2c.categories_id = :categories_id'; for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) { - $where_str .= " or p2c.categories_id = '" . (int)$subcategories_array[$i] . "'"; + $search_query .= ' or p2c.categories_id = :categories_id_' . $i; } - $where_str .= ")"; + $search_query .= ')'; } else { - $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'"; + $search_query .= ' and p2c.categories_id = :categories_id'; } } - if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { - $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; + if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { + $search_query .= ' and m.manufacturers_id = :manufacturers_id'; } if (isset($search_keywords) && (sizeof($search_keywords) > 0)) { - $where_str .= " and ("; + $search_query .= ' and ('; + for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) { - switch ($search_keywords[$i]) { - case '(': - case ')': - case 'and': - case 'or': - $where_str .= " " . $search_keywords[$i] . " "; - break; - default: - $keyword = tep_db_prepare_input($search_keywords[$i]); - $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'"; - if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'"; - $where_str .= ')'; - break; + $search_query .= '(pd.products_name like :products_name_' . $i . ' or p.products_model like :products_model_' . $i . ' or m.manufacturers_name like :manufacturers_name_' . $i; + + if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) { + $search_query .= ' or pd.products_description like :products_description_' . $i; } + + $search_query .= ') and '; } - $where_str .= " )"; + + $search_query = substr($search_query, 0, -5) . ')'; } if (tep_not_null($dfrom)) { - $where_str .= " and p.products_date_added >= '" . tep_date_raw($dfrom) . "'"; + $search_query .= ' and p.products_date_added >= :products_date_added_from'; } if (tep_not_null($dto)) { - $where_str .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'"; + $search_query .= ' and p.products_date_added <= :products_date_added_to'; } - if (tep_not_null($pfrom)) { - if ($currencies->is_set($currency)) { - $rate = $currencies->get_value($currency); + if (tep_not_null($pfrom) || tep_not_null($pto)) { + $rate = $currencies->get_value($_SESSION['currency']); + if (tep_not_null($pfrom)) { $pfrom = $pfrom / $rate; } - } - if (tep_not_null($pto)) { - if (isset($rate)) { + if (tep_not_null($pto)) { $pto = $pto / $rate; } } if (DISPLAY_PRICE_WITH_TAX == 'true') { - if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")"; - if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")"; + if ($pfrom > 0) { + $search_query .= ' and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= :price_from)'; + } + + if ($pto > 0) { + $search_query .= ' and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= :price_to)'; + } } else { - if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")"; - if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")"; + if ($pfrom > 0) { + $search_query .= ' and (IF(s.status, s.specials_new_products_price, p.products_price) >= :price_from)'; + } + + if ($pto > 0) { + $search_query .= ' and (IF(s.status, s.specials_new_products_price, p.products_price) <= :price_to)'; + } } if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { - $where_str .= " group by p.products_id, tr.tax_priority"; + $search_query .= ' group by p.products_id, tr.tax_priority'; } - if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { + if ( (!isset($_GET['sort'])) || (!preg_match('/^[1-8][ad]$/', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { - $HTTP_GET_VARS['sort'] = $i+1 . 'a'; - $order_str = " order by pd.products_name"; + $_GET['sort'] = $i+1 . 'a'; + $search_query .= ' order by pd.products_name'; break; } } } else { - $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); - $sort_order = substr($HTTP_GET_VARS['sort'], 1); + $sort_col = substr($_GET['sort'], 0 , 1); + $sort_order = substr($_GET['sort'], 1); switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': - $order_str = " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by p.products_model ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_NAME': - $order_str = " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); + $search_query .= ' order by pd.products_name ' . ($sort_order == 'd' ? 'desc' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': - $order_str = " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by m.manufacturers_name ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_QUANTITY': - $order_str = " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by p.products_quantity ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_IMAGE': - $order_str = " order by pd.products_name"; + $search_query .= ' order by pd.products_name'; break; case 'PRODUCT_LIST_WEIGHT': - $order_str = " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by p.products_weight ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_PRICE': - $order_str = " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by final_price ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; } } - $listing_sql = $select_str . $from_str . $where_str . $order_str; + $search_query .= ' limit :page_set_offset, :page_set_max_results'; + + $Qlisting = $OSCOM_Db->prepare($search_query); + + if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) { + $Qlisting->bindInt(':zone_country_id', $_SESSION['customer_country_id']); + $Qlisting->bindInt(':zone_id', $_SESSION['customer_zone_id']); + } + + $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); + + if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) { + $Qlisting->bindInt(':categories_id', $_GET['categories_id']); + + if (isset($_GET['inc_subcat']) && ($_GET['inc_subcat'] == '1')) { + for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) { + $Qlisting->bindInt(':categories_id_' . $i, $subcategories_array[$i]); + } + } + } + + if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { + $Qlisting->bindInt(':manufacturers_id', $_GET['manufacturers_id']); + } + + if (isset($search_keywords) && (sizeof($search_keywords) > 0)) { + for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) { + $Qlisting->bindValue(':products_name_' . $i, '%' . $search_keywords[$i] . '%'); + $Qlisting->bindValue(':products_model_' . $i, '%' . $search_keywords[$i] . '%'); + $Qlisting->bindValue(':manufacturers_name_' . $i, '%' . $search_keywords[$i] . '%'); + + if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) { + $Qlisting->bindValue(':products_description_' . $i, '%' . $search_keywords[$i] . '%'); + } + } + } + + if (tep_not_null($dfrom)) { + $Qlisting->bindValue(':products_date_added_from', tep_date_raw($dfrom)); + } + + if (tep_not_null($dto)) { + $Qlisting->bindValue(':products_date_added_to', tep_date_raw($dto)); + } + + if (DISPLAY_PRICE_WITH_TAX == 'true') { + if ($pfrom > 0) { + $Qlisting->bindDecimal(':price_from', $pfrom); + } + + if ($pto > 0) { + $Qlisting->bindDecimal(':price_to', $pto); + } + } else { + if ($pfrom > 0) { + $Qlisting->bindDecimal(':price_from', $pfrom); + } + + if ($pto > 0) { + $Qlisting->bindDecimal(':price_to', $pto); + } + } + + $Qlisting->setPageSet(MAX_DISPLAY_SEARCH_RESULTS); + $Qlisting->execute(); - require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); + require('includes/modules/product_listing.php'); ?>
      -
      - +
      +
      diff --git a/catalog/checkout_confirmation.php b/catalog/checkout_confirmation.php index 39d03ff51..9a413cc75 100644 --- a/catalog/checkout_confirmation.php +++ b/catalog/checkout_confirmation.php @@ -5,55 +5,56 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => 'checkout_payment.php')); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // avoid hack attempts during the checkout procedure by checking the internal cartID - if (isset($cart->cartID) && tep_session_is_registered('cartID')) { - if ($cart->cartID != $cartID) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) { + if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } } // if no shipping method has been selected, redirect the customer to the shipping method selection page - if (!tep_session_is_registered('shipping')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (!isset($_SESSION['shipping'])) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } - if (!tep_session_is_registered('payment')) tep_session_register('payment'); - if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment']; + if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment']; - if (!tep_session_is_registered('comments')) tep_session_register('comments'); - if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) { - $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); + if (isset($_POST['comments']) && tep_not_null($_POST['comments'])) { + $_SESSION['comments'] = HTML::sanitize($_POST['comments']); } // load the selected payment module require(DIR_WS_CLASSES . 'payment.php'); - $payment_modules = new payment($payment); + $payment_modules = new payment($_SESSION['payment']); require(DIR_WS_CLASSES . 'order.php'); $order = new order; $payment_modules->update_status(); - if ( ($payment_modules->selected_module != $payment) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); + if ( ($payment_modules->selected_module != $_SESSION['payment']) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$_SESSION['payment']) ) || (is_object($$_SESSION['payment']) && ($$_SESSION['payment']->enabled == false)) ) { + OSCOM::redirect('checkout_payment.php', 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'); } if (is_array($payment_modules->modules)) { @@ -62,7 +63,7 @@ // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping($shipping); + $shipping_modules = new shipping($_SESSION['shipping']); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; @@ -78,229 +79,243 @@ } // Out of Stock if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + OSCOM::redirect('shopping_cart.php'); } } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_confirmation.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_shipping.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      + size('checkout_confirmation') > 0) { echo $messageStack->output('checkout_confirmation'); } - if (isset($$payment->form_action_url)) { - $form_action_url = $$payment->form_action_url; + if (isset($$_SESSION['payment']->form_action_url)) { + $form_action_url = $$_SESSION['payment']->form_action_url; } else { - $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); + $form_action_url = OSCOM::link('checkout_process.php', '', 'SSL'); } - echo tep_draw_form('checkout_confirmation', $form_action_url, 'post'); + echo HTML::form('checkout_confirmation', $form_action_url, 'post'); ?>
      -

      -
      - +
      + + info['tax_groups']) > 1) { + ?> + + + + + + + + + + products); $i<$n; $i++) { + echo ' ' . "\n" . + ' ' . "\n" . + ' - - - - ' . "\n"; - - if (sizeof($order->info['tax_groups']) > 1) echo ' ' . "\n"; +
      - echo ' ' . "\n" . - ' ' . "\n"; - } -?> - -
      ' . HEADING_PRODUCTS . ' ' . HTML::button(TEXT_EDIT, 'glyphicon glyphicon-edit', OSCOM::link('shopping_cart.php'), NULL, NULL, 'pull-right btn-default btn-xs' ); ?>' . HEADING_PRODUCTS . ' ' . HTML::button(TEXT_EDIT, 'glyphicon glyphicon-edit', OSCOM::link('shopping_cart.php'), NULL, NULL, 'pull-right btn-default btn-xs' ); ?>
      ' . $order->products[$i]['qty'] . ' x' . $order->products[$i]['name']; - - - - - - - - - - -info['shipping_method']) { -?> - - - - - - - - - -
      ' . HEADING_DELIVERY_ADDRESS . ' (' . TEXT_EDIT . ')'; ?>
      delivery['format_id'], $order->delivery, 1, ' ', '
      '); ?>
      ' . HEADING_SHIPPING_METHOD . ' (' . TEXT_EDIT . ')'; ?>
      info['shipping_method']; ?>
      - -info['tax_groups']) > 1) { -?> - - - - - - - - + if (STOCK_CHECK == 'true') { + echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']); + } - - - + if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) { + for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { + echo '
        - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . ''; + } + } -' . "\n"; - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - echo ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n"; - if (STOCK_CHECK == 'true') { - echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']); + echo ' ' . "\n" . + ' ' . "\n"; } - - if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) { - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - echo '
        - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . ''; - } + ?> + +
      ' . HEADING_PRODUCTS . ' (' . TEXT_EDIT . ')'; ?>
      ' . HEADING_PRODUCTS . ' (' . TEXT_EDIT . ')'; ?>
      ' . $order->products[$i]['qty'] . ' x' . $order->products[$i]['name']; + if (sizeof($order->info['tax_groups']) > 1) echo ' ' . tep_display_tax_value($order->products[$i]['tax']) . '%' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '
      + + output(); } + ?> +
      - echo '
      ' . tep_display_tax_value($order->products[$i]['tax']) . '%' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '
      + -

      -
      - - - - - -
      - - - - - - - - - - - - -
      ' . HEADING_BILLING_ADDRESS . ' (' . TEXT_EDIT . ')'; ?>
      billing['format_id'], $order->billing, 1, ' ', '
      '); ?>
      ' . HEADING_PAYMENT_METHOD . ' (' . TEXT_EDIT . ')'; ?>
      info['payment_method']; ?>
      -output(); - } -?> +
      + +
      +
      +
      ' . HEADING_DELIVERY_ADDRESS . '' . HTML::button(TEXT_EDIT, 'glyphicon glyphicon-edit', OSCOM::link('checkout_shipping_address.php', '', 'SSL'), NULL, NULL, 'pull-right btn-default btn-xs' ); ?>
      +
      + delivery['format_id'], $order->delivery, 1, ' ', '
      '); ?> +
      +
      +
      + + info['shipping_method']) { + ?> +
      +
      +
      ' . HEADING_SHIPPING_METHOD . '' . HTML::button(TEXT_EDIT, 'glyphicon glyphicon-edit', OSCOM::link('checkout_shipping.php', '', 'SSL'), NULL, NULL, 'pull-right btn-default btn-xs' ); ?>
      + +
      + info['shipping_method']; ?> +
      +
      +
      + -
      -
      + -modules)) { - if ($confirmation = $payment_modules->confirmation()) { -?> +
      + -

      +
      - - - - - - - - - - - - - - + + modules)) { + if ($confirmation = $payment_modules->confirmation()) { + ?> +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + +
      +
      + + + + + ?> + +
      +
      +
      ' . HEADING_BILLING_ADDRESS . '' . HTML::button(TEXT_EDIT, 'glyphicon glyphicon-edit', OSCOM::link('checkout_payment_address.php', '', 'SSL'), NULL, NULL, 'pull-right btn-default btn-xs' ); ?>
      +
      + billing['format_id'], $order->billing, 1, ' ', '
      '); ?> +
      +
      +
      + +
      +
      +
      ' . HEADING_PAYMENT_METHOD . '' . HTML::button(TEXT_EDIT, 'glyphicon glyphicon-edit', OSCOM::link('checkout_payment.php', '', 'SSL'), NULL, NULL, 'pull-right btn-default btn-xs' ); ?>
      +
      + info['payment_method']; ?> +
      +
      +
      + + +
      -
      info['comments'])) { ?> -

      ' . HEADING_ORDER_COMMENTS . ' (' . TEXT_EDIT . ')'; ?>

      +
      - info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?> +
      + info['comments'])) . HTML::hiddenField('comments', $order->info['comments']); ?> +
      -
      +
      modules)) { echo $payment_modules->process_button(); } - echo tep_draw_button(sprintf(IMAGE_BUTTON_PAY_TOTAL_NOW, $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value'])), null, null, 'primary', array('params' => 'data-button="payNow"')); + echo HTML::button(sprintf(IMAGE_BUTTON_PAY_TOTAL_NOW, $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value'])), 'glyphicon glyphicon-ok', null, 'primary', array('params' => 'data-button="payNow"'), 'btn-success btn-block'); ?>
      - diff --git a/catalog/checkout_payment.php b/catalog/checkout_payment.php index d7342a6a2..062394c43 100644 --- a/catalog/checkout_payment.php +++ b/catalog/checkout_payment.php @@ -5,60 +5,64 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // if no shipping method has been selected, redirect the customer to the shipping method selection page - if (!tep_session_is_registered('shipping')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (!isset($_SESSION['shipping'])) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } // avoid hack attempts during the checkout procedure by checking the internal cartID - if (isset($cart->cartID) && tep_session_is_registered('cartID')) { - if ($cart->cartID != $cartID) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) { + if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } } // Stock Check if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) { - $products = $cart->get_products(); + $products = $_SESSION['cart']->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + OSCOM::redirect('shopping_cart.php'); break; } } } // if no billing destination address was selected, use the customers own address as default - if (!tep_session_is_registered('billto')) { - tep_session_register('billto'); - $billto = $customer_default_address_id; + if (!isset($_SESSION['billto'])) { + $_SESSION['billto'] = $_SESSION['customer_default_address_id']; } else { // verify the selected billing address - if ( (is_array($billto) && empty($billto)) || is_numeric($billto) ) { - $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'"); - $check_address = tep_db_fetch_array($check_address_query); - - if ($check_address['total'] != '1') { - $billto = $customer_default_address_id; - if (tep_session_is_registered('payment')) tep_session_unregister('payment'); + if ( (is_array($_SESSION['billto']) && empty($_SESSION['billto'])) || is_numeric($_SESSION['billto']) ) { + $Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qcheck->bindInt(':address_book_id', $_SESSION['billto']); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); + + if ($Qcheck->fetch() === false) { + $_SESSION['billto'] = $_SESSION['customer_default_address_id']; + if (isset($_SESSION['payment'])) unset($_SESSION['payment']); } } } @@ -66,68 +70,37 @@ require(DIR_WS_CLASSES . 'order.php'); $order = new order; - if (!tep_session_is_registered('comments')) tep_session_register('comments'); - if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) { - $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); + if (isset($_POST['comments']) && tep_not_null($_POST['comments'])) { + $_SESSION['comments'] = HTML::sanitize($_POST['comments']); } - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); + $total_weight = $_SESSION['cart']->show_weight(); + $total_count = $_SESSION['cart']->count_contents(); // load all enabled payment modules require(DIR_WS_CLASSES . 'payment.php'); $payment_modules = new payment; - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_payment.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_shipping.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('checkout_payment.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> - javascript_validation(); ?> -

      + - + true]); ?>
      get_error())) { + if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) { ?>
      @@ -140,23 +113,36 @@ function rowOutEffect(object) { } ?> -

      - -
      -
      -
      + -
      - '); ?> +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      -

      +
      + '); ?> +
      +
      +
      -
      +
      -

      + selection(); @@ -165,11 +151,13 @@ function rowOutEffect(object) { ?>
      -
      - ' . TITLE_PLEASE_SELECT . ''; ?> -
      +
      +
      + ' . TITLE_PLEASE_SELECT . ''; ?> +
      - + +
      - +
      + + - -
      - -' . "\n"; - } else { - echo ' ' . "\n"; - } -?> - +
      1) { - echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment)); + echo HTML::radioField('payment', $selection[$i]['id'], (isset($_SESSION['payment']) && ($selection[$i]['id'] == $_SESSION['payment'])), 'required aria-required="true"'); } else { - echo tep_draw_hidden_field('payment', $selection[$i]['id']); + echo HTML::hiddenField('payment', $selection[$i]['id']); } ?> @@ -250,47 +230,60 @@ function rowOutEffect(object) { } ?> -
      + +
      -

      +
      - +
      + +
      + +
      +
      -
      -
      - - - - - - - -
      ' . CHECKOUT_BAR_DELIVERY . ''; ?>
      -
      +
      +
      + +
      -
      +
      +
      +
      +
      + +

      +
      +
      + +

      +
      +
      + +

      +
      +
      +
      - - + diff --git a/catalog/checkout_payment_address.php b/catalog/checkout_payment_address.php index 8565d228e..d4c5fec9e 100644 --- a/catalog/checkout_payment_address.php +++ b/catalog/checkout_payment_address.php @@ -5,50 +5,53 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2012 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT_ADDRESS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_payment_address.php'); $error = false; $process = false; - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { + if (isset($_POST['action']) && ($_POST['action'] == 'submit') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { // process a new billing address - if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) { + if (tep_not_null($_POST['firstname']) && tep_not_null($_POST['lastname']) && tep_not_null($_POST['street_address'])) { $process = true; - if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); - if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']); - $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); - $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); - $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); - if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); - $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); - $city = tep_db_prepare_input($HTTP_POST_VARS['city']); - $country = tep_db_prepare_input($HTTP_POST_VARS['country']); + if (ACCOUNT_GENDER == 'true') $gender = HTML::sanitize($_POST['gender']); + if (ACCOUNT_COMPANY == 'true') $company = HTML::sanitize($_POST['company']); + $firstname = HTML::sanitize($_POST['firstname']); + $lastname = HTML::sanitize($_POST['lastname']); + $street_address = HTML::sanitize($_POST['street_address']); + if (ACCOUNT_SUBURB == 'true') $suburb = HTML::sanitize($_POST['suburb']); + $postcode = HTML::sanitize($_POST['postcode']); + $city = HTML::sanitize($_POST['city']); + $country = HTML::sanitize($_POST['country']); if (ACCOUNT_STATE == 'true') { - if (isset($HTTP_POST_VARS['zone_id'])) { - $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); + if (isset($_POST['zone_id'])) { + $zone_id = HTML::sanitize($_POST['zone_id']); } else { $zone_id = false; } - $state = tep_db_prepare_input($HTTP_POST_VARS['state']); + $state = HTML::sanitize($_POST['state']); } if (ACCOUNT_GENDER == 'true') { @@ -91,14 +94,22 @@ if (ACCOUNT_STATE == 'true') { $zone_id = 0; - $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'"); - $check = tep_db_fetch_array($check_query); - $entry_state_has_zones = ($check['total'] > 0); + + $Qcheck = $OSCOM_Db->prepare('select zone_id from :table_zones where zone_country_id = :zone_country_id'); + $Qcheck->bindInt(':zone_country_id', $country); + $Qcheck->execute(); + + $entry_state_has_zones = ($Qcheck->fetch() !== false); + if ($entry_state_has_zones == true) { - $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')"); - if (tep_db_num_rows($zone_query) == 1) { - $zone = tep_db_fetch_array($zone_query); - $zone_id = $zone['zone_id']; + $Qzone = $OSCOM_Db->prepare('select distinct zone_id from :table_zones where zone_country_id = :zone_country_id and (zone_name = :zone_name or zone_code = :zone_code)'); + $Qzone->bindInt(':zone_country_id', $country); + $Qzone->bindValue(':zone_name', $state); + $Qzone->bindValue(':zone_code', $state); + $Qzone->execute(); + + if (count($Qzone->fetchAll()) === 1) { + $zone_id = $Qzone->valueInt('zone_id'); } else { $error = true; @@ -120,7 +131,7 @@ } if ($error == false) { - $sql_data_array = array('customers_id' => $customer_id, + $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, @@ -141,111 +152,62 @@ } } - if (!tep_session_is_registered('billto')) tep_session_register('billto'); - - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); + $OSCOM_Db->save('address_book', $sql_data_array); - $billto = tep_db_insert_id(); + $_SESSION['billto'] = $OSCOM_Db->lastInsertId(); - if (tep_session_is_registered('payment')) tep_session_unregister('payment'); + if (isset($_SESSION['payment'])) unset($_SESSION['payment']); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } // process the selected billing destination - } elseif (isset($HTTP_POST_VARS['address'])) { + } elseif (isset($_POST['address'])) { $reset_payment = false; - if (tep_session_is_registered('billto')) { - if ($billto != $HTTP_POST_VARS['address']) { - if (tep_session_is_registered('payment')) { + if (isset($_SESSION['billto'])) { + if ($_SESSION['billto'] != $_POST['address']) { + if (isset($_SESSION['payment'])) { $reset_payment = true; } } - } else { - tep_session_register('billto'); } - $billto = $HTTP_POST_VARS['address']; + $_SESSION['billto'] = $_POST['address']; - $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'"); - $check_address = tep_db_fetch_array($check_address_query); + $Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qcheck->bindInt(':address_book_id', $_SESSION['billto']); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); - if ($check_address['total'] == '1') { - if ($reset_payment == true) tep_session_unregister('payment'); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + if ($Qcheck->fetch() !== false) { + if ($reset_payment == true) unset($_SESSION['payment']); + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } else { - tep_session_unregister('billto'); + unset($_SESSION['billto']); } // no addresses to select from - customer decided to keep the current assigned address } else { - if (!tep_session_is_registered('billto')) tep_session_register('billto'); - $billto = $customer_default_address_id; + $_SESSION['billto'] = $_SESSION['customer_default_address_id']; - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } } // if no billing destination address was selected, use their own address as default - if (!tep_session_is_registered('billto')) { - $billto = $customer_default_address_id; + if (!isset($_SESSION['billto'])) { + $_SESSION['billto'] = $_SESSION['customer_default_address_id']; } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_payment.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('checkout_payment_address.php', '', 'SSL')); $addresses_count = tep_count_customer_address_book_entries(); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> - - - -

      + size('checkout_address') > 0) { @@ -253,7 +215,7 @@ function check_form_optional(form_name) { } ?> - + true]); ?>
      @@ -261,65 +223,78 @@ function check_form_optional(form_name) { if ($process == false) { ?> -

      - -
      -
      -
      + -
      - '); ?> +
      +
      +
      +
      +
      +
      +
      - +
      + '); ?> +
      +
      +
      -
      +
      1) { ?> -

      +
      -
      - ' . TITLE_PLEASE_SELECT . ''; ?> -
      +
      +
      + ' . TITLE_PLEASE_SELECT . ''; ?> +
      - + +
      - +
      + prepare('select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from :table_address_book where customers_id = :customers_id order by firstname, lastname'); + $Qab->bindInt(':customers_id', $_SESSION['customer_id']); + $Qab->execute(); - $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'"); - while ($addresses = tep_db_fetch_array($addresses_query)) { - $format_id = tep_get_address_format_id($addresses['country_id']); + while ($Qab->fetch()) { + $format_id = tep_get_address_format_id($Qab->valueInt('country_id')); - if ($addresses['address_book_id'] == $billto) { - echo ' ' . "\n"; + if ($Qab->valueInt('address_book_id') == $_SESSION['billto']) { + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - - - - - + + +
      + value('firstname') . ' ' . $Qab->value('lastname')); ?> +
      toArray(), true, ' ', ', '); ?>
      +
      valueInt('address_book_id'), ($Qab->valueInt('address_book_id') == $_SESSION['billto'])); ?>
      @@ -330,46 +305,32 @@ function check_form_optional(form_name) { if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) { ?> -

      +
      - +
      + +
      - +
      -
      -
      - - - - - - - -
      ' . CHECKOUT_BAR_DELIVERY . ''; ?>' . CHECKOUT_BAR_PAYMENT . ''; ?>
      -
      - -
      +
      - - -
      - +
      +
      diff --git a/catalog/checkout_process.php b/catalog/checkout_process.php index 1d13fe72d..626ea004a 100644 --- a/catalog/checkout_process.php +++ b/catalog/checkout_process.php @@ -5,49 +5,52 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2012 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + include('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => 'checkout_payment.php')); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // if no shipping method has been selected, redirect the customer to the shipping method selection page - if (!tep_session_is_registered('shipping') || !tep_session_is_registered('sendto')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (!isset($_SESSION['shipping']) || !isset($_SESSION['sendto'])) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } - if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!isset($_SESSION['payment'])) ) { + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } // avoid hack attempts during the checkout procedure by checking the internal cartID - if (isset($cart->cartID) && tep_session_is_registered('cartID')) { - if ($cart->cartID != $cartID) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) { + if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } } - include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_process.php'); // load selected payment module require(DIR_WS_CLASSES . 'payment.php'); - $payment_modules = new payment($payment); + $payment_modules = new payment($_SESSION['payment']); // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping($shipping); + $shipping_modules = new shipping($_SESSION['shipping']); require(DIR_WS_CLASSES . 'order.php'); $order = new order; @@ -62,14 +65,14 @@ } // Out of Stock if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + OSCOM::redirect('shopping_cart.php'); } } $payment_modules->update_status(); - if ( ($payment_modules->selected_module != $payment) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); + if ( ($payment_modules->selected_module != $_SESSION['payment']) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$_SESSION['payment']) ) || (is_object($$_SESSION['payment']) && ($$_SESSION['payment']->enabled == false)) ) { + OSCOM::redirect('checkout_payment.php', 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'); } require(DIR_WS_CLASSES . 'order_total.php'); @@ -80,64 +83,68 @@ // load the before_process function from the payment modules $payment_modules->before_process(); - $sql_data_array = array('customers_id' => $customer_id, + $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_company' => $order->customer['company'], 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], - 'customers_postcode' => $order->customer['postcode'], - 'customers_state' => $order->customer['state'], - 'customers_country' => $order->customer['country']['title'], - 'customers_telephone' => $order->customer['telephone'], + 'customers_postcode' => $order->customer['postcode'], + 'customers_state' => $order->customer['state'], + 'customers_country' => $order->customer['country']['title'], + 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], - 'customers_address_format_id' => $order->customer['format_id'], + 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => trim($order->delivery['firstname'] . ' ' . $order->delivery['lastname']), 'delivery_company' => $order->delivery['company'], - 'delivery_street_address' => $order->delivery['street_address'], - 'delivery_suburb' => $order->delivery['suburb'], - 'delivery_city' => $order->delivery['city'], - 'delivery_postcode' => $order->delivery['postcode'], - 'delivery_state' => $order->delivery['state'], - 'delivery_country' => $order->delivery['country']['title'], - 'delivery_address_format_id' => $order->delivery['format_id'], - 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], + 'delivery_street_address' => $order->delivery['street_address'], + 'delivery_suburb' => $order->delivery['suburb'], + 'delivery_city' => $order->delivery['city'], + 'delivery_postcode' => $order->delivery['postcode'], + 'delivery_state' => $order->delivery['state'], + 'delivery_country' => $order->delivery['country']['title'], + 'delivery_address_format_id' => $order->delivery['format_id'], + 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_company' => $order->billing['company'], - 'billing_street_address' => $order->billing['street_address'], - 'billing_suburb' => $order->billing['suburb'], - 'billing_city' => $order->billing['city'], - 'billing_postcode' => $order->billing['postcode'], - 'billing_state' => $order->billing['state'], - 'billing_country' => $order->billing['country']['title'], - 'billing_address_format_id' => $order->billing['format_id'], - 'payment_method' => $order->info['payment_method'], - 'cc_type' => $order->info['cc_type'], - 'cc_owner' => $order->info['cc_owner'], - 'cc_number' => $order->info['cc_number'], - 'cc_expires' => $order->info['cc_expires'], - 'date_purchased' => 'now()', - 'orders_status' => $order->info['order_status'], - 'currency' => $order->info['currency'], + 'billing_street_address' => $order->billing['street_address'], + 'billing_suburb' => $order->billing['suburb'], + 'billing_city' => $order->billing['city'], + 'billing_postcode' => $order->billing['postcode'], + 'billing_state' => $order->billing['state'], + 'billing_country' => $order->billing['country']['title'], + 'billing_address_format_id' => $order->billing['format_id'], + 'payment_method' => $order->info['payment_method'], + 'cc_type' => $order->info['cc_type'], + 'cc_owner' => $order->info['cc_owner'], + 'cc_number' => $order->info['cc_number'], + 'cc_expires' => $order->info['cc_expires'], + 'date_purchased' => 'now()', + 'orders_status' => $order->info['order_status'], + 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value']); - tep_db_perform(TABLE_ORDERS, $sql_data_array); - $insert_id = tep_db_insert_id(); + + $OSCOM_Db->save('orders', $sql_data_array); + $insert_id = $OSCOM_Db->lastInsertId(); + for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => $insert_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], - 'value' => $order_totals[$i]['value'], - 'class' => $order_totals[$i]['code'], + 'value' => $order_totals[$i]['value'], + 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']); - tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); + + $OSCOM_Db->save('orders_total', $sql_data_array); } $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0'; - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => $order->info['order_status'], - 'date_added' => 'now()', + $sql_data_array = array('orders_id' => $insert_id, + 'orders_status_id' => $order->info['order_status'], + 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); + + $OSCOM_Db->save('orders_status_history', $sql_data_array); // initialized for the email confirmation $products_ordered = ''; @@ -146,51 +153,70 @@ // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { - $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename - FROM " . TABLE_PRODUCTS . " p - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa - ON p.products_id=pa.products_id - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - ON pa.products_attributes_id=pad.products_attributes_id - WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; + $stock_query_sql = 'select p.products_quantity, pad.products_attributes_filename + from :table_products p + left join :table_products_attributes pa + on p.products_id = pa.products_id + left join :table_products_attributes_download pad + on pa.products_attributes_id = pad.products_attributes_id + where p.products_id = :products_id'; + // Will work with only one option for downloadable products // otherwise, we have to build the query dynamically with a loop $products_attributes = (isset($order->products[$i]['attributes'])) ? $order->products[$i]['attributes'] : ''; if (is_array($products_attributes)) { - $stock_query_raw .= " AND pa.options_id = '" . (int)$products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . (int)$products_attributes[0]['value_id'] . "'"; + $stock_query_sql .= ' and pa.options_id = :options_id and pa.options_values_id = :options_values_id'; + } + + $Qstock = $OSCOM_Db->prepare($stock_query_sql); + $Qstock->bindInt(':products_id', tep_get_prid($order->products[$i]['id'])); + + if (is_array($products_attributes)) { + $Qstock->bindInt(':options_id', $products_attributes[0]['option_id']); + $Qstock->bindInt(':options_values_id', $products_attributes[0]['value_id']); } - $stock_query = tep_db_query($stock_query_raw); + + $Qstock->execute(); } else { - $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); + $Qstock = $OSCOM_Db->prepare('select products_quantity from :table_products where products_id = :products_id'); + $Qstock->bindInt(':products_id', tep_get_prid($order->products[$i]['id'])); + $Qstock->execute(); } - if (tep_db_num_rows($stock_query) > 0) { - $stock_values = tep_db_fetch_array($stock_query); + + if ($Qstock->fetch() !== false) { // do not decrement quantities if products_attributes_filename exists - if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { - $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; + if ((DOWNLOAD_ENABLED != 'true') || tep_not_null($Qstock->value('products_attributes_filename'))) { + $stock_left = $Qstock->valueInt('products_quantity') - $order->products[$i]['qty']; } else { - $stock_left = $stock_values['products_quantity']; + $stock_left = $Qstock->valueInt('products_quantity'); } - tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); + + $OSCOM_Db->save('products', ['products_quantity' => (int)$stock_left], ['products_id' => tep_get_prid($order->products[$i]['id'])]); + if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { - tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); + $OSCOM_Db->save('products', ['products_status' => '0'], ['products_id' => tep_get_prid($order->products[$i]['id'])]); } } } // Update products_ordered (for bestsellers list) - tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - - $sql_data_array = array('orders_id' => $insert_id, - 'products_id' => tep_get_prid($order->products[$i]['id']), - 'products_model' => $order->products[$i]['model'], - 'products_name' => $order->products[$i]['name'], - 'products_price' => $order->products[$i]['price'], - 'final_price' => $order->products[$i]['final_price'], - 'products_tax' => $order->products[$i]['tax'], - 'products_quantity' => $order->products[$i]['qty']); - tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); - $order_products_id = tep_db_insert_id(); + $Qupdate = $OSCOM_Db->prepare('update :table_products set products_ordered = products_ordered + :products_ordered where products_id = :products_id'); + $Qupdate->bindInt(':products_ordered', $order->products[$i]['qty']); + $Qupdate->bindInt(':products_id', tep_get_prid($order->products[$i]['id'])); + $Qupdate->execute(); + + $sql_data_array = array('orders_id' => $insert_id, + 'products_id' => tep_get_prid($order->products[$i]['id']), + 'products_model' => $order->products[$i]['model'], + 'products_name' => $order->products[$i]['name'], + 'products_price' => $order->products[$i]['price'], + 'final_price' => $order->products[$i]['final_price'], + 'products_tax' => $order->products[$i]['tax'], + 'products_quantity' => $order->products[$i]['qty'], + 'products_full_id' => $order->products[$i]['id']); + + $OSCOM_Db->save('orders_products', $sql_data_array); + $order_products_id = $OSCOM_Db->lastInsertId(); //------insert customer choosen option to order-------- $attributes_exist = '0'; @@ -199,40 +225,55 @@ $attributes_exist = '1'; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . (int)$order->products[$i]['id'] . "' - and pa.options_id = '" . (int)$order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . (int)$order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . (int)$languages_id . "' - and poval.language_id = '" . (int)$languages_id . "'"; - $attributes = tep_db_query($attributes_query); + $attributes_query = 'select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount, pad.products_attributes_filename + from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa + left join :table_products_attributes_download pad on pa.products_attributes_id = pad.products_attributes_id + where pa.products_id = :products_id + and pa.options_id = :options_id + and pa.options_id = popt.products_options_id + and pa.options_values_id = :options_values_id + and pa.options_values_id = poval.products_options_values_id + and popt.language_id = :language_id + and popt.language_id = poval.language_id'; } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_id = '" . (int)$order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); + $attributes_query = 'select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix + from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa + where pa.products_id = :products_id + and pa.options_id = :options_id + and pa.options_id = popt.products_options_id + and pa.options_values_id = :options_values_id + and pa.options_values_id = poval.products_options_values_id + and popt.language_id = :language_id + and popt.language_id = poval.language_id'; } - $attributes_values = tep_db_fetch_array($attributes); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'products_options' => $attributes_values['products_options_name'], - 'products_options_values' => $attributes_values['products_options_values_name'], - 'options_values_price' => $attributes_values['options_values_price'], - 'price_prefix' => $attributes_values['price_prefix']); - tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); - - if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'orders_products_filename' => $attributes_values['products_attributes_filename'], - 'download_maxdays' => $attributes_values['products_attributes_maxdays'], - 'download_count' => $attributes_values['products_attributes_maxcount']); - tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); + + $Qattributes = $OSCOM_Db->prepare($attributes_query); + $Qattributes->bindInt(':products_id', $order->products[$i]['id']); + $Qattributes->bindInt(':options_id', $order->products[$i]['attributes'][$j]['option_id']); + $Qattributes->bindInt(':options_values_id', $order->products[$i]['attributes'][$j]['value_id']); + $Qattributes->bindInt(':language_id', $_SESSION['languages_id']); + $Qattributes->execute(); + + $sql_data_array = array('orders_id' => $insert_id, + 'orders_products_id' => $order_products_id, + 'products_options' => $Qattributes->value('products_options_name'), + 'products_options_values' => $Qattributes->value('products_options_values_name'), + 'options_values_price' => $Qattributes->value('options_values_price'), + 'price_prefix' => $Qattributes->value('price_prefix')); + + $OSCOM_Db->save('orders_products_attributes', $sql_data_array); + + if ((DOWNLOAD_ENABLED == 'true') && $Qattributes->hasValue('products_attributes_filename') && tep_not_null($Qattributes->value('products_attributes_filename'))) { + $sql_data_array = array('orders_id' => $insert_id, + 'orders_products_id' => $order_products_id, + 'orders_products_filename' => $Qattributes->value('products_attributes_filename'), + 'download_maxdays' => $Qattributes->value('products_attributes_maxdays'), + 'download_count' => $Qattributes->value('products_attributes_maxcount')); + + $OSCOM_Db->save('orders_products_download', $sql_data_array); } - $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; + + $products_ordered_attributes .= "\n\t" . $Qattributes->value('products_options_name') . ' ' . $Qattributes->value('products_options_values_name'); } } //------insert customer choosen option eof ---- @@ -240,17 +281,17 @@ } // lets start with the email confirmation - $email_order = STORE_NAME . "\n" . - EMAIL_SEPARATOR . "\n" . + $email_order = STORE_NAME . "\n" . + EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . - EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . + EMAIL_TEXT_INVOICE_URL . ' ' . OSCOM::link('account_history_info.php', 'order_id=' . $insert_id, 'SSL', false) . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { - $email_order .= tep_db_output($order->info['comments']) . "\n\n"; + $email_order .= HTML::outputProtected($order->info['comments']) . "\n\n"; } - $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . - EMAIL_SEPARATOR . "\n" . - $products_ordered . + $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . + EMAIL_SEPARATOR . "\n" . + $products_ordered . EMAIL_SEPARATOR . "\n"; for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { @@ -258,18 +299,18 @@ } if ($order->content_type != 'virtual') { - $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . + $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; + tep_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n") . "\n"; } $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; - if (is_object($$payment)) { - $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . + tep_address_label($_SESSION['customer_id'], $_SESSION['billto'], 0, '', "\n") . "\n\n"; + if (is_object($$_SESSION['payment'])) { + $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; - $payment_class = $$payment; + $payment_class = $$_SESSION['payment']; $email_order .= $order->info['payment_method'] . "\n\n"; if (isset($payment_class->email_footer)) { $email_order .= $payment_class->email_footer . "\n\n"; @@ -285,16 +326,16 @@ // load the after_process function from the payment modules $payment_modules->after_process(); - $cart->reset(true); + $_SESSION['cart']->reset(true); // unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); + unset($_SESSION['sendto']); + unset($_SESSION['billto']); + unset($_SESSION['shipping']); + unset($_SESSION['payment']); + unset($_SESSION['comments']); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); + OSCOM::redirect('checkout_success.php', '', 'SSL'); - require(DIR_WS_INCLUDES . 'application_bottom.php'); + require('includes/application_bottom.php'); ?> diff --git a/catalog/checkout_shipping.php b/catalog/checkout_shipping.php index f85a7f44b..981ac3010 100644 --- a/catalog/checkout_shipping.php +++ b/catalog/checkout_shipping.php @@ -5,38 +5,42 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); require('includes/classes/http_client.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // if no shipping destination address was selected, use the customers own address as default - if (!tep_session_is_registered('sendto')) { - tep_session_register('sendto'); - $sendto = $customer_default_address_id; + if (!isset($_SESSION['sendto'])) { + $_SESSION['sendto'] = $_SESSION['customer_default_address_id']; } else { // verify the selected shipping address - if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) { - $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); - $check_address = tep_db_fetch_array($check_address_query); - - if ($check_address['total'] != '1') { - $sendto = $customer_default_address_id; - if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); + if ( (is_array($_SESSION['sendto']) && empty($_SESSION['sendto'])) || is_numeric($_SESSION['sendto']) ) { + $Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qcheck->bindInt(':address_book_id', $_SESSION['sendto']); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); + + if ($Qcheck->fetch() === false) { + $_SESSION['sendto'] = $_SESSION['customer_default_address_id']; + if (isset($_SESSION['shipping'])) unset($_SESSION['shipping']); } } } @@ -46,25 +50,22 @@ // register a random ID in the session to check throughout the checkout procedure // against alterations in the shopping cart contents - if (!tep_session_is_registered('cartID')) { - tep_session_register('cartID'); - } elseif (($cartID != $cart->cartID) && tep_session_is_registered('shipping')) { - tep_session_unregister('shipping'); + if (isset($_SESSION['cartID']) && ($_SESSION['cartID'] != $_SESSION['cart']->cartID) && isset($_SESSION['shipping'])) { + unset($_SESSION['shipping']); } - $cartID = $cart->cartID = $cart->generate_cart_id(); + $_SESSION['cartID'] = $_SESSION['cart']->cartID = $_SESSION['cart']->generate_cart_id(); // if the order contains only virtual products, forward the customer to the billing page as // a shipping address is not needed if ($order->content_type == 'virtual') { - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - $shipping = false; - $sendto = false; - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + $_SESSION['shipping'] = false; + $_SESSION['sendto'] = false; + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); + $total_weight = $_SESSION['cart']->show_weight(); + $total_count = $_SESSION['cart']->count_contents(); // load all enabled shipping modules require(DIR_WS_CLASSES . 'shipping.php'); @@ -93,55 +94,52 @@ if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { $free_shipping = true; - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/ot_shipping.php'); } } else { $free_shipping = false; } // process the selected shipping method - if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken) ) { - if (!tep_session_is_registered('comments')) tep_session_register('comments'); - if (tep_not_null($HTTP_POST_VARS['comments'])) { - $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); + if ( isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken']) ) { + if (tep_not_null($_POST['comments'])) { + $_SESSION['comments'] = HTML::sanitize($_POST['comments']); } - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { - if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) { - $shipping = $HTTP_POST_VARS['shipping']; + if ( (isset($_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) { + $_SESSION['shipping'] = $_POST['shipping']; - list($module, $method) = explode('_', $shipping); - if ( is_object($$module) || ($shipping == 'free_free') ) { - if ($shipping == 'free_free') { + list($module, $method) = explode('_', $_SESSION['shipping']); + if ( is_object($$module) || ($_SESSION['shipping'] == 'free_free') ) { + if ($_SESSION['shipping'] == 'free_free') { $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE; $quote[0]['methods'][0]['cost'] = '0'; } else { $quote = $shipping_modules->quote($method, $module); } if (isset($quote['error'])) { - tep_session_unregister('shipping'); + unset($_SESSION['shipping']); } else { if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) { - $shipping = array('id' => $shipping, - 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'), - 'cost' => $quote[0]['methods'][0]['cost']); + $_SESSION['shipping'] = array('id' => $_SESSION['shipping'], + 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'), + 'cost' => $quote[0]['methods'][0]['cost']); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } } } else { - tep_session_unregister('shipping'); + unset($_SESSION['shipping']); } } } else { if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) { - tep_session_unregister('shipping'); + unset($_SESSION['shipping']); } else { - $shipping = false; + $_SESSION['shipping'] = false; - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } } } @@ -153,92 +151,76 @@ // if the modules status was changed when none were available, to save on implementing // a javascript force-selection method, also automatically select the first shipping // method if more than one module is now enabled - if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->get_first(); + if ( !isset($_SESSION['shipping']) || ( isset($_SESSION['shipping']) && ($_SESSION['shipping'] === false) && (tep_count_shipping_modules() > 1) ) ) $_SESSION['shipping'] = $shipping_modules->get_first(); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_shipping.php'); - if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') && !tep_session_is_registered('shipping') && ($shipping == false) ) { + if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') && (!isset($_SESSION['shipping']) || ($_SESSION['shipping'] === false)) ) { $messageStack->add_session('checkout_address', ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); + OSCOM::redirect('checkout_shipping_address.php', '', 'SSL'); } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_shipping.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('checkout_shipping.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> - - -

      + - + true, 'action' => 'process']); ?>
      -

      - -
      -
      -
      + -
      - '); ?> +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      -

      +
      + '); ?> +
      +
      +
      -
      +
      0) { ?> -

      + 1 && sizeof($quotes[0]) > 1) { ?>
      -
      - ' . TITLE_PLEASE_SELECT . ''; ?> -
      +
      +
      + ' . TITLE_PLEASE_SELECT . ''; ?> +
      - + +
      - +
      - - - - - - - - - +
      +
      +
       
      +
      + format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . HTML::hiddenField('shipping', 'free_free'); ?> +
      +
      +
      +
       
      format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?>
      + + + + - - - - - - - - -' . "\n"; - } else { - echo ' ' . "\n"; - } -?> + if (isset($quotes[$i]['error'])) { + echo '
      ' . $quotes[$i]['error'] . '
      '; + } - + if (tep_not_null($quotes[$i]['methods'][$j]['title'])) echo '
      ' . $quotes[$i]['methods'][$j]['title'] . '
      '; + ?> + 1) || ($n2 > 1) ) { ?> - - + - + - + + + +
      + + -  
      format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?> + format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?>   + format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?>format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))) . HTML::hiddenField('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?>
      -
      + -

      +
      - +
      + +
      + +
      +
      -
      -
      +
      +
      - - - - - - -
      -
      +
      -
      +
      +
      +
      +
      + +

      +
      +
      + +

      +
      +
      + +

      +
      +
      +
      - - + diff --git a/catalog/checkout_shipping_address.php b/catalog/checkout_shipping_address.php index a4745a327..a6d4a1dd3 100644 --- a/catalog/checkout_shipping_address.php +++ b/catalog/checkout_shipping_address.php @@ -5,26 +5,29 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING_ADDRESS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_shipping_address.php'); require(DIR_WS_CLASSES . 'order.php'); $order = new order; @@ -32,36 +35,34 @@ // if the order contains only virtual products, forward the customer to the billing page as // a shipping address is not needed if ($order->content_type == 'virtual') { - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - $shipping = false; - if (!tep_session_is_registered('sendto')) tep_session_register('sendto'); - $sendto = false; - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + $_SESSION['shipping'] = false; + $_SESSION['sendto'] = false; + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } $error = false; $process = false; - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { + if (isset($_POST['action']) && ($_POST['action'] == 'submit') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { // process a new shipping address - if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) { + if (tep_not_null($_POST['firstname']) && tep_not_null($_POST['lastname']) && tep_not_null($_POST['street_address'])) { $process = true; - if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); - if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']); - $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); - $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); - $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); - if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); - $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); - $city = tep_db_prepare_input($HTTP_POST_VARS['city']); - $country = tep_db_prepare_input($HTTP_POST_VARS['country']); + if (ACCOUNT_GENDER == 'true') $gender = HTML::sanitize($_POST['gender']); + if (ACCOUNT_COMPANY == 'true') $company = HTML::sanitize($_POST['company']); + $firstname = HTML::sanitize($_POST['firstname']); + $lastname = HTML::sanitize($_POST['lastname']); + $street_address = HTML::sanitize($_POST['street_address']); + if (ACCOUNT_SUBURB == 'true') $suburb = HTML::sanitize($_POST['suburb']); + $postcode = HTML::sanitize($_POST['postcode']); + $city = HTML::sanitize($_POST['city']); + $country = HTML::sanitize($_POST['country']); if (ACCOUNT_STATE == 'true') { - if (isset($HTTP_POST_VARS['zone_id'])) { - $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); + if (isset($_POST['zone_id'])) { + $zone_id = HTML::sanitize($_POST['zone_id']); } else { $zone_id = false; } - $state = tep_db_prepare_input($HTTP_POST_VARS['state']); + $state = HTML::sanitize($_POST['state']); } if (ACCOUNT_GENDER == 'true') { @@ -104,14 +105,22 @@ if (ACCOUNT_STATE == 'true') { $zone_id = 0; - $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'"); - $check = tep_db_fetch_array($check_query); - $entry_state_has_zones = ($check['total'] > 0); + + $Qcheck = $OSCOM_Db->prepare('select zone_id from :table_zones where zone_country_id = :zone_country_id'); + $Qcheck->bindInt(':zone_country_id', $country); + $Qcheck->execute(); + + $entry_state_has_zones = ($Qcheck->fetch() !== false); + if ($entry_state_has_zones == true) { - $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')"); - if (tep_db_num_rows($zone_query) == 1) { - $zone = tep_db_fetch_array($zone_query); - $zone_id = $zone['zone_id']; + $Qzone = $OSCOM_Db->prepare('select distinct zone_id from :table_zones where zone_country_id = :zone_country_id and (zone_name = :zone_name or zone_code = :zone_code)'); + $Qzone->bindInt(':zone_country_id', $country); + $Qzone->bindValue(':zone_name', $state); + $Qzone->bindValue(':zone_code', $state); + $Qzone->execute(); + + if (count($Qzone->fetchAll()) === 1) { + $zone_id = $Qzone->valueInt('zone_id'); } else { $error = true; @@ -133,7 +142,7 @@ } if ($error == false) { - $sql_data_array = array('customers_id' => $customer_id, + $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, @@ -154,110 +163,61 @@ } } - if (!tep_session_is_registered('sendto')) tep_session_register('sendto'); - - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); + $OSCOM_Db->save('address_book', $sql_data_array); - $sendto = tep_db_insert_id(); + $_SESSION['sendto'] = $OSCOM_Db->lastInsertId(); - if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); + if (isset($_SESSION['shipping'])) unset($_SESSION['shipping']); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } // process the selected shipping destination - } elseif (isset($HTTP_POST_VARS['address'])) { + } elseif (isset($_POST['address'])) { $reset_shipping = false; - if (tep_session_is_registered('sendto')) { - if ($sendto != $HTTP_POST_VARS['address']) { - if (tep_session_is_registered('shipping')) { + if (isset($_SESSION['sendto'])) { + if ($_SESSION['sendto'] != $_POST['address']) { + if (isset($_SESSION['shipping'])) { $reset_shipping = true; } } - } else { - tep_session_register('sendto'); } - $sendto = $HTTP_POST_VARS['address']; + $_SESSION['sendto'] = $_POST['address']; - $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); - $check_address = tep_db_fetch_array($check_address_query); + $Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qcheck->bindInt(':address_book_id', $_SESSION['sendto']); + $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcheck->execute(); - if ($check_address['total'] == '1') { - if ($reset_shipping == true) tep_session_unregister('shipping'); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if ($Qcheck->fetch() !== false) { + if ($reset_shipping == true) unset($_SESSION['shipping']); + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } else { - tep_session_unregister('sendto'); + unset($_SESSION['sendto']); } } else { - if (!tep_session_is_registered('sendto')) tep_session_register('sendto'); - $sendto = $customer_default_address_id; + $_SESSION['sendto'] = $_SESSION['customer_default_address_id']; - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } } // if no shipping destination address was selected, use their own address as default - if (!tep_session_is_registered('sendto')) { - $sendto = $customer_default_address_id; + if (!isset($_SESSION['sendto'])) { + $_SESSION['sendto'] = $_SESSION['customer_default_address_id']; } - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_shipping.php', '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('checkout_shipping_address.php', '', 'SSL')); $addresses_count = tep_count_customer_address_book_entries(); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> - - - -

      + size('checkout_address') > 0) { @@ -265,7 +225,7 @@ function check_form_optional(form_name) { } ?> - + true]); ?>
      @@ -273,65 +233,78 @@ function check_form_optional(form_name) { if ($process == false) { ?> -

      - -
      -
      -
      + -
      - '); ?> +
      +
      +
      +
      +
      +
      +
      - +
      + '); ?> +
      +
      +
      -
      +
      1) { ?> -

      +
      -
      - ' . TITLE_PLEASE_SELECT . ''; ?> -
      +
      +
      + ' . TITLE_PLEASE_SELECT . ''; ?> +
      - + +
      - +
      + prepare('select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from :table_address_book where customers_id = :customers_id order by firstname, lastname'); + $Qab->bindInt(':customers_id', $_SESSION['customer_id']); + $Qab->execute(); - $addresses_query = tep_db_query("select address_book_id, entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'"); - while ($addresses = tep_db_fetch_array($addresses_query)) { - $format_id = tep_get_address_format_id($addresses['country_id']); + while ($Qab->fetch()) { + $format_id = tep_get_address_format_id($Qab->valueInt('country_id')); - if ($addresses['address_book_id'] == $sendto) { - echo ' ' . "\n"; + if ($Qab->valueInt('address_book_id') == $_SESSION['sendto']) { + echo ' ' . "\n"; } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } ?> - - - - - + + +
      + value('firstname') . ' ' . $Qab->value('lastname')); ?> +
      toArray(), true, ' ', ', '); ?>
      +
      valueInt('address_book_id'), ($Qab->valueInt('address_book_id') == $_SESSION['sendto'])); ?>
      @@ -342,46 +315,32 @@ function check_form_optional(form_name) { if ($addresses_count < MAX_ADDRESS_BOOK_ENTRIES) { ?> -

      +
      - +
      + +
      - +
      -
      -
      - - - - - - - -
      ' . CHECKOUT_BAR_DELIVERY . ''; ?>
      -
      - -
      +
      - - -
      - +
      +
      diff --git a/catalog/checkout_success.php b/catalog/checkout_success.php index 381d35e21..3db0c6464 100644 --- a/catalog/checkout_success.php +++ b/catalog/checkout_success.php @@ -5,60 +5,63 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // if the customer is not logged on, redirect them to the shopping cart page - if (!tep_session_is_registered('customer_id')) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if (!isset($_SESSION['customer_id'])) { + OSCOM::redirect('shopping_cart.php'); } - $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); + $Qorders = $OSCOM_Db->prepare('select orders_id from :table_orders where customers_id = :customers_id order by date_purchased desc limit 1'); + $Qorders->bindInt(':customers_id', $_SESSION['customer_id']); + $Qorders->execute(); // redirect to shopping cart page if no orders exist - if ( !tep_db_num_rows($orders_query) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($Qorders->fetch() === false) { + OSCOM::redirect('shopping_cart.php'); } - $orders = tep_db_fetch_array($orders_query); + $orders = $Qorders->toArray(); // TODO replace $orders used in template content modules with $Qorders $order_id = $orders['orders_id']; $page_content = $oscTemplate->getContent('checkout_success'); - if ( isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update') ) { - tep_redirect(tep_href_link(FILENAME_DEFAULT)); + if ( isset($_GET['action']) && ($_GET['action'] == 'update') ) { + OSCOM::redirect('index.php'); } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_success.php'); $breadcrumb->add(NAVBAR_TITLE_1); $breadcrumb->add(NAVBAR_TITLE_2); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      + - +
      -
      -
      - -
      -
      +
      diff --git a/catalog/conditions.php b/catalog/conditions.php index ca816db85..6d30dfdad 100644 --- a/catalog/conditions.php +++ b/catalog/conditions.php @@ -5,33 +5,38 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/conditions.php'); - $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONDITIONS)); + $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('conditions.php')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      +
      -
      - +
      +
      diff --git a/catalog/contact_us.php b/catalog/contact_us.php index 56ada5500..11022255f 100644 --- a/catalog/contact_us.php +++ b/catalog/contact_us.php @@ -5,21 +5,24 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/contact_us.php'); - if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { + if (isset($_GET['action']) && ($_GET['action'] == 'send') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { $error = false; - $name = tep_db_prepare_input($HTTP_POST_VARS['name']); - $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); - $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); + $name = HTML::sanitize($_POST['name']); + $email_address = HTML::sanitize($_POST['email']); + $enquiry = HTML::sanitize($_POST['enquiry']); if (!tep_validate_email($email_address)) { $error = true; @@ -27,7 +30,7 @@ $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } - $actionRecorder = new actionRecorder('ar_contact_us', (tep_session_is_registered('customer_id') ? $customer_id : null), $name); + $actionRecorder = new actionRecorder('ar_contact_us', (isset($_SESSION['customer_id']) ? $_SESSION['customer_id'] : null), $name); if (!$actionRecorder->canPerform()) { $error = true; @@ -41,32 +44,34 @@ $actionRecorder->record(); - tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success')); + OSCOM::redirect('contact_us.php', 'action=success'); } } - $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US)); + $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('contact_us.php')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      + size('contact') > 0) { echo $messageStack->output('contact'); } - if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { + if (isset($_GET['action']) && ($_GET['action'] == 'success')) { ?>
      -
      +
      -
      - +
      +
      @@ -74,28 +79,44 @@ } else { ?> - + true]); ?>
      + +

      +
      - - - - - - - - - - - - - -
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      -
      - +
      +
      @@ -104,6 +125,6 @@ diff --git a/catalog/cookie_usage.php b/catalog/cookie_usage.php index 9deda44c0..151816a40 100644 --- a/catalog/cookie_usage.php +++ b/catalog/cookie_usage.php @@ -5,41 +5,47 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_COOKIE_USAGE); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/cookie_usage.php'); - $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_COOKIE_USAGE)); + $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('cookie_usage.php')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      +
      -
      -
      -
      +
      +
      +
      +
      -
      - +
      +
      diff --git a/catalog/create_account.php b/catalog/create_account.php index 4cc9cba7c..f81368974 100644 --- a/catalog/create_account.php +++ b/catalog/create_account.php @@ -5,54 +5,57 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/create_account.php'); $process = false; - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { + if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { $process = true; if (ACCOUNT_GENDER == 'true') { - if (isset($HTTP_POST_VARS['gender'])) { - $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); + if (isset($_POST['gender'])) { + $gender = HTML::sanitize($_POST['gender']); } else { $gender = false; } } - $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); - $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); - if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); - $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); - if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']); - $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); - if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); - $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); - $city = tep_db_prepare_input($HTTP_POST_VARS['city']); + $firstname = HTML::sanitize($_POST['firstname']); + $lastname = HTML::sanitize($_POST['lastname']); + if (ACCOUNT_DOB == 'true') $dob = HTML::sanitize($_POST['dob']); + $email_address = HTML::sanitize($_POST['email_address']); + if (ACCOUNT_COMPANY == 'true') $company = HTML::sanitize($_POST['company']); + $street_address = HTML::sanitize($_POST['street_address']); + if (ACCOUNT_SUBURB == 'true') $suburb = HTML::sanitize($_POST['suburb']); + $postcode = HTML::sanitize($_POST['postcode']); + $city = HTML::sanitize($_POST['city']); if (ACCOUNT_STATE == 'true') { - $state = tep_db_prepare_input($HTTP_POST_VARS['state']); - if (isset($HTTP_POST_VARS['zone_id'])) { - $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); + $state = HTML::sanitize($_POST['state']); + if (isset($_POST['zone_id'])) { + $zone_id = HTML::sanitize($_POST['zone_id']); } else { $zone_id = false; } } - $country = tep_db_prepare_input($HTTP_POST_VARS['country']); - $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']); - $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']); - if (isset($HTTP_POST_VARS['newsletter'])) { - $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']); + $country = HTML::sanitize($_POST['country']); + $telephone = HTML::sanitize($_POST['telephone']); + $fax = HTML::sanitize($_POST['fax']); + if (isset($_POST['newsletter'])) { + $newsletter = HTML::sanitize($_POST['newsletter']); } else { $newsletter = false; } - $password = tep_db_prepare_input($HTTP_POST_VARS['password']); - $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']); + $password = HTML::sanitize($_POST['password']); + $confirmation = HTML::sanitize($_POST['confirmation']); $error = false; @@ -84,18 +87,16 @@ } } - if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { - $error = true; - - $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR); - } elseif (tep_validate_email($email_address) == false) { + if (tep_validate_email($email_address) == false) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } else { - $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); - $check_email = tep_db_fetch_array($check_email_query); - if ($check_email['total'] > 0) { + $Qcheck = $OSCOM_Db->prepare('select customers_id from :table_customers where customers_email_address = :customers_email_address limit 1'); + $Qcheck->bindValue(':customers_email_address', $email_address); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); @@ -128,14 +129,22 @@ if (ACCOUNT_STATE == 'true') { $zone_id = 0; - $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'"); - $check = tep_db_fetch_array($check_query); - $entry_state_has_zones = ($check['total'] > 0); + + $Qcheck = $OSCOM_Db->prepare('select zone_id from :table_zones where zone_country_id = :zone_country_id'); + $Qcheck->bindInt(':zone_country_id', $country); + $Qcheck->execute(); + + $entry_state_has_zones = ($Qcheck->fetch() !== false); + if ($entry_state_has_zones == true) { - $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')"); - if (tep_db_num_rows($zone_query) == 1) { - $zone = tep_db_fetch_array($zone_query); - $zone_id = $zone['zone_id']; + $Qzone = $OSCOM_Db->prepare('select distinct zone_id from :table_zones where zone_country_id = :zone_country_id and (zone_name = :zone_name or zone_code = :zone_code)'); + $Qzone->bindInt(':zone_country_id', $country); + $Qzone->bindValue(':zone_name', $state); + $Qzone->bindValue(':zone_code', $state); + $Qzone->execute(); + + if (count($Qzone->fetchAll()) === 1) { + $zone_id = $Qzone->valueInt('zone_id'); } else { $error = true; @@ -179,11 +188,11 @@ if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob); - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); + $OSCOM_Db->save('customers', $sql_data_array); - $customer_id = tep_db_insert_id(); + $_SESSION['customer_id'] = $OSCOM_Db->lastInsertId(); - $sql_data_array = array('customers_id' => $customer_id, + $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, @@ -204,33 +213,28 @@ } } - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); + $OSCOM_Db->save('address_book', $sql_data_array); - $address_id = tep_db_insert_id(); + $address_id = $OSCOM_Db->lastInsertId(); - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers', ['customers_default_address_id' => (int)$address_id], ['customers_id' => (int)$_SESSION['customer_id']]); - tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); + $OSCOM_Db->save('customers_info', ['customers_info_id' => (int)$_SESSION['customer_id'], 'customers_info_number_of_logons' => '0', 'customers_info_date_account_created' => 'now()']); if (SESSION_RECREATE == 'True') { tep_session_recreate(); } - $customer_first_name = $firstname; - $customer_default_address_id = $address_id; - $customer_country_id = $country; - $customer_zone_id = $zone_id; - tep_session_register('customer_id'); - tep_session_register('customer_first_name'); - tep_session_register('customer_default_address_id'); - tep_session_register('customer_country_id'); - tep_session_register('customer_zone_id'); + $_SESSION['customer_first_name'] = $firstname; + $_SESSION['customer_default_address_id'] = $address_id; + $_SESSION['customer_country_id'] = $country; + $_SESSION['customer_zone_id'] = $zone_id; // reset session token - $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); + $_SESSION['sessiontoken'] = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); // restore cart contents - $cart->restore_contents(); + $_SESSION['cart']->restore_contents(); // build the message content $name = $firstname . ' ' . $lastname; @@ -248,17 +252,18 @@ $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); + OSCOM::redirect('create_account_success.php', '', 'SSL'); } } - $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('create_account.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); - require('includes/form_check.js.php'); + require('includes/template_top.php'); ?> -

      + size('create_account') > 0) { @@ -266,192 +271,271 @@ } ?> -

      +
      - + true, 'action' => 'process']); ?>
      -
      - -

      -
      +
      - + + - - - - +
      + +
      + + + + ' . ENTRY_GENDER_TEXT . ''; ?> +
      +
      - - - - - - - - +
      + +
      + + +
      +
      +
      + +
      + + +
      +
      - - - - +
      + +
      + +
      +
      - - - - -
      ' . ENTRY_GENDER_TEXT . '': ''); ?>
      ' . ENTRY_FIRST_NAME_TEXT . '': ''); ?>
      ' . ENTRY_LAST_NAME_TEXT . '': ''); ?>
      ' . ENTRY_DATE_OF_BIRTH_TEXT . '': ''); ?>
      ' . ENTRY_EMAIL_ADDRESS_TEXT . '': ''); ?>
      +
      + +
      + + +
      +
      -

      +
      - - - - - -
      ' . ENTRY_COMPANY_TEXT . '': ''); ?>
      +
      + +
      + +
      +
      -

      +
      - - - - - +
      + +
      + +
      +
      - - - - +
      + +
      + +
      +
      - - - - - - - - +
      + +
      + +
      +
      +
      + +
      + +
      +
      - - - - + ?> + + - - - - -
      ' . ENTRY_STREET_ADDRESS_TEXT . '': ''); ?>
      ' . ENTRY_SUBURB_TEXT . '': ''); ?>
      ' . ENTRY_POST_CODE_TEXT . '': ''); ?>
      ' . ENTRY_CITY_TEXT . '': ''); ?>
      - $zones_values['zone_name'], 'text' => $zones_values['zone_name']); +
      + +
      + prepare('select zone_name from :table_zones where zone_country_id = :zone_country_id order by zone_name'); + $Qzones->bindInt(':zone_country_id', $country); + $Qzones->execute(); + + while ($Qzones->fetch()) { + $zones_array[] = array('id' => $Qzones->value('zone_name'), 'text' => $Qzones->value('zone_name')); + } + echo HTML::selectField('state', $zones_array, 0, 'id="inputState"'); + } else { + echo HTML::inputField('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE_TEXT . '"'); + } + } else { + echo HTML::inputField('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE_TEXT . '"'); } - echo tep_draw_pull_down_menu('state', $zones_array); - } else { - echo tep_draw_input_field('state'); - } - } else { - echo tep_draw_input_field('state'); - } - - if (tep_not_null(ENTRY_STATE_TEXT)) echo ' ' . ENTRY_STATE_TEXT . ''; -?> -
      ' . ENTRY_COUNTRY_TEXT . '': ''); ?>
      +
      + +
      + ' . ENTRY_COUNTRY_TEXT . ''; + ?> +
      +
      -

      +
      - - - - - - - - - - - - - -
      ' . ENTRY_TELEPHONE_NUMBER_TEXT . '': ''); ?>
      ' . ENTRY_FAX_NUMBER_TEXT . '': ''); ?>
      ' . ENTRY_NEWSLETTER_TEXT . '': ''); ?>
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      +
      + +
      +
      +
      -

      +
      - - - - - - - - - -
      ' . ENTRY_PASSWORD_TEXT . '': ''); ?>
      ' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '': ''); ?>
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      -
      - +
      +
      diff --git a/catalog/create_account_success.php b/catalog/create_account_success.php index 71364923c..921230df4 100644 --- a/catalog/create_account_success.php +++ b/catalog/create_account_success.php @@ -5,41 +5,46 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT_SUCCESS); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/create_account_success.php'); $breadcrumb->add(NAVBAR_TITLE_1); $breadcrumb->add(NAVBAR_TITLE_2); - if (sizeof($navigation->snapshot) > 0) { - $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); - $navigation->clear_snapshot(); + if (sizeof($_SESSION['navigation']->snapshot) > 0) { + $origin_href = OSCOM::link($_SESSION['navigation']->snapshot['page'], tep_array_to_string($_SESSION['navigation']->snapshot['get'], array(session_name())), $_SESSION['navigation']->snapshot['mode']); + $_SESSION['navigation']->clear_snapshot(); } else { - $origin_href = tep_href_link(FILENAME_DEFAULT); + $origin_href = OSCOM::link('index.php'); } - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?> -

      +
      - +
      + +
      -
      - -
      +
      diff --git a/catalog/download.php b/catalog/download.php index c3a264985..b739cf9f4 100644 --- a/catalog/download.php +++ b/catalog/download.php @@ -5,37 +5,47 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2012 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + include('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) die; + if (!isset($_SESSION['customer_id'])) die; // Check download.php was called with proper GET parameters - if ((isset($HTTP_GET_VARS['order']) && !is_numeric($HTTP_GET_VARS['order'])) || (isset($HTTP_GET_VARS['id']) && !is_numeric($HTTP_GET_VARS['id'])) ) { + if ((isset($_GET['order']) && !is_numeric($_GET['order'])) || (isset($_GET['id']) && !is_numeric($_GET['id'])) ) { die; } - + // Check that order_id, customer_id and filename match - $downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd, " . TABLE_ORDERS_STATUS . " os where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != '' and o.orders_status = os.orders_status_id and os.downloads_flag = '1' and os.language_id = '" . (int)$languages_id . "'"); - if (!tep_db_num_rows($downloads_query)) die; - $downloads = tep_db_fetch_array($downloads_query); + $Qdownload = $OSCOM_Db->prepare('select date_format(o.date_purchased, "%Y-%m-%d") as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from :table_orders o, :table_orders_products op, :table_orders_products_download opd, :table_orders_status os where o.orders_id = :orders_id and o.customers_id = :customers_id and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = :orders_products_download_id and opd.orders_products_filename != "" and o.orders_status = os.orders_status_id and os.downloads_flag = "1" and os.language_id = :language_id'); + $Qdownload->bindInt(':orders_id', $_GET['order']); + $Qdownload->bindInt(':customers_id', $_SESSION['customer_id']); + $Qdownload->bindInt(':orders_products_download_id', $_GET['id']); + $Qdownload->bindInt(':language_id', $_SESSION['languages_id']); + $Qdownload->execute(); + + if ($Qdownload->fetch() === false) die; + // MySQL 3.22 does not have INTERVAL - list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']); - $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year); + list($dt_year, $dt_month, $dt_day) = explode('-', $Qdownload->value('date_purchased_day')); + $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $Qdownload->valueInt('download_maxdays'), $dt_year); // Die if time expired (maxdays = 0 means no time limit) - if (($downloads['download_maxdays'] != 0) && ($download_timestamp <= time())) die; + if (($Qdownload->valueInt('download_maxdays') != 0) && ($download_timestamp <= time())) die; // Die if remaining count is <=0 - if ($downloads['download_count'] <= 0) die; + if ($Qdownload->valueInt('download_count') <= 0) die; // Die if file is not there - if (!file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) die; - + if (!file_exists(DIR_FS_DOWNLOAD . $Qdownload->value('orders_products_filename'))) die; + // Now decrement counter - tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_count = download_count-1 where orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "'"); + $Qupdate = $OSCOM_Db->prepare('update :table_orders_products_download set download_count = download_count-1 where orders_products_download_id = :orders_products_download_id'); + $Qupdate->bindInt(':orders_products_download_id', $_GET['id']); + $Qupdate->execute(); // Returns a random name, 16 to 20 characters long // There are more than 10^28 combinations @@ -68,7 +78,7 @@ function tep_unlink_temp_dir($dir) if ($file == '.' || $file == '..') continue; @unlink($dir . $subdir . '/' . $file); } - closedir($h2); + closedir($h2); @rmdir($dir . $subdir); } closedir($h1); @@ -81,7 +91,7 @@ function tep_unlink_temp_dir($dir) header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Content-Type: Application/octet-stream"); - header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']); + header("Content-disposition: attachment; filename=" . $Qdownload->value('orders_products_filename')); if (DOWNLOAD_BY_REDIRECT == 'true') { // This will work only on Unix/Linux hosts @@ -89,12 +99,12 @@ function tep_unlink_temp_dir($dir) $tempdir = tep_random_name(); umask(0000); mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777); - symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']); - if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])) { - tep_redirect(tep_href_link(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])); + symlink(DIR_FS_DOWNLOAD . $Qdownload->value('orders_products_filename'), DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $Qdownload->value('orders_products_filename')); + if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $Qdownload->value('orders_products_filename'))) { + OSCOM::redirect(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $Qdownload->value('orders_products_filename')); } } // Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources - readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']); + readfile(DIR_FS_DOWNLOAD . $Qdownload->value('orders_products_filename')); ?> diff --git a/catalog/ext/960gs/960.css b/catalog/ext/960gs/960.css deleted file mode 100755 index 635d7ba5f..000000000 --- a/catalog/ext/960gs/960.css +++ /dev/null @@ -1 +0,0 @@ -body{min-width:960px}.container_12,.container_16{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16{display:inline;float:left;margin-left:10px;margin-right:10px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11,.push_12,.pull_12,.push_13,.pull_13,.push_14,.pull_14,.push_15,.pull_15{position:relative}.container_12 .grid_3,.container_16 .grid_4{width:220px}.container_12 .grid_6,.container_16 .grid_8{width:460px}.container_12 .grid_9,.container_16 .grid_12{width:700px}.container_12 .grid_12,.container_16 .grid_16{width:940px}.alpha{margin-left:0}.omega{margin-right:0}.container_12 .grid_1{width:60px}.container_12 .grid_2{width:140px}.container_12 .grid_4{width:300px}.container_12 .grid_5{width:380px}.container_12 .grid_7{width:540px}.container_12 .grid_8{width:620px}.container_12 .grid_10{width:780px}.container_12 .grid_11{width:860px}.container_16 .grid_1{width:40px}.container_16 .grid_2{width:100px}.container_16 .grid_3{width:160px}.container_16 .grid_5{width:280px}.container_16 .grid_6{width:340px}.container_16 .grid_7{width:400px}.container_16 .grid_9{width:520px}.container_16 .grid_10{width:580px}.container_16 .grid_11{width:640px}.container_16 .grid_13{width:760px}.container_16 .grid_14{width:820px}.container_16 .grid_15{width:880px}.container_12 .prefix_3,.container_16 .prefix_4{padding-left:240px}.container_12 .prefix_6,.container_16 .prefix_8{padding-left:480px}.container_12 .prefix_9,.container_16 .prefix_12{padding-left:720px}.container_12 .prefix_1{padding-left:80px}.container_12 .prefix_2{padding-left:160px}.container_12 .prefix_4{padding-left:320px}.container_12 .prefix_5{padding-left:400px}.container_12 .prefix_7{padding-left:560px}.container_12 .prefix_8{padding-left:640px}.container_12 .prefix_10{padding-left:800px}.container_12 .prefix_11{padding-left:880px}.container_16 .prefix_1{padding-left:60px}.container_16 .prefix_2{padding-left:120px}.container_16 .prefix_3{padding-left:180px}.container_16 .prefix_5{padding-left:300px}.container_16 .prefix_6{padding-left:360px}.container_16 .prefix_7{padding-left:420px}.container_16 .prefix_9{padding-left:540px}.container_16 .prefix_10{padding-left:600px}.container_16 .prefix_11{padding-left:660px}.container_16 .prefix_13{padding-left:780px}.container_16 .prefix_14{padding-left:840px}.container_16 .prefix_15{padding-left:900px}.container_12 .suffix_3,.container_16 .suffix_4{padding-right:240px}.container_12 .suffix_6,.container_16 .suffix_8{padding-right:480px}.container_12 .suffix_9,.container_16 .suffix_12{padding-right:720px}.container_12 .suffix_1{padding-right:80px}.container_12 .suffix_2{padding-right:160px}.container_12 .suffix_4{padding-right:320px}.container_12 .suffix_5{padding-right:400px}.container_12 .suffix_7{padding-right:560px}.container_12 .suffix_8{padding-right:640px}.container_12 .suffix_10{padding-right:800px}.container_12 .suffix_11{padding-right:880px}.container_16 .suffix_1{padding-right:60px}.container_16 .suffix_2{padding-right:120px}.container_16 .suffix_3{padding-right:180px}.container_16 .suffix_5{padding-right:300px}.container_16 .suffix_6{padding-right:360px}.container_16 .suffix_7{padding-right:420px}.container_16 .suffix_9{padding-right:540px}.container_16 .suffix_10{padding-right:600px}.container_16 .suffix_11{padding-right:660px}.container_16 .suffix_13{padding-right:780px}.container_16 .suffix_14{padding-right:840px}.container_16 .suffix_15{padding-right:900px}.container_12 .push_3,.container_16 .push_4{left:240px}.container_12 .push_6,.container_16 .push_8{left:480px}.container_12 .push_9,.container_16 .push_12{left:720px}.container_12 .push_1{left:80px}.container_12 .push_2{left:160px}.container_12 .push_4{left:320px}.container_12 .push_5{left:400px}.container_12 .push_7{left:560px}.container_12 .push_8{left:640px}.container_12 .push_10{left:800px}.container_12 .push_11{left:880px}.container_16 .push_1{left:60px}.container_16 .push_2{left:120px}.container_16 .push_3{left:180px}.container_16 .push_5{left:300px}.container_16 .push_6{left:360px}.container_16 .push_7{left:420px}.container_16 .push_9{left:540px}.container_16 .push_10{left:600px}.container_16 .push_11{left:660px}.container_16 .push_13{left:780px}.container_16 .push_14{left:840px}.container_16 .push_15{left:900px}.container_12 .pull_3,.container_16 .pull_4{left:-240px}.container_12 .pull_6,.container_16 .pull_8{left:-480px}.container_12 .pull_9,.container_16 .pull_12{left:-720px}.container_12 .pull_1{left:-80px}.container_12 .pull_2{left:-160px}.container_12 .pull_4{left:-320px}.container_12 .pull_5{left:-400px}.container_12 .pull_7{left:-560px}.container_12 .pull_8{left:-640px}.container_12 .pull_10{left:-800px}.container_12 .pull_11{left:-880px}.container_16 .pull_1{left:-60px}.container_16 .pull_2{left:-120px}.container_16 .pull_3{left:-180px}.container_16 .pull_5{left:-300px}.container_16 .pull_6{left:-360px}.container_16 .pull_7{left:-420px}.container_16 .pull_9{left:-540px}.container_16 .pull_10{left:-600px}.container_16 .pull_11{left:-660px}.container_16 .pull_13{left:-780px}.container_16 .pull_14{left:-840px}.container_16 .pull_15{left:-900px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:before,.clearfix:after,.container_12:before,.container_12:after,.container_16:before,.container_16:after{content:'.';display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}.clearfix:after,.container_12:after,.container_16:after{clear:both}.clearfix,.container_12,.container_16{zoom:1} \ No newline at end of file diff --git a/catalog/ext/960gs/960_24_col.css b/catalog/ext/960gs/960_24_col.css deleted file mode 100755 index 8212cac4f..000000000 --- a/catalog/ext/960gs/960_24_col.css +++ /dev/null @@ -1 +0,0 @@ -body{min-width:960px}.container_24{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16,.grid_17,.grid_18,.grid_19,.grid_20,.grid_21,.grid_22,.grid_23,.grid_24{display:inline;float:left;margin-left:5px;margin-right:5px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11,.push_12,.pull_12,.push_13,.pull_13,.push_14,.pull_14,.push_15,.pull_15,.push_16,.pull_16,.push_17,.pull_17,.push_18,.pull_18,.push_19,.pull_19,.push_20,.pull_20,.push_21,.pull_21,.push_22,.pull_22,.push_23,.pull_23{position:relative}.alpha{margin-left:0}.omega{margin-right:0}.container_24 .grid_1{width:30px}.container_24 .grid_2{width:70px}.container_24 .grid_3{width:110px}.container_24 .grid_4{width:150px}.container_24 .grid_5{width:190px}.container_24 .grid_6{width:230px}.container_24 .grid_7{width:270px}.container_24 .grid_8{width:310px}.container_24 .grid_9{width:350px}.container_24 .grid_10{width:390px}.container_24 .grid_11{width:430px}.container_24 .grid_12{width:470px}.container_24 .grid_13{width:510px}.container_24 .grid_14{width:550px}.container_24 .grid_15{width:590px}.container_24 .grid_16{width:630px}.container_24 .grid_17{width:670px}.container_24 .grid_18{width:710px}.container_24 .grid_19{width:750px}.container_24 .grid_20{width:790px}.container_24 .grid_21{width:830px}.container_24 .grid_22{width:870px}.container_24 .grid_23{width:910px}.container_24 .grid_24{width:950px}.container_24 .prefix_1{padding-left:40px}.container_24 .prefix_2{padding-left:80px}.container_24 .prefix_3{padding-left:120px}.container_24 .prefix_4{padding-left:160px}.container_24 .prefix_5{padding-left:200px}.container_24 .prefix_6{padding-left:240px}.container_24 .prefix_7{padding-left:280px}.container_24 .prefix_8{padding-left:320px}.container_24 .prefix_9{padding-left:360px}.container_24 .prefix_10{padding-left:400px}.container_24 .prefix_11{padding-left:440px}.container_24 .prefix_12{padding-left:480px}.container_24 .prefix_13{padding-left:520px}.container_24 .prefix_14{padding-left:560px}.container_24 .prefix_15{padding-left:600px}.container_24 .prefix_16{padding-left:640px}.container_24 .prefix_17{padding-left:680px}.container_24 .prefix_18{padding-left:720px}.container_24 .prefix_19{padding-left:760px}.container_24 .prefix_20{padding-left:800px}.container_24 .prefix_21{padding-left:840px}.container_24 .prefix_22{padding-left:880px}.container_24 .prefix_23{padding-left:920px}.container_24 .suffix_1{padding-right:40px}.container_24 .suffix_2{padding-right:80px}.container_24 .suffix_3{padding-right:120px}.container_24 .suffix_4{padding-right:160px}.container_24 .suffix_5{padding-right:200px}.container_24 .suffix_6{padding-right:240px}.container_24 .suffix_7{padding-right:280px}.container_24 .suffix_8{padding-right:320px}.container_24 .suffix_9{padding-right:360px}.container_24 .suffix_10{padding-right:400px}.container_24 .suffix_11{padding-right:440px}.container_24 .suffix_12{padding-right:480px}.container_24 .suffix_13{padding-right:520px}.container_24 .suffix_14{padding-right:560px}.container_24 .suffix_15{padding-right:600px}.container_24 .suffix_16{padding-right:640px}.container_24 .suffix_17{padding-right:680px}.container_24 .suffix_18{padding-right:720px}.container_24 .suffix_19{padding-right:760px}.container_24 .suffix_20{padding-right:800px}.container_24 .suffix_21{padding-right:840px}.container_24 .suffix_22{padding-right:880px}.container_24 .suffix_23{padding-right:920px}.container_24 .push_1{left:40px}.container_24 .push_2{left:80px}.container_24 .push_3{left:120px}.container_24 .push_4{left:160px}.container_24 .push_5{left:200px}.container_24 .push_6{left:240px}.container_24 .push_7{left:280px}.container_24 .push_8{left:320px}.container_24 .push_9{left:360px}.container_24 .push_10{left:400px}.container_24 .push_11{left:440px}.container_24 .push_12{left:480px}.container_24 .push_13{left:520px}.container_24 .push_14{left:560px}.container_24 .push_15{left:600px}.container_24 .push_16{left:640px}.container_24 .push_17{left:680px}.container_24 .push_18{left:720px}.container_24 .push_19{left:760px}.container_24 .push_20{left:800px}.container_24 .push_21{left:840px}.container_24 .push_22{left:880px}.container_24 .push_23{left:920px}.container_24 .pull_1{left:-40px}.container_24 .pull_2{left:-80px}.container_24 .pull_3{left:-120px}.container_24 .pull_4{left:-160px}.container_24 .pull_5{left:-200px}.container_24 .pull_6{left:-240px}.container_24 .pull_7{left:-280px}.container_24 .pull_8{left:-320px}.container_24 .pull_9{left:-360px}.container_24 .pull_10{left:-400px}.container_24 .pull_11{left:-440px}.container_24 .pull_12{left:-480px}.container_24 .pull_13{left:-520px}.container_24 .pull_14{left:-560px}.container_24 .pull_15{left:-600px}.container_24 .pull_16{left:-640px}.container_24 .pull_17{left:-680px}.container_24 .pull_18{left:-720px}.container_24 .pull_19{left:-760px}.container_24 .pull_20{left:-800px}.container_24 .pull_21{left:-840px}.container_24 .pull_22{left:-880px}.container_24 .pull_23{left:-920px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:before,.clearfix:after,.container_24:before,.container_24:after{content:'.';display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}.clearfix:after,.container_24:after{clear:both}.clearfix,.container_24{zoom:1} \ No newline at end of file diff --git a/catalog/ext/960gs/rtl_960.css b/catalog/ext/960gs/rtl_960.css deleted file mode 100755 index cfa28ccb9..000000000 --- a/catalog/ext/960gs/rtl_960.css +++ /dev/null @@ -1 +0,0 @@ -body{min-width:960px}.container_12,.container_16{margin-right:auto;margin-left:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16{display:inline;float:right;margin-right:10px;margin-left:10px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11,.push_12,.pull_12,.push_13,.pull_13,.push_14,.pull_14,.push_15,.pull_15{position:relative}.container_12 .grid_3,.container_16 .grid_4{width:220px}.container_12 .grid_6,.container_16 .grid_8{width:460px}.container_12 .grid_9,.container_16 .grid_12{width:700px}.container_12 .grid_12,.container_16 .grid_16{width:940px}.alpha{margin-right:0}.omega{margin-left:0}.container_12 .grid_1{width:60px}.container_12 .grid_2{width:140px}.container_12 .grid_4{width:300px}.container_12 .grid_5{width:380px}.container_12 .grid_7{width:540px}.container_12 .grid_8{width:620px}.container_12 .grid_10{width:780px}.container_12 .grid_11{width:860px}.container_16 .grid_1{width:40px}.container_16 .grid_2{width:100px}.container_16 .grid_3{width:160px}.container_16 .grid_5{width:280px}.container_16 .grid_6{width:340px}.container_16 .grid_7{width:400px}.container_16 .grid_9{width:520px}.container_16 .grid_10{width:580px}.container_16 .grid_11{width:640px}.container_16 .grid_13{width:760px}.container_16 .grid_14{width:820px}.container_16 .grid_15{width:880px}.container_12 .prefix_3,.container_16 .prefix_4{padding-right:240px}.container_12 .prefix_6,.container_16 .prefix_8{padding-right:480px}.container_12 .prefix_9,.container_16 .prefix_12{padding-right:720px}.container_12 .prefix_1{padding-right:80px}.container_12 .prefix_2{padding-right:160px}.container_12 .prefix_4{padding-right:320px}.container_12 .prefix_5{padding-right:400px}.container_12 .prefix_7{padding-right:560px}.container_12 .prefix_8{padding-right:640px}.container_12 .prefix_10{padding-right:800px}.container_12 .prefix_11{padding-right:880px}.container_16 .prefix_1{padding-right:60px}.container_16 .prefix_2{padding-right:120px}.container_16 .prefix_3{padding-right:180px}.container_16 .prefix_5{padding-right:300px}.container_16 .prefix_6{padding-right:360px}.container_16 .prefix_7{padding-right:420px}.container_16 .prefix_9{padding-right:540px}.container_16 .prefix_10{padding-right:600px}.container_16 .prefix_11{padding-right:660px}.container_16 .prefix_13{padding-right:780px}.container_16 .prefix_14{padding-right:840px}.container_16 .prefix_15{padding-right:900px}.container_12 .suffix_3,.container_16 .suffix_4{padding-left:240px}.container_12 .suffix_6,.container_16 .suffix_8{padding-left:480px}.container_12 .suffix_9,.container_16 .suffix_12{padding-left:720px}.container_12 .suffix_1{padding-left:80px}.container_12 .suffix_2{padding-left:160px}.container_12 .suffix_4{padding-left:320px}.container_12 .suffix_5{padding-left:400px}.container_12 .suffix_7{padding-left:560px}.container_12 .suffix_8{padding-left:640px}.container_12 .suffix_10{padding-left:800px}.container_12 .suffix_11{padding-left:880px}.container_16 .suffix_1{padding-left:60px}.container_16 .suffix_2{padding-left:120px}.container_16 .suffix_3{padding-left:180px}.container_16 .suffix_5{padding-left:300px}.container_16 .suffix_6{padding-left:360px}.container_16 .suffix_7{padding-left:420px}.container_16 .suffix_9{padding-left:540px}.container_16 .suffix_10{padding-left:600px}.container_16 .suffix_11{padding-left:660px}.container_16 .suffix_13{padding-left:780px}.container_16 .suffix_14{padding-left:840px}.container_16 .suffix_15{padding-left:900px}.container_12 .push_3,.container_16 .push_4{right:240px}.container_12 .push_6,.container_16 .push_8{right:480px}.container_12 .push_9,.container_16 .push_12{right:720px}.container_12 .push_1{right:80px}.container_12 .push_2{right:160px}.container_12 .push_4{right:320px}.container_12 .push_5{right:400px}.container_12 .push_7{right:560px}.container_12 .push_8{right:640px}.container_12 .push_10{right:800px}.container_12 .push_11{right:880px}.container_16 .push_1{right:60px}.container_16 .push_2{right:120px}.container_16 .push_3{right:180px}.container_16 .push_5{right:300px}.container_16 .push_6{right:360px}.container_16 .push_7{right:420px}.container_16 .push_9{right:540px}.container_16 .push_10{right:600px}.container_16 .push_11{right:660px}.container_16 .push_13{right:780px}.container_16 .push_14{right:840px}.container_16 .push_15{right:900px}.container_12 .pull_3,.container_16 .pull_4{right:-240px}.container_12 .pull_6,.container_16 .pull_8{right:-480px}.container_12 .pull_9,.container_16 .pull_12{right:-720px}.container_12 .pull_1{right:-80px}.container_12 .pull_2{right:-160px}.container_12 .pull_4{right:-320px}.container_12 .pull_5{right:-400px}.container_12 .pull_7{right:-560px}.container_12 .pull_8{right:-640px}.container_12 .pull_10{right:-800px}.container_12 .pull_11{right:-880px}.container_16 .pull_1{right:-60px}.container_16 .pull_2{right:-120px}.container_16 .pull_3{right:-180px}.container_16 .pull_5{right:-300px}.container_16 .pull_6{right:-360px}.container_16 .pull_7{right:-420px}.container_16 .pull_9{right:-540px}.container_16 .pull_10{right:-600px}.container_16 .pull_11{right:-660px}.container_16 .pull_13{right:-780px}.container_16 .pull_14{right:-840px}.container_16 .pull_15{right:-900px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:before,.clearfix:after,.container_12:before,.container_12:after,.container_16:before,.container_16:after{content:'.';display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}.clearfix:after,.container_12:after,.container_16:after{clear:both}.clearfix,.container_12,.container_16{zoom:1} \ No newline at end of file diff --git a/catalog/ext/960gs/rtl_960_24_col.css b/catalog/ext/960gs/rtl_960_24_col.css deleted file mode 100755 index e538d1934..000000000 --- a/catalog/ext/960gs/rtl_960_24_col.css +++ /dev/null @@ -1 +0,0 @@ -body{min-width:960px}.container_24{margin-right:auto;margin-left:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16,.grid_17,.grid_18,.grid_19,.grid_20,.grid_21,.grid_22,.grid_23,.grid_24{display:inline;float:right;margin-right:5px;margin-left:5px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11,.push_12,.pull_12,.push_13,.pull_13,.push_14,.pull_14,.push_15,.pull_15,.push_16,.pull_16,.push_17,.pull_17,.push_18,.pull_18,.push_19,.pull_19,.push_20,.pull_20,.push_21,.pull_21,.push_22,.pull_22,.push_23,.pull_23{position:relative}.alpha{margin-right:0}.omega{margin-left:0}.container_24 .grid_1{width:30px}.container_24 .grid_2{width:70px}.container_24 .grid_3{width:110px}.container_24 .grid_4{width:150px}.container_24 .grid_5{width:190px}.container_24 .grid_6{width:230px}.container_24 .grid_7{width:270px}.container_24 .grid_8{width:310px}.container_24 .grid_9{width:350px}.container_24 .grid_10{width:390px}.container_24 .grid_11{width:430px}.container_24 .grid_12{width:470px}.container_24 .grid_13{width:510px}.container_24 .grid_14{width:550px}.container_24 .grid_15{width:590px}.container_24 .grid_16{width:630px}.container_24 .grid_17{width:670px}.container_24 .grid_18{width:710px}.container_24 .grid_19{width:750px}.container_24 .grid_20{width:790px}.container_24 .grid_21{width:830px}.container_24 .grid_22{width:870px}.container_24 .grid_23{width:910px}.container_24 .grid_24{width:950px}.container_24 .prefix_1{padding-right:40px}.container_24 .prefix_2{padding-right:80px}.container_24 .prefix_3{padding-right:120px}.container_24 .prefix_4{padding-right:160px}.container_24 .prefix_5{padding-right:200px}.container_24 .prefix_6{padding-right:240px}.container_24 .prefix_7{padding-right:280px}.container_24 .prefix_8{padding-right:320px}.container_24 .prefix_9{padding-right:360px}.container_24 .prefix_10{padding-right:400px}.container_24 .prefix_11{padding-right:440px}.container_24 .prefix_12{padding-right:480px}.container_24 .prefix_13{padding-right:520px}.container_24 .prefix_14{padding-right:560px}.container_24 .prefix_15{padding-right:600px}.container_24 .prefix_16{padding-right:640px}.container_24 .prefix_17{padding-right:680px}.container_24 .prefix_18{padding-right:720px}.container_24 .prefix_19{padding-right:760px}.container_24 .prefix_20{padding-right:800px}.container_24 .prefix_21{padding-right:840px}.container_24 .prefix_22{padding-right:880px}.container_24 .prefix_23{padding-right:920px}.container_24 .suffix_1{padding-left:40px}.container_24 .suffix_2{padding-left:80px}.container_24 .suffix_3{padding-left:120px}.container_24 .suffix_4{padding-left:160px}.container_24 .suffix_5{padding-left:200px}.container_24 .suffix_6{padding-left:240px}.container_24 .suffix_7{padding-left:280px}.container_24 .suffix_8{padding-left:320px}.container_24 .suffix_9{padding-left:360px}.container_24 .suffix_10{padding-left:400px}.container_24 .suffix_11{padding-left:440px}.container_24 .suffix_12{padding-left:480px}.container_24 .suffix_13{padding-left:520px}.container_24 .suffix_14{padding-left:560px}.container_24 .suffix_15{padding-left:600px}.container_24 .suffix_16{padding-left:640px}.container_24 .suffix_17{padding-left:680px}.container_24 .suffix_18{padding-left:720px}.container_24 .suffix_19{padding-left:760px}.container_24 .suffix_20{padding-left:800px}.container_24 .suffix_21{padding-left:840px}.container_24 .suffix_22{padding-left:880px}.container_24 .suffix_23{padding-left:920px}.container_24 .push_1{right:40px}.container_24 .push_2{right:80px}.container_24 .push_3{right:120px}.container_24 .push_4{right:160px}.container_24 .push_5{right:200px}.container_24 .push_6{right:240px}.container_24 .push_7{right:280px}.container_24 .push_8{right:320px}.container_24 .push_9{right:360px}.container_24 .push_10{right:400px}.container_24 .push_11{right:440px}.container_24 .push_12{right:480px}.container_24 .push_13{right:520px}.container_24 .push_14{right:560px}.container_24 .push_15{right:600px}.container_24 .push_16{right:640px}.container_24 .push_17{right:680px}.container_24 .push_18{right:720px}.container_24 .push_19{right:760px}.container_24 .push_20{right:800px}.container_24 .push_21{right:840px}.container_24 .push_22{right:880px}.container_24 .push_23{right:920px}.container_24 .pull_1{right:-40px}.container_24 .pull_2{right:-80px}.container_24 .pull_3{right:-120px}.container_24 .pull_4{right:-160px}.container_24 .pull_5{right:-200px}.container_24 .pull_6{right:-240px}.container_24 .pull_7{right:-280px}.container_24 .pull_8{right:-320px}.container_24 .pull_9{right:-360px}.container_24 .pull_10{right:-400px}.container_24 .pull_11{right:-440px}.container_24 .pull_12{right:-480px}.container_24 .pull_13{right:-520px}.container_24 .pull_14{right:-560px}.container_24 .pull_15{right:-600px}.container_24 .pull_16{right:-640px}.container_24 .pull_17{right:-680px}.container_24 .pull_18{right:-720px}.container_24 .pull_19{right:-760px}.container_24 .pull_20{right:-800px}.container_24 .pull_21{right:-840px}.container_24 .pull_22{right:-880px}.container_24 .pull_23{right:-920px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:before,.clearfix:after,.container_24:before,.container_24:after{content:'.';display:block;overflow:hidden;visibility:hidden;font-size:0;line-height:0;width:0;height:0}.clearfix:after,.container_24:after{clear:both}.clearfix,.container_24{zoom:1} \ No newline at end of file diff --git a/catalog/ext/bootstrap/css/bootstrap-theme.css b/catalog/ext/bootstrap/css/bootstrap-theme.css new file mode 100644 index 000000000..b0fdfcbf9 --- /dev/null +++ b/catalog/ext/bootstrap/css/bootstrap-theme.css @@ -0,0 +1,476 @@ +/*! + * Bootstrap v3.3.4 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +.btn-default, +.btn-primary, +.btn-success, +.btn-info, +.btn-warning, +.btn-danger { + text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075); +} +.btn-default:active, +.btn-primary:active, +.btn-success:active, +.btn-info:active, +.btn-warning:active, +.btn-danger:active, +.btn-default.active, +.btn-primary.active, +.btn-success.active, +.btn-info.active, +.btn-warning.active, +.btn-danger.active { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn-default .badge, +.btn-primary .badge, +.btn-success .badge, +.btn-info .badge, +.btn-warning .badge, +.btn-danger .badge { + text-shadow: none; +} +.btn:active, +.btn.active { + background-image: none; +} +.btn-default { + text-shadow: 0 1px 0 #fff; + background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%); + background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0)); + background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-color: #dbdbdb; + border-color: #ccc; +} +.btn-default:hover, +.btn-default:focus { + background-color: #e0e0e0; + background-position: 0 -15px; +} +.btn-default:active, +.btn-default.active { + background-color: #e0e0e0; + border-color: #dbdbdb; +} +.btn-default.disabled, +.btn-default:disabled, +.btn-default[disabled] { + background-color: #e0e0e0; + background-image: none; +} +.btn-primary { + background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%); + background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88)); + background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-color: #245580; +} +.btn-primary:hover, +.btn-primary:focus { + background-color: #265a88; + background-position: 0 -15px; +} +.btn-primary:active, +.btn-primary.active { + background-color: #265a88; + border-color: #245580; +} +.btn-primary.disabled, +.btn-primary:disabled, +.btn-primary[disabled] { + background-color: #265a88; + background-image: none; +} +.btn-success { + background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%); + background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641)); + background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-color: #3e8f3e; +} +.btn-success:hover, +.btn-success:focus { + background-color: #419641; + background-position: 0 -15px; +} +.btn-success:active, +.btn-success.active { + background-color: #419641; + border-color: #3e8f3e; +} +.btn-success.disabled, +.btn-success:disabled, +.btn-success[disabled] { + background-color: #419641; + background-image: none; +} +.btn-info { + background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); + background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2)); + background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-color: #28a4c9; +} +.btn-info:hover, +.btn-info:focus { + background-color: #2aabd2; + background-position: 0 -15px; +} +.btn-info:active, +.btn-info.active { + background-color: #2aabd2; + border-color: #28a4c9; +} +.btn-info.disabled, +.btn-info:disabled, +.btn-info[disabled] { + background-color: #2aabd2; + background-image: none; +} +.btn-warning { + background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); + background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316)); + background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-color: #e38d13; +} +.btn-warning:hover, +.btn-warning:focus { + background-color: #eb9316; + background-position: 0 -15px; +} +.btn-warning:active, +.btn-warning.active { + background-color: #eb9316; + border-color: #e38d13; +} +.btn-warning.disabled, +.btn-warning:disabled, +.btn-warning[disabled] { + background-color: #eb9316; + background-image: none; +} +.btn-danger { + background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%); + background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a)); + background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-color: #b92c28; +} +.btn-danger:hover, +.btn-danger:focus { + background-color: #c12e2a; + background-position: 0 -15px; +} +.btn-danger:active, +.btn-danger.active { + background-color: #c12e2a; + border-color: #b92c28; +} +.btn-danger.disabled, +.btn-danger:disabled, +.btn-danger[disabled] { + background-color: #c12e2a; + background-image: none; +} +.thumbnail, +.img-thumbnail { + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); + box-shadow: 0 1px 2px rgba(0, 0, 0, .075); +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + background-color: #e8e8e8; + background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); + background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); + background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); + background-repeat: repeat-x; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + background-color: #2e6da4; + background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); + background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); + background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); + background-repeat: repeat-x; +} +.navbar-default { + background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%); + background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8)); + background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075); +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .active > a { + background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); + background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2)); + background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0); + background-repeat: repeat-x; + -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); + box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075); +} +.navbar-brand, +.navbar-nav > li > a { + text-shadow: 0 1px 0 rgba(255, 255, 255, .25); +} +.navbar-inverse { + background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%); + background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222)); + background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + background-repeat: repeat-x; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .active > a { + background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%); + background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f)); + background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0); + background-repeat: repeat-x; + -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); + box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25); +} +.navbar-inverse .navbar-brand, +.navbar-inverse .navbar-nav > li > a { + text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); +} +.navbar-static-top, +.navbar-fixed-top, +.navbar-fixed-bottom { + border-radius: 0; +} +@media (max-width: 767px) { + .navbar .navbar-nav .open .dropdown-menu > .active > a, + .navbar .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #fff; + background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); + background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); + background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); + background-repeat: repeat-x; + } +} +.alert { + text-shadow: 0 1px 0 rgba(255, 255, 255, .2); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05); +} +.alert-success { + background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); + background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc)); + background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0); + background-repeat: repeat-x; + border-color: #b2dba1; +} +.alert-info { + background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%); + background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0)); + background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0); + background-repeat: repeat-x; + border-color: #9acfea; +} +.alert-warning { + background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); + background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0)); + background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0); + background-repeat: repeat-x; + border-color: #f5e79e; +} +.alert-danger { + background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); + background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3)); + background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0); + background-repeat: repeat-x; + border-color: #dca7a7; +} +.progress { + background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); + background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5)); + background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0); + background-repeat: repeat-x; +} +.progress-bar { + background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%); + background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090)); + background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0); + background-repeat: repeat-x; +} +.progress-bar-success { + background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%); + background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44)); + background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0); + background-repeat: repeat-x; +} +.progress-bar-info { + background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); + background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5)); + background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0); + background-repeat: repeat-x; +} +.progress-bar-warning { + background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); + background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f)); + background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0); + background-repeat: repeat-x; +} +.progress-bar-danger { + background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%); + background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c)); + background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0); + background-repeat: repeat-x; +} +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.list-group { + border-radius: 4px; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075); + box-shadow: 0 1px 2px rgba(0, 0, 0, .075); +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + text-shadow: 0 -1px 0 #286090; + background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%); + background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a)); + background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0); + background-repeat: repeat-x; + border-color: #2b669a; +} +.list-group-item.active .badge, +.list-group-item.active:hover .badge, +.list-group-item.active:focus .badge { + text-shadow: none; +} +.panel { + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05); + box-shadow: 0 1px 2px rgba(0, 0, 0, .05); +} +.panel-default > .panel-heading { + background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); + background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8)); + background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); + background-repeat: repeat-x; +} +.panel-primary > .panel-heading { + background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%); + background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4)); + background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0); + background-repeat: repeat-x; +} +.panel-success > .panel-heading { + background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); + background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6)); + background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0); + background-repeat: repeat-x; +} +.panel-info > .panel-heading { + background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); + background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3)); + background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0); + background-repeat: repeat-x; +} +.panel-warning > .panel-heading { + background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); + background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc)); + background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0); + background-repeat: repeat-x; +} +.panel-danger > .panel-heading { + background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%); + background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc)); + background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0); + background-repeat: repeat-x; +} +.well { + background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); + background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%); + background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5)); + background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0); + background-repeat: repeat-x; + border-color: #dcdcdc; + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1); +} +/*# sourceMappingURL=bootstrap-theme.css.map */ diff --git a/catalog/ext/bootstrap/css/bootstrap-theme.css.map b/catalog/ext/bootstrap/css/bootstrap-theme.css.map new file mode 100644 index 000000000..5a12d6317 --- /dev/null +++ b/catalog/ext/bootstrap/css/bootstrap-theme.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","bootstrap-theme.css","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":"AAcA;;;;;;EAME,0CAAA;ECgDA,6FAAA;EACQ,qFAAA;EC5DT;AFgBC;;;;;;;;;;;;EC2CA,0DAAA;EACQ,kDAAA;EC7CT;AFVD;;;;;;EAiBI,mBAAA;EECH;AFiCC;;EAEE,wBAAA;EE/BH;AFoCD;EGnDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJiCA,6BAAA;EACA,uBAAA;EAgC2C,2BAAA;EAA2B,oBAAA;EEzBvE;AFLC;;EAEE,2BAAA;EACA,8BAAA;EEOH;AFJC;;EAEE,2BAAA;EACA,uBAAA;EEMH;AFHC;;;EAGE,2BAAA;EACA,wBAAA;EEKH;AFUD;EGpDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJiCA,6BAAA;EACA,uBAAA;EEgCD;AF9BC;;EAEE,2BAAA;EACA,8BAAA;EEgCH;AF7BC;;EAEE,2BAAA;EACA,uBAAA;EE+BH;AF5BC;;;EAGE,2BAAA;EACA,wBAAA;EE8BH;AFdD;EGrDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJiCA,6BAAA;EACA,uBAAA;EEyDD;AFvDC;;EAEE,2BAAA;EACA,8BAAA;EEyDH;AFtDC;;EAEE,2BAAA;EACA,uBAAA;EEwDH;AFrDC;;;EAGE,2BAAA;EACA,wBAAA;EEuDH;AFtCD;EGtDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJiCA,6BAAA;EACA,uBAAA;EEkFD;AFhFC;;EAEE,2BAAA;EACA,8BAAA;EEkFH;AF/EC;;EAEE,2BAAA;EACA,uBAAA;EEiFH;AF9EC;;;EAGE,2BAAA;EACA,wBAAA;EEgFH;AF9DD;EGvDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJiCA,6BAAA;EACA,uBAAA;EE2GD;AFzGC;;EAEE,2BAAA;EACA,8BAAA;EE2GH;AFxGC;;EAEE,2BAAA;EACA,uBAAA;EE0GH;AFvGC;;;EAGE,2BAAA;EACA,wBAAA;EEyGH;AFtFD;EGxDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJiCA,6BAAA;EACA,uBAAA;EEoID;AFlIC;;EAEE,2BAAA;EACA,8BAAA;EEoIH;AFjIC;;EAEE,2BAAA;EACA,uBAAA;EEmIH;AFhIC;;;EAGE,2BAAA;EACA,wBAAA;EEkIH;AFxGD;;EChBE,oDAAA;EACQ,4CAAA;EC4HT;AFnGD;;EGzEI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EHwEF,2BAAA;EEyGD;AFvGD;;;EG9EI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH8EF,2BAAA;EE6GD;AFpGD;EG3FI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ECnBF,qEAAA;EJ6GA,oBAAA;EC/CA,6FAAA;EACQ,qFAAA;EC0JT;AF/GD;;EG3FI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EF2CF,0DAAA;EACQ,kDAAA;ECoKT;AF5GD;;EAEE,gDAAA;EE8GD;AF1GD;EG9GI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ECnBF,qEAAA;EF+OD;AFlHD;;EG9GI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EF2CF,yDAAA;EACQ,iDAAA;EC0LT;AF5HD;;EAYI,2CAAA;EEoHH;AF/GD;;;EAGE,kBAAA;EEiHD;AF5FD;EAfI;;;IAGE,aAAA;IG3IF,0EAAA;IACA,qEAAA;IACA,+FAAA;IAAA,wEAAA;IACA,6BAAA;IACA,wHAAA;ID0PD;EACF;AFxGD;EACE,+CAAA;ECzGA,4FAAA;EACQ,oFAAA;ECoNT;AFhGD;EGpKI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH4JF,uBAAA;EE4GD;AFvGD;EGrKI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH4JF,uBAAA;EEoHD;AF9GD;EGtKI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH4JF,uBAAA;EE4HD;AFrHD;EGvKI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH4JF,uBAAA;EEoID;AFrHD;EG/KI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDuSH;AFlHD;EGzLI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED8SH;AFxHD;EG1LI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDqTH;AF9HD;EG3LI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED4TH;AFpID;EG5LI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDmUH;AF1ID;EG7LI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED0UH;AF7ID;EGhKI,+MAAA;EACA,0MAAA;EACA,uMAAA;EDgTH;AFzID;EACE,oBAAA;EC5JA,oDAAA;EACQ,4CAAA;ECwST;AF1ID;;;EAGE,+BAAA;EGjNE,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH+MF,uBAAA;EEgJD;AFrJD;;;EAQI,mBAAA;EEkJH;AFxID;ECjLE,mDAAA;EACQ,2CAAA;EC4TT;AFlID;EG1OI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED+WH;AFxID;EG3OI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDsXH;AF9ID;EG5OI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED6XH;AFpJD;EG7OI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDoYH;AF1JD;EG9OI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED2YH;AFhKD;EG/OI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDkZH;AFhKD;EGtPI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EHoPF,uBAAA;ECzMA,2FAAA;EACQ,mFAAA;ECgXT","file":"bootstrap-theme.css","sourcesContent":["\n//\n// Load core variables and mixins\n// --------------------------------------------------\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n\n//\n// Buttons\n// --------------------------------------------------\n\n// Common styles\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n text-shadow: 0 -1px 0 rgba(0,0,0,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n // Reset the shadow\n &:active,\n &.active {\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n .badge {\n text-shadow: none;\n }\n}\n\n// Mixin for generating new styles\n.btn-styles(@btn-color: #555) {\n #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));\n .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620\n background-repeat: repeat-x;\n border-color: darken(@btn-color, 14%);\n\n &:hover,\n &:focus {\n background-color: darken(@btn-color, 12%);\n background-position: 0 -15px;\n }\n\n &:active,\n &.active {\n background-color: darken(@btn-color, 12%);\n border-color: darken(@btn-color, 14%);\n }\n\n &.disabled,\n &:disabled,\n &[disabled] {\n background-color: darken(@btn-color, 12%);\n background-image: none;\n }\n}\n\n// Common styles\n.btn {\n // Remove the gradient for the pressed/active state\n &:active,\n &.active {\n background-image: none;\n }\n}\n\n// Apply the mixin to the buttons\n.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }\n.btn-primary { .btn-styles(@btn-primary-bg); }\n.btn-success { .btn-styles(@btn-success-bg); }\n.btn-info { .btn-styles(@btn-info-bg); }\n.btn-warning { .btn-styles(@btn-warning-bg); }\n.btn-danger { .btn-styles(@btn-danger-bg); }\n\n\n//\n// Images\n// --------------------------------------------------\n\n.thumbnail,\n.img-thumbnail {\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n\n\n//\n// Dropdowns\n// --------------------------------------------------\n\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));\n background-color: darken(@dropdown-link-hover-bg, 5%);\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n background-color: darken(@dropdown-link-active-bg, 5%);\n}\n\n\n//\n// Navbar\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n border-radius: @navbar-border-radius;\n @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);\n .box-shadow(@shadow);\n\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: darken(@navbar-default-link-active-bg, 5%); @end-color: darken(@navbar-default-link-active-bg, 2%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));\n }\n}\n.navbar-brand,\n.navbar-nav > li > a {\n text-shadow: 0 1px 0 rgba(255,255,255,.25);\n}\n\n// Inverted navbar\n.navbar-inverse {\n #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);\n .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257\n\n .navbar-nav > .open > a,\n .navbar-nav > .active > a {\n #gradient > .vertical(@start-color: @navbar-inverse-link-active-bg; @end-color: lighten(@navbar-inverse-link-active-bg, 2.5%));\n .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));\n }\n\n .navbar-brand,\n .navbar-nav > li > a {\n text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n }\n}\n\n// Undo rounded corners in static and fixed navbars\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n border-radius: 0;\n}\n\n// Fix active state of dropdown items in collapsed mode\n@media (max-width: @grid-float-breakpoint-max) {\n .navbar .navbar-nav .open .dropdown-menu > .active > a {\n &,\n &:hover,\n &:focus {\n color: #fff;\n #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n }\n }\n}\n\n\n//\n// Alerts\n// --------------------------------------------------\n\n// Common styles\n.alert {\n text-shadow: 0 1px 0 rgba(255,255,255,.2);\n @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);\n .box-shadow(@shadow);\n}\n\n// Mixin for generating new styles\n.alert-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));\n border-color: darken(@color, 15%);\n}\n\n// Apply the mixin to the alerts\n.alert-success { .alert-styles(@alert-success-bg); }\n.alert-info { .alert-styles(@alert-info-bg); }\n.alert-warning { .alert-styles(@alert-warning-bg); }\n.alert-danger { .alert-styles(@alert-danger-bg); }\n\n\n//\n// Progress bars\n// --------------------------------------------------\n\n// Give the progress background some depth\n.progress {\n #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)\n}\n\n// Mixin for generating new styles\n.progress-bar-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));\n}\n\n// Apply the mixin to the progress bars\n.progress-bar { .progress-bar-styles(@progress-bar-bg); }\n.progress-bar-success { .progress-bar-styles(@progress-bar-success-bg); }\n.progress-bar-info { .progress-bar-styles(@progress-bar-info-bg); }\n.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }\n.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }\n\n// Reset the striped class because our mixins don't do multiple gradients and\n// the above custom styles override the new `.progress-bar-striped` in v3.2.0.\n.progress-bar-striped {\n #gradient > .striped();\n}\n\n\n//\n// List groups\n// --------------------------------------------------\n\n.list-group {\n border-radius: @border-radius-base;\n .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);\n #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));\n border-color: darken(@list-group-active-border, 7.5%);\n\n .badge {\n text-shadow: none;\n }\n}\n\n\n//\n// Panels\n// --------------------------------------------------\n\n// Common styles\n.panel {\n .box-shadow(0 1px 2px rgba(0,0,0,.05));\n}\n\n// Mixin for generating new styles\n.panel-heading-styles(@color) {\n #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));\n}\n\n// Apply the mixin to the panel headings only\n.panel-default > .panel-heading { .panel-heading-styles(@panel-default-heading-bg); }\n.panel-primary > .panel-heading { .panel-heading-styles(@panel-primary-heading-bg); }\n.panel-success > .panel-heading { .panel-heading-styles(@panel-success-heading-bg); }\n.panel-info > .panel-heading { .panel-heading-styles(@panel-info-heading-bg); }\n.panel-warning > .panel-heading { .panel-heading-styles(@panel-warning-heading-bg); }\n.panel-danger > .panel-heading { .panel-heading-styles(@panel-danger-heading-bg); }\n\n\n//\n// Wells\n// --------------------------------------------------\n\n.well {\n #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);\n border-color: darken(@well-bg, 10%);\n @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);\n .box-shadow(@shadow);\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They will be removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility){\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n",".btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.btn-default:active,\n.btn-primary:active,\n.btn-success:active,\n.btn-info:active,\n.btn-warning:active,\n.btn-danger:active,\n.btn-default.active,\n.btn-primary.active,\n.btn-success.active,\n.btn-info.active,\n.btn-warning.active,\n.btn-danger.active {\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-default .badge,\n.btn-primary .badge,\n.btn-success .badge,\n.btn-info .badge,\n.btn-warning .badge,\n.btn-danger .badge {\n text-shadow: none;\n}\n.btn:active,\n.btn.active {\n background-image: none;\n}\n.btn-default {\n background-image: -webkit-linear-gradient(top, #ffffff 0%, #e0e0e0 100%);\n background-image: -o-linear-gradient(top, #ffffff 0%, #e0e0e0 100%);\n background-image: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #dbdbdb;\n text-shadow: 0 1px 0 #fff;\n border-color: #ccc;\n}\n.btn-default:hover,\n.btn-default:focus {\n background-color: #e0e0e0;\n background-position: 0 -15px;\n}\n.btn-default:active,\n.btn-default.active {\n background-color: #e0e0e0;\n border-color: #dbdbdb;\n}\n.btn-default.disabled,\n.btn-default:disabled,\n.btn-default[disabled] {\n background-color: #e0e0e0;\n background-image: none;\n}\n.btn-primary {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #245580;\n}\n.btn-primary:hover,\n.btn-primary:focus {\n background-color: #265a88;\n background-position: 0 -15px;\n}\n.btn-primary:active,\n.btn-primary.active {\n background-color: #265a88;\n border-color: #245580;\n}\n.btn-primary.disabled,\n.btn-primary:disabled,\n.btn-primary[disabled] {\n background-color: #265a88;\n background-image: none;\n}\n.btn-success {\n background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);\n background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);\n background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #3e8f3e;\n}\n.btn-success:hover,\n.btn-success:focus {\n background-color: #419641;\n background-position: 0 -15px;\n}\n.btn-success:active,\n.btn-success.active {\n background-color: #419641;\n border-color: #3e8f3e;\n}\n.btn-success.disabled,\n.btn-success:disabled,\n.btn-success[disabled] {\n background-color: #419641;\n background-image: none;\n}\n.btn-info {\n background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);\n background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);\n background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #28a4c9;\n}\n.btn-info:hover,\n.btn-info:focus {\n background-color: #2aabd2;\n background-position: 0 -15px;\n}\n.btn-info:active,\n.btn-info.active {\n background-color: #2aabd2;\n border-color: #28a4c9;\n}\n.btn-info.disabled,\n.btn-info:disabled,\n.btn-info[disabled] {\n background-color: #2aabd2;\n background-image: none;\n}\n.btn-warning {\n background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);\n background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);\n background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #e38d13;\n}\n.btn-warning:hover,\n.btn-warning:focus {\n background-color: #eb9316;\n background-position: 0 -15px;\n}\n.btn-warning:active,\n.btn-warning.active {\n background-color: #eb9316;\n border-color: #e38d13;\n}\n.btn-warning.disabled,\n.btn-warning:disabled,\n.btn-warning[disabled] {\n background-color: #eb9316;\n background-image: none;\n}\n.btn-danger {\n background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);\n background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);\n background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n background-repeat: repeat-x;\n border-color: #b92c28;\n}\n.btn-danger:hover,\n.btn-danger:focus {\n background-color: #c12e2a;\n background-position: 0 -15px;\n}\n.btn-danger:active,\n.btn-danger.active {\n background-color: #c12e2a;\n border-color: #b92c28;\n}\n.btn-danger.disabled,\n.btn-danger:disabled,\n.btn-danger[disabled] {\n background-color: #c12e2a;\n background-image: none;\n}\n.thumbnail,\n.img-thumbnail {\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);\n background-color: #e8e8e8;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n background-color: #2e6da4;\n}\n.navbar-default {\n background-image: -webkit-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);\n background-image: -o-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);\n background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .active > a {\n background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);\n background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);\n background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);\n -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.075);\n}\n.navbar-brand,\n.navbar-nav > li > a {\n text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);\n}\n.navbar-inverse {\n background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222222 100%);\n background-image: -o-linear-gradient(top, #3c3c3c 0%, #222222 100%);\n background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .active > a {\n background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);\n background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);\n background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);\n -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);\n box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);\n}\n.navbar-inverse .navbar-brand,\n.navbar-inverse .navbar-nav > li > a {\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\n.navbar-static-top,\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n border-radius: 0;\n}\n@media (max-width: 767px) {\n .navbar .navbar-nav .open .dropdown-menu > .active > a,\n .navbar .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n }\n}\n.alert {\n text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n.alert-success {\n background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);\n background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);\n background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);\n border-color: #b2dba1;\n}\n.alert-info {\n background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);\n background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);\n background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);\n border-color: #9acfea;\n}\n.alert-warning {\n background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);\n background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);\n background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);\n border-color: #f5e79e;\n}\n.alert-danger {\n background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);\n background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);\n background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);\n border-color: #dca7a7;\n}\n.progress {\n background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);\n background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);\n background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);\n}\n.progress-bar {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);\n}\n.progress-bar-success {\n background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);\n background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);\n background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);\n}\n.progress-bar-info {\n background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);\n background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);\n background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);\n}\n.progress-bar-warning {\n background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);\n background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);\n background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);\n}\n.progress-bar-danger {\n background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);\n background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);\n background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);\n}\n.progress-bar-striped {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.list-group {\n border-radius: 4px;\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n text-shadow: 0 -1px 0 #286090;\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);\n border-color: #2b669a;\n}\n.list-group-item.active .badge,\n.list-group-item.active:hover .badge,\n.list-group-item.active:focus .badge {\n text-shadow: none;\n}\n.panel {\n -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n}\n.panel-default > .panel-heading {\n background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);\n background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);\n}\n.panel-primary > .panel-heading {\n background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);\n background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);\n}\n.panel-success > .panel-heading {\n background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);\n background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);\n background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);\n}\n.panel-info > .panel-heading {\n background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);\n background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);\n background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);\n}\n.panel-warning > .panel-heading {\n background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);\n background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);\n background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);\n}\n.panel-danger > .panel-heading {\n background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);\n background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);\n background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);\n}\n.well {\n background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);\n background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);\n background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);\n border-color: #dcdcdc;\n -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);\n box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);\n}\n/*# sourceMappingURL=bootstrap-theme.css.map */","// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n // Vertical gradient, from top to bottom\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n background-repeat: repeat-x;\n background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n }\n .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .radial(@inner-color: #555; @outer-color: #333) {\n background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n background-image: radial-gradient(circle, @inner-color, @outer-color);\n background-repeat: no-repeat;\n }\n .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n }\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n"]} \ No newline at end of file diff --git a/catalog/ext/bootstrap/css/bootstrap-theme.min.css b/catalog/ext/bootstrap/css/bootstrap-theme.min.css new file mode 100644 index 000000000..cefa3d1ae --- /dev/null +++ b/catalog/ext/bootstrap/css/bootstrap-theme.min.css @@ -0,0 +1,5 @@ +/*! + * Bootstrap v3.3.4 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */.btn-danger,.btn-default,.btn-info,.btn-primary,.btn-success,.btn-warning{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-danger .badge,.btn-default .badge,.btn-info .badge,.btn-primary .badge,.btn-success .badge,.btn-warning .badge{text-shadow:none}.btn.active,.btn:active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:focus,.btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.btn-default.active,.btn-default:active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default.disabled,.btn-default:disabled,.btn-default[disabled]{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-o-linear-gradient(top,#337ab7 0,#265a88 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#265a88));background-image:linear-gradient(to bottom,#337ab7 0,#265a88 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#245580}.btn-primary:focus,.btn-primary:hover{background-color:#265a88;background-position:0 -15px}.btn-primary.active,.btn-primary:active{background-color:#265a88;border-color:#245580}.btn-primary.disabled,.btn-primary:disabled,.btn-primary[disabled]{background-color:#265a88;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:focus,.btn-success:hover{background-color:#419641;background-position:0 -15px}.btn-success.active,.btn-success:active{background-color:#419641;border-color:#3e8f3e}.btn-success.disabled,.btn-success:disabled,.btn-success[disabled]{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:focus,.btn-info:hover{background-color:#2aabd2;background-position:0 -15px}.btn-info.active,.btn-info:active{background-color:#2aabd2;border-color:#28a4c9}.btn-info.disabled,.btn-info:disabled,.btn-info[disabled]{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:focus,.btn-warning:hover{background-color:#eb9316;background-position:0 -15px}.btn-warning.active,.btn-warning:active{background-color:#eb9316;border-color:#e38d13}.btn-warning.disabled,.btn-warning:disabled,.btn-warning[disabled]{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:focus,.btn-danger:hover{background-color:#c12e2a;background-position:0 -15px}.btn-danger.active,.btn-danger:active{background-color:#c12e2a;border-color:#b92c28}.btn-danger.disabled,.btn-danger:disabled,.btn-danger[disabled]{background-color:#c12e2a;background-image:none}.img-thumbnail,.thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{background-color:#2e6da4;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-o-linear-gradient(top,#dbdbdb 0,#e2e2e2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dbdbdb),to(#e2e2e2));background-image:linear-gradient(to bottom,#dbdbdb 0,#e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.open>a{background-image:-webkit-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-o-linear-gradient(top,#080808 0,#0f0f0f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#080808),to(#0f0f0f));background-image:linear-gradient(to bottom,#080808 0,#0f0f0f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}@media (max-width:767px){.navbar .navbar-nav .open .dropdown-menu>.active>a,.navbar .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-o-linear-gradient(top,#337ab7 0,#286090 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#286090));background-image:linear-gradient(to bottom,#337ab7 0,#286090 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:repeat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{text-shadow:0 -1px 0 #286090;background-image:-webkit-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2b669a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2b669a));background-image:linear-gradient(to bottom,#337ab7 0,#2b669a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);background-repeat:repeat-x;border-color:#2b669a}.list-group-item.active .badge,.list-group-item.active:focus .badge,.list-group-item.active:hover .badge{text-shadow:none}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-o-linear-gradient(top,#337ab7 0,#2e6da4 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#337ab7),to(#2e6da4));background-image:linear-gradient(to bottom,#337ab7 0,#2e6da4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} \ No newline at end of file diff --git a/catalog/ext/bootstrap/css/bootstrap.css b/catalog/ext/bootstrap/css/bootstrap.css new file mode 100644 index 000000000..fb15e3d69 --- /dev/null +++ b/catalog/ext/bootstrap/css/bootstrap.css @@ -0,0 +1,6584 @@ +/*! + * Bootstrap v3.3.4 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + margin: .67em 0; + font-size: 2em; +} +mark { + color: #000; + background: #ff0; +} +small { + font-size: 80%; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -.5em; +} +sub { + bottom: -.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + height: 0; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + padding: .35em .625em .75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} +legend { + padding: 0; + border: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-spacing: 0; + border-collapse: collapse; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before, +.glyphicon-eur:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.glyphicon-cd:before { + content: "\e201"; +} +.glyphicon-save-file:before { + content: "\e202"; +} +.glyphicon-open-file:before { + content: "\e203"; +} +.glyphicon-level-up:before { + content: "\e204"; +} +.glyphicon-copy:before { + content: "\e205"; +} +.glyphicon-paste:before { + content: "\e206"; +} +.glyphicon-alert:before { + content: "\e209"; +} +.glyphicon-equalizer:before { + content: "\e210"; +} +.glyphicon-king:before { + content: "\e211"; +} +.glyphicon-queen:before { + content: "\e212"; +} +.glyphicon-pawn:before { + content: "\e213"; +} +.glyphicon-bishop:before { + content: "\e214"; +} +.glyphicon-knight:before { + content: "\e215"; +} +.glyphicon-baby-formula:before { + content: "\e216"; +} +.glyphicon-tent:before { + content: "\26fa"; +} +.glyphicon-blackboard:before { + content: "\e218"; +} +.glyphicon-bed:before { + content: "\e219"; +} +.glyphicon-apple:before { + content: "\f8ff"; +} +.glyphicon-erase:before { + content: "\e221"; +} +.glyphicon-hourglass:before { + content: "\231b"; +} +.glyphicon-lamp:before { + content: "\e223"; +} +.glyphicon-duplicate:before { + content: "\e224"; +} +.glyphicon-piggy-bank:before { + content: "\e225"; +} +.glyphicon-scissors:before { + content: "\e226"; +} +.glyphicon-bitcoin:before { + content: "\e227"; +} +.glyphicon-btc:before { + content: "\e227"; +} +.glyphicon-xbt:before { + content: "\e227"; +} +.glyphicon-yen:before { + content: "\00a5"; +} +.glyphicon-jpy:before { + content: "\00a5"; +} +.glyphicon-ruble:before { + content: "\20bd"; +} +.glyphicon-rub:before { + content: "\20bd"; +} +.glyphicon-scale:before { + content: "\e230"; +} +.glyphicon-ice-lolly:before { + content: "\e231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; +} +.glyphicon-education:before { + content: "\e233"; +} +.glyphicon-option-horizontal:before { + content: "\e234"; +} +.glyphicon-option-vertical:before { + content: "\e235"; +} +.glyphicon-menu-hamburger:before { + content: "\e236"; +} +.glyphicon-modal-window:before { + content: "\e237"; +} +.glyphicon-oil:before { + content: "\e238"; +} +.glyphicon-grain:before { + content: "\e239"; +} +.glyphicon-sunglasses:before { + content: "\e240"; +} +.glyphicon-text-size:before { + content: "\e241"; +} +.glyphicon-text-color:before { + content: "\e242"; +} +.glyphicon-text-background:before { + content: "\e243"; +} +.glyphicon-object-align-top:before { + content: "\e244"; +} +.glyphicon-object-align-bottom:before { + content: "\e245"; +} +.glyphicon-object-align-horizontal:before { + content: "\e246"; +} +.glyphicon-object-align-left:before { + content: "\e247"; +} +.glyphicon-object-align-vertical:before { + content: "\e248"; +} +.glyphicon-object-align-right:before { + content: "\e249"; +} +.glyphicon-triangle-right:before { + content: "\e250"; +} +.glyphicon-triangle-left:before { + content: "\e251"; +} +.glyphicon-triangle-bottom:before { + content: "\e252"; +} +.glyphicon-triangle-top:before { + content: "\e253"; +} +.glyphicon-console:before { + content: "\e254"; +} +.glyphicon-superscript:before { + content: "\e255"; +} +.glyphicon-subscript:before { + content: "\e256"; +} +.glyphicon-menu-left:before { + content: "\e257"; +} +.glyphicon-menu-right:before { + content: "\e258"; +} +.glyphicon-menu-down:before { + content: "\e259"; +} +.glyphicon-menu-up:before { + content: "\e260"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333; + background-color: #fff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #337ab7; + text-decoration: none; +} +a:hover, +a:focus { + color: #23527c; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + display: inline-block; + max-width: 100%; + height: auto; + padding: 4px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #777; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +mark, +.mark { + padding: .2em; + background-color: #fcf8e3; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #777; +} +.text-primary { + color: #337ab7; +} +a.text-primary:hover { + color: #286090; +} +.text-success { + color: #3c763d; +} +a.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:hover { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:hover { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #337ab7; +} +a.bg-primary:hover { + background-color: #286090; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; +} +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #777; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #777; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + text-align: right; + border-right: 5px solid #eee; + border-left: 0; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + -webkit-box-shadow: none; + box-shadow: none; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: #f5f5f5; + border: 1px solid #ccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +.row { + margin-right: -15px; + margin-left: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #ddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #ddd; +} +.table .table { + background-color: #fff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + display: table-column; + float: none; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + display: table-cell; + float: none; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +.table-responsive { + min-height: .01%; + overflow-x: auto; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); +} +.form-control::-moz-placeholder { + color: #999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999; +} +.form-control::-webkit-input-placeholder { + color: #999; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #eee; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="month"] { + line-height: 34px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 30px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 46px; + } +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-top: 4px \9; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + vertical-align: middle; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + min-height: 34px; + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-right: 0; + padding-left: 0; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.form-group-sm .form-control { + height: 30px; + line-height: 30px; +} +textarea.form-group-sm .form-control, +select[multiple].form-group-sm .form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 30px; + min-height: 32px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.form-group-lg .form-control { + height: 46px; + line-height: 46px; +} +textarea.form-group-lg .form-control, +select[multiple].form-group-lg .form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 46px; + min-height: 38px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label ~ .form-control-feedback { + top: 25px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + padding-top: 7px; + margin-bottom: 0; + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.333333px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #333; + text-decoration: none; +} +.btn:active, +.btn.active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + pointer-events: none; + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: .65; +} +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default.focus, +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-primary { + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary.focus, +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary .badge { + color: #337ab7; + background-color: #fff; +} +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success.focus, +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info.focus, +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning.focus, +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger.focus, +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-link { + font-weight: normal; + color: #337ab7; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #23527c; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity .15s linear; + -o-transition: opacity .15s linear; + transition: opacity .15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; + -webkit-transition-duration: .35s; + -o-transition-duration: .35s; + transition-duration: .35s; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + background-color: #337ab7; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #777; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + right: 0; + left: auto; +} +.dropdown-menu-left { + right: auto; + left: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px solid; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-left-radius: 4px; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-right: 0; + padding-left: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + margin-left: -1px; +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eee; +} +.nav > li.disabled > a { + color: #777; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #777; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eee; + border-color: #337ab7; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #fff; + background-color: #337ab7; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-right: 0; + padding-left: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } +} +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777; +} +.navbar-default .navbar-nav > li > a { + color: #777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #ccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #ddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #ddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + color: #555; + background-color: #e7e7e7; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #ccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777; +} +.navbar-default .navbar-link:hover { + color: #333; +} +.navbar-default .btn-link { + color: #777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #333; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #ccc; +} +.navbar-inverse { + background-color: #222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #9d9d9d; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #fff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + color: #fff; + background-color: #080808; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #9d9d9d; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #fff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #fff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #9d9d9d; +} +.navbar-inverse .navbar-link:hover { + color: #fff; +} +.navbar-inverse .btn-link { + color: #9d9d9d; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #fff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; +} +.breadcrumb > .active { + color: #777; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #337ab7; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + color: #23527c; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #fff; + cursor: default; + background-color: #337ab7; + border-color: #337ab7; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777; + cursor: not-allowed; + background-color: #fff; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #777; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #5e5e5e; +} +.label-primary { + background-color: #337ab7; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #286090; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + background-color: #777; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge, +.btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #337ab7; + background-color: #fff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px 15px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron, +.container-fluid .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding: 48px 0; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-right: 60px; + padding-left: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: border .2s ease-in-out; + -o-transition: border .2s ease-in-out; + transition: border .2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-right: auto; + margin-left: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #337ab7; +} +.thumbnail .caption { + padding: 9px; + color: #333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); +} +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #337ab7; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + -webkit-transition: width .6s ease; + -o-transition: width .6s ease; + transition: width .6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + padding-left: 0; + margin-bottom: 20px; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; +} +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item { + color: #555; +} +a.list-group-item .list-group-item-heading { + color: #333; +} +a.list-group-item:hover, +a.list-group-item:focus { + color: #555; + text-decoration: none; + background-color: #f5f5f5; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + color: #777; + cursor: not-allowed; + background-color: #eee; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +a.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:hover, +a.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +a.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:hover, +a.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +a.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +a.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: 0 1px 1px rgba(0, 0, 0, .05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-right: 15px; + padding-left: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #ddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + margin-bottom: 0; + border: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #ddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; +} +.panel-default { + border-color: #ddd; +} +.panel-default > .panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ddd; +} +.panel-primary { + border-color: #337ab7; +} +.panel-primary > .panel-heading { + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; +} +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #fff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, .15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: .2; +} +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .5; +} +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; +} +.modal-open { + overflow: hidden; +} +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform .3s ease-out; + -o-transition: -o-transform .3s ease-out; + transition: transform .3s ease-out; + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; +} +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: .5; +} +.modal-header { + min-height: 16.42857143px; + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-weight: normal; + line-height: 1.4; + filter: alpha(opacity=0); + opacity: 0; +} +.tooltip.in { + filter: alpha(opacity=90); + opacity: .9; +} +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + text-decoration: none; + background-color: #000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-left .tooltip-arrow { + right: 5px; + bottom: 0; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + content: ""; + border-width: 10px; +} +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, .25); + border-bottom-width: 0; +} +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, .25); + border-left-width: 0; +} +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; +} +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, .25); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, .25); +} +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: .6s ease-in-out left; + -o-transition: .6s ease-in-out left; + transition: .6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform .6s ease-in-out; + -o-transition: -o-transform .6s ease-in-out; + transition: transform .6s ease-in-out; + + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + perspective: 1000; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + left: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + left: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + left: 0; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 15%; + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); + filter: alpha(opacity=50); + opacity: .5; +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control.right { + right: 0; + left: auto; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control:hover, +.carousel-control:focus { + color: #fff; + text-decoration: none; + filter: alpha(opacity=90); + outline: 0; + opacity: .9; +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + font-family: serif; + line-height: 1; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + padding-left: 0; + margin-left: -30%; + text-align: center; + list-style: none; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); + border: 1px solid #fff; + border-radius: 10px; +} +.carousel-indicators .active { + width: 12px; + height: 12px; + margin: 0; + background-color: #fff; +} +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; + } + .carousel-caption { + right: 20%; + left: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + display: table; + content: " "; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-right: auto; + margin-left: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +/*# sourceMappingURL=bootstrap.css.map */ diff --git a/catalog/ext/bootstrap/css/bootstrap.css.map b/catalog/ext/bootstrap/css/bootstrap.css.map new file mode 100644 index 000000000..2fd84f36e --- /dev/null +++ b/catalog/ext/bootstrap/css/bootstrap.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["bootstrap.css","less/normalize.less","less/print.less","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less/pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":"AAAA,6DAA4D;ACQ5D;EACE,yBAAA;EACA,4BAAA;EACA,gCAAA;EDND;ACaD;EACE,WAAA;EDXD;ACwBD;;;;;;;;;;;;;EAaE,gBAAA;EDtBD;AC8BD;;;;EAIE,uBAAA;EACA,0BAAA;ED5BD;ACoCD;EACE,eAAA;EACA,WAAA;EDlCD;AC0CD;;EAEE,eAAA;EDxCD;ACkDD;EACE,+BAAA;EDhDD;ACuDD;;EAEE,YAAA;EDrDD;AC+DD;EACE,2BAAA;ED7DD;ACoED;;EAEE,mBAAA;EDlED;ACyED;EACE,oBAAA;EDvED;AC+ED;EACE,gBAAA;EACA,kBAAA;ED7ED;ACoFD;EACE,kBAAA;EACA,aAAA;EDlFD;ACyFD;EACE,gBAAA;EDvFD;AC8FD;;EAEE,gBAAA;EACA,gBAAA;EACA,oBAAA;EACA,0BAAA;ED5FD;AC+FD;EACE,aAAA;ED7FD;ACgGD;EACE,iBAAA;ED9FD;ACwGD;EACE,WAAA;EDtGD;AC6GD;EACE,kBAAA;ED3GD;ACqHD;EACE,kBAAA;EDnHD;AC0HD;EACE,8BAAA;EACA,iCAAA;UAAA,yBAAA;EACA,WAAA;EDxHD;AC+HD;EACE,gBAAA;ED7HD;ACoID;;;;EAIE,mCAAA;EACA,gBAAA;EDlID;ACoJD;;;;;EAKE,gBAAA;EACA,eAAA;EACA,WAAA;EDlJD;ACyJD;EACE,mBAAA;EDvJD;ACiKD;;EAEE,sBAAA;ED/JD;AC0KD;;;;EAIE,4BAAA;EACA,iBAAA;EDxKD;AC+KD;;EAEE,iBAAA;ED7KD;ACoLD;;EAEE,WAAA;EACA,YAAA;EDlLD;AC0LD;EACE,qBAAA;EDxLD;ACmMD;;EAEE,gCAAA;KAAA,6BAAA;UAAA,wBAAA;EACA,YAAA;EDjMD;AC0MD;;EAEE,cAAA;EDxMD;ACiND;EACE,+BAAA;EACA,8BAAA;EACA,iCAAA;EACA,yBAAA;ED/MD;ACwND;;EAEE,0BAAA;EDtND;AC6ND;EACE,2BAAA;EACA,eAAA;EACA,gCAAA;ED3ND;ACmOD;EACE,WAAA;EACA,YAAA;EDjOD;ACwOD;EACE,gBAAA;EDtOD;AC8OD;EACE,mBAAA;ED5OD;ACsPD;EACE,2BAAA;EACA,mBAAA;EDpPD;ACuPD;;EAEE,YAAA;EDrPD;AACD,sFAAqF;AE1ErF;EAnGI;;;IAGI,oCAAA;IACA,wBAAA;IACA,qCAAA;YAAA,6BAAA;IACA,8BAAA;IFgLL;EE7KC;;IAEI,4BAAA;IF+KL;EE5KC;IACI,8BAAA;IF8KL;EE3KC;IACI,+BAAA;IF6KL;EExKC;;IAEI,aAAA;IF0KL;EEvKC;;IAEI,wBAAA;IACA,0BAAA;IFyKL;EEtKC;IACI,6BAAA;IFwKL;EErKC;;IAEI,0BAAA;IFuKL;EEpKC;IACI,4BAAA;IFsKL;EEnKC;;;IAGI,YAAA;IACA,WAAA;IFqKL;EElKC;;IAEI,yBAAA;IFoKL;EE7JC;IACI,6BAAA;IF+JL;EE3JC;IACI,eAAA;IF6JL;EE3JC;;IAGQ,mCAAA;IF4JT;EEzJC;IACI,wBAAA;IF2JL;EExJC;IACI,sCAAA;IF0JL;EE3JC;;IAKQ,mCAAA;IF0JT;EEvJC;;IAGQ,mCAAA;IFwJT;EACF;AGpPD;EACE,qCAAA;EACA,uDAAA;EACA,iYAAA;EHsPD;AG9OD;EACE,oBAAA;EACA,UAAA;EACA,uBAAA;EACA,qCAAA;EACA,oBAAA;EACA,qBAAA;EACA,gBAAA;EACA,qCAAA;EACA,oCAAA;EHgPD;AG5OmC;EAAW,gBAAA;EH+O9C;AG9OmC;EAAW,gBAAA;EHiP9C;AG/OmC;;EAAW,kBAAA;EHmP9C;AGlPmC;EAAW,kBAAA;EHqP9C;AGpPmC;EAAW,kBAAA;EHuP9C;AGtPmC;EAAW,kBAAA;EHyP9C;AGxPmC;EAAW,kBAAA;EH2P9C;AG1PmC;EAAW,kBAAA;EH6P9C;AG5PmC;EAAW,kBAAA;EH+P9C;AG9PmC;EAAW,kBAAA;EHiQ9C;AGhQmC;EAAW,kBAAA;EHmQ9C;AGlQmC;EAAW,kBAAA;EHqQ9C;AGpQmC;EAAW,kBAAA;EHuQ9C;AGtQmC;EAAW,kBAAA;EHyQ9C;AGxQmC;EAAW,kBAAA;EH2Q9C;AG1QmC;EAAW,kBAAA;EH6Q9C;AG5QmC;EAAW,kBAAA;EH+Q9C;AG9QmC;EAAW,kBAAA;EHiR9C;AGhRmC;EAAW,kBAAA;EHmR9C;AGlRmC;EAAW,kBAAA;EHqR9C;AGpRmC;EAAW,kBAAA;EHuR9C;AGtRmC;EAAW,kBAAA;EHyR9C;AGxRmC;EAAW,kBAAA;EH2R9C;AG1RmC;EAAW,kBAAA;EH6R9C;AG5RmC;EAAW,kBAAA;EH+R9C;AG9RmC;EAAW,kBAAA;EHiS9C;AGhSmC;EAAW,kBAAA;EHmS9C;AGlSmC;EAAW,kBAAA;EHqS9C;AGpSmC;EAAW,kBAAA;EHuS9C;AGtSmC;EAAW,kBAAA;EHyS9C;AGxSmC;EAAW,kBAAA;EH2S9C;AG1SmC;EAAW,kBAAA;EH6S9C;AG5SmC;EAAW,kBAAA;EH+S9C;AG9SmC;EAAW,kBAAA;EHiT9C;AGhTmC;EAAW,kBAAA;EHmT9C;AGlTmC;EAAW,kBAAA;EHqT9C;AGpTmC;EAAW,kBAAA;EHuT9C;AGtTmC;EAAW,kBAAA;EHyT9C;AGxTmC;EAAW,kBAAA;EH2T9C;AG1TmC;EAAW,kBAAA;EH6T9C;AG5TmC;EAAW,kBAAA;EH+T9C;AG9TmC;EAAW,kBAAA;EHiU9C;AGhUmC;EAAW,kBAAA;EHmU9C;AGlUmC;EAAW,kBAAA;EHqU9C;AGpUmC;EAAW,kBAAA;EHuU9C;AGtUmC;EAAW,kBAAA;EHyU9C;AGxUmC;EAAW,kBAAA;EH2U9C;AG1UmC;EAAW,kBAAA;EH6U9C;AG5UmC;EAAW,kBAAA;EH+U9C;AG9UmC;EAAW,kBAAA;EHiV9C;AGhVmC;EAAW,kBAAA;EHmV9C;AGlVmC;EAAW,kBAAA;EHqV9C;AGpVmC;EAAW,kBAAA;EHuV9C;AGtVmC;EAAW,kBAAA;EHyV9C;AGxVmC;EAAW,kBAAA;EH2V9C;AG1VmC;EAAW,kBAAA;EH6V9C;AG5VmC;EAAW,kBAAA;EH+V9C;AG9VmC;EAAW,kBAAA;EHiW9C;AGhWmC;EAAW,kBAAA;EHmW9C;AGlWmC;EAAW,kBAAA;EHqW9C;AGpWmC;EAAW,kBAAA;EHuW9C;AGtWmC;EAAW,kBAAA;EHyW9C;AGxWmC;EAAW,kBAAA;EH2W9C;AG1WmC;EAAW,kBAAA;EH6W9C;AG5WmC;EAAW,kBAAA;EH+W9C;AG9WmC;EAAW,kBAAA;EHiX9C;AGhXmC;EAAW,kBAAA;EHmX9C;AGlXmC;EAAW,kBAAA;EHqX9C;AGpXmC;EAAW,kBAAA;EHuX9C;AGtXmC;EAAW,kBAAA;EHyX9C;AGxXmC;EAAW,kBAAA;EH2X9C;AG1XmC;EAAW,kBAAA;EH6X9C;AG5XmC;EAAW,kBAAA;EH+X9C;AG9XmC;EAAW,kBAAA;EHiY9C;AGhYmC;EAAW,kBAAA;EHmY9C;AGlYmC;EAAW,kBAAA;EHqY9C;AGpYmC;EAAW,kBAAA;EHuY9C;AGtYmC;EAAW,kBAAA;EHyY9C;AGxYmC;EAAW,kBAAA;EH2Y9C;AG1YmC;EAAW,kBAAA;EH6Y9C;AG5YmC;EAAW,kBAAA;EH+Y9C;AG9YmC;EAAW,kBAAA;EHiZ9C;AGhZmC;EAAW,kBAAA;EHmZ9C;AGlZmC;EAAW,kBAAA;EHqZ9C;AGpZmC;EAAW,kBAAA;EHuZ9C;AGtZmC;EAAW,kBAAA;EHyZ9C;AGxZmC;EAAW,kBAAA;EH2Z9C;AG1ZmC;EAAW,kBAAA;EH6Z9C;AG5ZmC;EAAW,kBAAA;EH+Z9C;AG9ZmC;EAAW,kBAAA;EHia9C;AGhamC;EAAW,kBAAA;EHma9C;AGlamC;EAAW,kBAAA;EHqa9C;AGpamC;EAAW,kBAAA;EHua9C;AGtamC;EAAW,kBAAA;EHya9C;AGxamC;EAAW,kBAAA;EH2a9C;AG1amC;EAAW,kBAAA;EH6a9C;AG5amC;EAAW,kBAAA;EH+a9C;AG9amC;EAAW,kBAAA;EHib9C;AGhbmC;EAAW,kBAAA;EHmb9C;AGlbmC;EAAW,kBAAA;EHqb9C;AGpbmC;EAAW,kBAAA;EHub9C;AGtbmC;EAAW,kBAAA;EHyb9C;AGxbmC;EAAW,kBAAA;EH2b9C;AG1bmC;EAAW,kBAAA;EH6b9C;AG5bmC;EAAW,kBAAA;EH+b9C;AG9bmC;EAAW,kBAAA;EHic9C;AGhcmC;EAAW,kBAAA;EHmc9C;AGlcmC;EAAW,kBAAA;EHqc9C;AGpcmC;EAAW,kBAAA;EHuc9C;AGtcmC;EAAW,kBAAA;EHyc9C;AGxcmC;EAAW,kBAAA;EH2c9C;AG1cmC;EAAW,kBAAA;EH6c9C;AG5cmC;EAAW,kBAAA;EH+c9C;AG9cmC;EAAW,kBAAA;EHid9C;AGhdmC;EAAW,kBAAA;EHmd9C;AGldmC;EAAW,kBAAA;EHqd9C;AGpdmC;EAAW,kBAAA;EHud9C;AGtdmC;EAAW,kBAAA;EHyd9C;AGxdmC;EAAW,kBAAA;EH2d9C;AG1dmC;EAAW,kBAAA;EH6d9C;AG5dmC;EAAW,kBAAA;EH+d9C;AG9dmC;EAAW,kBAAA;EHie9C;AGhemC;EAAW,kBAAA;EHme9C;AGlemC;EAAW,kBAAA;EHqe9C;AGpemC;EAAW,kBAAA;EHue9C;AGtemC;EAAW,kBAAA;EHye9C;AGxemC;EAAW,kBAAA;EH2e9C;AG1emC;EAAW,kBAAA;EH6e9C;AG5emC;EAAW,kBAAA;EH+e9C;AG9emC;EAAW,kBAAA;EHif9C;AGhfmC;EAAW,kBAAA;EHmf9C;AGlfmC;EAAW,kBAAA;EHqf9C;AGpfmC;EAAW,kBAAA;EHuf9C;AGtfmC;EAAW,kBAAA;EHyf9C;AGxfmC;EAAW,kBAAA;EH2f9C;AG1fmC;EAAW,kBAAA;EH6f9C;AG5fmC;EAAW,kBAAA;EH+f9C;AG9fmC;EAAW,kBAAA;EHigB9C;AGhgBmC;EAAW,kBAAA;EHmgB9C;AGlgBmC;EAAW,kBAAA;EHqgB9C;AGpgBmC;EAAW,kBAAA;EHugB9C;AGtgBmC;EAAW,kBAAA;EHygB9C;AGxgBmC;EAAW,kBAAA;EH2gB9C;AG1gBmC;EAAW,kBAAA;EH6gB9C;AG5gBmC;EAAW,kBAAA;EH+gB9C;AG9gBmC;EAAW,kBAAA;EHihB9C;AGhhBmC;EAAW,kBAAA;EHmhB9C;AGlhBmC;EAAW,kBAAA;EHqhB9C;AGphBmC;EAAW,kBAAA;EHuhB9C;AGthBmC;EAAW,kBAAA;EHyhB9C;AGxhBmC;EAAW,kBAAA;EH2hB9C;AG1hBmC;EAAW,kBAAA;EH6hB9C;AG5hBmC;EAAW,kBAAA;EH+hB9C;AG9hBmC;EAAW,kBAAA;EHiiB9C;AGhiBmC;EAAW,kBAAA;EHmiB9C;AGliBmC;EAAW,kBAAA;EHqiB9C;AGpiBmC;EAAW,kBAAA;EHuiB9C;AGtiBmC;EAAW,kBAAA;EHyiB9C;AGxiBmC;EAAW,kBAAA;EH2iB9C;AG1iBmC;EAAW,kBAAA;EH6iB9C;AG5iBmC;EAAW,kBAAA;EH+iB9C;AG9iBmC;EAAW,kBAAA;EHijB9C;AGhjBmC;EAAW,kBAAA;EHmjB9C;AGljBmC;EAAW,kBAAA;EHqjB9C;AGpjBmC;EAAW,kBAAA;EHujB9C;AGtjBmC;EAAW,kBAAA;EHyjB9C;AGxjBmC;EAAW,kBAAA;EH2jB9C;AG1jBmC;EAAW,kBAAA;EH6jB9C;AG5jBmC;EAAW,kBAAA;EH+jB9C;AG9jBmC;EAAW,kBAAA;EHikB9C;AGhkBmC;EAAW,kBAAA;EHmkB9C;AGlkBmC;EAAW,kBAAA;EHqkB9C;AGpkBmC;EAAW,kBAAA;EHukB9C;AGtkBmC;EAAW,kBAAA;EHykB9C;AGxkBmC;EAAW,kBAAA;EH2kB9C;AG1kBmC;EAAW,kBAAA;EH6kB9C;AG5kBmC;EAAW,kBAAA;EH+kB9C;AG9kBmC;EAAW,kBAAA;EHilB9C;AGhlBmC;EAAW,kBAAA;EHmlB9C;AGllBmC;EAAW,kBAAA;EHqlB9C;AGplBmC;EAAW,kBAAA;EHulB9C;AGtlBmC;EAAW,kBAAA;EHylB9C;AGxlBmC;EAAW,kBAAA;EH2lB9C;AG1lBmC;EAAW,kBAAA;EH6lB9C;AG5lBmC;EAAW,kBAAA;EH+lB9C;AG9lBmC;EAAW,kBAAA;EHimB9C;AGhmBmC;EAAW,kBAAA;EHmmB9C;AGlmBmC;EAAW,kBAAA;EHqmB9C;AGpmBmC;EAAW,kBAAA;EHumB9C;AGtmBmC;EAAW,kBAAA;EHymB9C;AGxmBmC;EAAW,kBAAA;EH2mB9C;AG1mBmC;EAAW,kBAAA;EH6mB9C;AG5mBmC;EAAW,kBAAA;EH+mB9C;AG9mBmC;EAAW,kBAAA;EHinB9C;AGhnBmC;EAAW,kBAAA;EHmnB9C;AGlnBmC;EAAW,kBAAA;EHqnB9C;AGpnBmC;EAAW,kBAAA;EHunB9C;AGtnBmC;EAAW,kBAAA;EHynB9C;AGxnBmC;EAAW,kBAAA;EH2nB9C;AG1nBmC;EAAW,kBAAA;EH6nB9C;AG5nBmC;EAAW,kBAAA;EH+nB9C;AG9nBmC;EAAW,kBAAA;EHioB9C;AGhoBmC;EAAW,kBAAA;EHmoB9C;AGloBmC;EAAW,kBAAA;EHqoB9C;AGpoBmC;EAAW,kBAAA;EHuoB9C;AGtoBmC;EAAW,kBAAA;EHyoB9C;AGhoBmC;EAAW,kBAAA;EHmoB9C;AGloBmC;EAAW,kBAAA;EHqoB9C;AGpoBmC;EAAW,kBAAA;EHuoB9C;AGtoBmC;EAAW,kBAAA;EHyoB9C;AGxoBmC;EAAW,kBAAA;EH2oB9C;AG1oBmC;EAAW,kBAAA;EH6oB9C;AG5oBmC;EAAW,kBAAA;EH+oB9C;AG9oBmC;EAAW,kBAAA;EHipB9C;AGhpBmC;EAAW,kBAAA;EHmpB9C;AGlpBmC;EAAW,kBAAA;EHqpB9C;AGppBmC;EAAW,kBAAA;EHupB9C;AGtpBmC;EAAW,kBAAA;EHypB9C;AGxpBmC;EAAW,kBAAA;EH2pB9C;AG1pBmC;EAAW,kBAAA;EH6pB9C;AG5pBmC;EAAW,kBAAA;EH+pB9C;AG9pBmC;EAAW,kBAAA;EHiqB9C;AGhqBmC;EAAW,kBAAA;EHmqB9C;AGlqBmC;EAAW,kBAAA;EHqqB9C;AGpqBmC;EAAW,kBAAA;EHuqB9C;AGtqBmC;EAAW,kBAAA;EHyqB9C;AGxqBmC;EAAW,kBAAA;EH2qB9C;AG1qBmC;EAAW,kBAAA;EH6qB9C;AG5qBmC;EAAW,kBAAA;EH+qB9C;AG9qBmC;EAAW,kBAAA;EHirB9C;AGhrBmC;EAAW,kBAAA;EHmrB9C;AGlrBmC;EAAW,kBAAA;EHqrB9C;AGprBmC;EAAW,kBAAA;EHurB9C;AGtrBmC;EAAW,kBAAA;EHyrB9C;AGxrBmC;EAAW,kBAAA;EH2rB9C;AG1rBmC;EAAW,kBAAA;EH6rB9C;AG5rBmC;EAAW,kBAAA;EH+rB9C;AG9rBmC;EAAW,kBAAA;EHisB9C;AGhsBmC;EAAW,kBAAA;EHmsB9C;AGlsBmC;EAAW,kBAAA;EHqsB9C;AGpsBmC;EAAW,kBAAA;EHusB9C;AGtsBmC;EAAW,kBAAA;EHysB9C;AGxsBmC;EAAW,kBAAA;EH2sB9C;AG1sBmC;EAAW,kBAAA;EH6sB9C;AG5sBmC;EAAW,kBAAA;EH+sB9C;AG9sBmC;EAAW,kBAAA;EHitB9C;AGhtBmC;EAAW,kBAAA;EHmtB9C;AGltBmC;EAAW,kBAAA;EHqtB9C;AGptBmC;EAAW,kBAAA;EHutB9C;AGttBmC;EAAW,kBAAA;EHytB9C;AGxtBmC;EAAW,kBAAA;EH2tB9C;AG1tBmC;EAAW,kBAAA;EH6tB9C;AG5tBmC;EAAW,kBAAA;EH+tB9C;AG9tBmC;EAAW,kBAAA;EHiuB9C;AGhuBmC;EAAW,kBAAA;EHmuB9C;AGluBmC;EAAW,kBAAA;EHquB9C;AGpuBmC;EAAW,kBAAA;EHuuB9C;AGtuBmC;EAAW,kBAAA;EHyuB9C;AGxuBmC;EAAW,kBAAA;EH2uB9C;AG1uBmC;EAAW,kBAAA;EH6uB9C;AG5uBmC;EAAW,kBAAA;EH+uB9C;AG9uBmC;EAAW,kBAAA;EHivB9C;AIvhCD;ECgEE,gCAAA;EACG,6BAAA;EACK,wBAAA;EL09BT;AIzhCD;;EC6DE,gCAAA;EACG,6BAAA;EACK,wBAAA;ELg+BT;AIvhCD;EACE,iBAAA;EACA,+CAAA;EJyhCD;AIthCD;EACE,6DAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,2BAAA;EJwhCD;AIphCD;;;;EAIE,sBAAA;EACA,oBAAA;EACA,sBAAA;EJshCD;AIhhCD;EACE,gBAAA;EACA,uBAAA;EJkhCD;AIhhCC;;EAEE,gBAAA;EACA,4BAAA;EJkhCH;AI/gCC;EErDA,sBAAA;EAEA,4CAAA;EACA,sBAAA;ENskCD;AIzgCD;EACE,WAAA;EJ2gCD;AIrgCD;EACE,wBAAA;EJugCD;AIngCD;;;;;EGvEE,gBAAA;EACA,iBAAA;EACA,cAAA;EPilCD;AIvgCD;EACE,oBAAA;EJygCD;AIngCD;EACE,cAAA;EACA,yBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;EC6FA,0CAAA;EACK,qCAAA;EACG,kCAAA;EEvLR,uBAAA;EACA,iBAAA;EACA,cAAA;EPimCD;AIngCD;EACE,oBAAA;EJqgCD;AI//BD;EACE,kBAAA;EACA,qBAAA;EACA,WAAA;EACA,+BAAA;EJigCD;AIz/BD;EACE,oBAAA;EACA,YAAA;EACA,aAAA;EACA,cAAA;EACA,YAAA;EACA,kBAAA;EACA,wBAAA;EACA,WAAA;EJ2/BD;AIn/BC;;EAEE,kBAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;EACA,mBAAA;EACA,YAAA;EJq/BH;AIz+BD;EACE,iBAAA;EJ2+BD;AQnoCD;;;;;;;;;;;;EAEE,sBAAA;EACA,kBAAA;EACA,kBAAA;EACA,gBAAA;ER+oCD;AQppCD;;;;;;;;;;;;;;;;;;;;;;;;EASI,qBAAA;EACA,gBAAA;EACA,gBAAA;ERqqCH;AQjqCD;;;;;;EAGE,kBAAA;EACA,qBAAA;ERsqCD;AQ1qCD;;;;;;;;;;;;EAQI,gBAAA;ERgrCH;AQ7qCD;;;;;;EAGE,kBAAA;EACA,qBAAA;ERkrCD;AQtrCD;;;;;;;;;;;;EAQI,gBAAA;ER4rCH;AQxrCD;;EAAU,iBAAA;ER4rCT;AQ3rCD;;EAAU,iBAAA;ER+rCT;AQ9rCD;;EAAU,iBAAA;ERksCT;AQjsCD;;EAAU,iBAAA;ERqsCT;AQpsCD;;EAAU,iBAAA;ERwsCT;AQvsCD;;EAAU,iBAAA;ER2sCT;AQrsCD;EACE,kBAAA;ERusCD;AQpsCD;EACE,qBAAA;EACA,iBAAA;EACA,kBAAA;EACA,kBAAA;ERssCD;AQjsCD;EAAA;IAFI,iBAAA;IRusCD;EACF;AQ/rCD;;EAEE,gBAAA;ERisCD;AQ9rCD;;EAEE,2BAAA;EACA,eAAA;ERgsCD;AQ5rCD;EAAuB,kBAAA;ER+rCtB;AQ9rCD;EAAuB,mBAAA;ERisCtB;AQhsCD;EAAuB,oBAAA;ERmsCtB;AQlsCD;EAAuB,qBAAA;ERqsCtB;AQpsCD;EAAuB,qBAAA;ERusCtB;AQpsCD;EAAuB,2BAAA;ERusCtB;AQtsCD;EAAuB,2BAAA;ERysCtB;AQxsCD;EAAuB,4BAAA;ER2sCtB;AQxsCD;EACE,gBAAA;ER0sCD;AQxsCD;ECrGE,gBAAA;ETgzCD;AS/yCC;EACE,gBAAA;ETizCH;AQ3sCD;ECxGE,gBAAA;ETszCD;ASrzCC;EACE,gBAAA;ETuzCH;AQ9sCD;EC3GE,gBAAA;ET4zCD;AS3zCC;EACE,gBAAA;ET6zCH;AQjtCD;EC9GE,gBAAA;ETk0CD;ASj0CC;EACE,gBAAA;ETm0CH;AQptCD;ECjHE,gBAAA;ETw0CD;ASv0CC;EACE,gBAAA;ETy0CH;AQntCD;EAGE,aAAA;EE3HA,2BAAA;EV+0CD;AU90CC;EACE,2BAAA;EVg1CH;AQptCD;EE9HE,2BAAA;EVq1CD;AUp1CC;EACE,2BAAA;EVs1CH;AQvtCD;EEjIE,2BAAA;EV21CD;AU11CC;EACE,2BAAA;EV41CH;AQ1tCD;EEpIE,2BAAA;EVi2CD;AUh2CC;EACE,2BAAA;EVk2CH;AQ7tCD;EEvIE,2BAAA;EVu2CD;AUt2CC;EACE,2BAAA;EVw2CH;AQ3tCD;EACE,qBAAA;EACA,qBAAA;EACA,kCAAA;ER6tCD;AQrtCD;;EAEE,eAAA;EACA,qBAAA;ERutCD;AQ1tCD;;;;EAMI,kBAAA;ER0tCH;AQntCD;EACE,iBAAA;EACA,kBAAA;ERqtCD;AQjtCD;EALE,iBAAA;EACA,kBAAA;EAMA,mBAAA;ERotCD;AQttCD;EAKI,uBAAA;EACA,mBAAA;EACA,oBAAA;ERotCH;AQ/sCD;EACE,eAAA;EACA,qBAAA;ERitCD;AQ/sCD;;EAEE,yBAAA;ERitCD;AQ/sCD;EACE,mBAAA;ERitCD;AQ/sCD;EACE,gBAAA;ERitCD;AQxrCD;EAAA;IAVM,aAAA;IACA,cAAA;IACA,aAAA;IACA,mBAAA;IGtNJ,kBAAA;IACA,yBAAA;IACA,qBAAA;IX65CC;EQlsCH;IAHM,oBAAA;IRwsCH;EACF;AQ/rCD;;EAGE,cAAA;EACA,mCAAA;ERgsCD;AQ9rCD;EACE,gBAAA;EA9IqB,2BAAA;ER+0CtB;AQ5rCD;EACE,oBAAA;EACA,kBAAA;EACA,mBAAA;EACA,gCAAA;ER8rCD;AQzrCG;;;EACE,kBAAA;ER6rCL;AQvsCD;;;EAmBI,gBAAA;EACA,gBAAA;EACA,yBAAA;EACA,gBAAA;ERyrCH;AQvrCG;;;EACE,wBAAA;ER2rCL;AQnrCD;;EAEE,qBAAA;EACA,iBAAA;EACA,iCAAA;EACA,gBAAA;EACA,mBAAA;ERqrCD;AQ/qCG;;;;;;EAAW,aAAA;ERurCd;AQtrCG;;;;;;EACE,wBAAA;ER6rCL;AQvrCD;EACE,qBAAA;EACA,oBAAA;EACA,yBAAA;ERyrCD;AY/9CD;;;;EAIE,gEAAA;EZi+CD;AY79CD;EACE,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,2BAAA;EACA,oBAAA;EZ+9CD;AY39CD;EACE,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,2BAAA;EACA,oBAAA;EACA,wDAAA;UAAA,gDAAA;EZ69CD;AYn+CD;EASI,YAAA;EACA,iBAAA;EACA,mBAAA;EACA,0BAAA;UAAA,kBAAA;EZ69CH;AYx9CD;EACE,gBAAA;EACA,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,yBAAA;EACA,uBAAA;EACA,uBAAA;EACA,gBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;EZ09CD;AYr+CD;EAeI,YAAA;EACA,oBAAA;EACA,gBAAA;EACA,uBAAA;EACA,+BAAA;EACA,kBAAA;EZy9CH;AYp9CD;EACE,mBAAA;EACA,oBAAA;EZs9CD;AahhDD;ECHE,oBAAA;EACA,mBAAA;EACA,oBAAA;EACA,qBAAA;EdshDD;AahhDC;EAAA;IAFE,cAAA;IbshDD;EACF;AalhDC;EAAA;IAFE,cAAA;IbwhDD;EACF;AaphDD;EAAA;IAFI,eAAA;Ib0hDD;EACF;AajhDD;ECvBE,oBAAA;EACA,mBAAA;EACA,oBAAA;EACA,qBAAA;Ed2iDD;Aa9gDD;ECvBE,oBAAA;EACA,qBAAA;EdwiDD;AexiDG;EACE,oBAAA;EAEA,iBAAA;EAEA,oBAAA;EACA,qBAAA;EfwiDL;AexhDG;EACE,aAAA;Ef0hDL;AenhDC;EACE,aAAA;EfqhDH;AethDC;EACE,qBAAA;EfwhDH;AezhDC;EACE,qBAAA;Ef2hDH;Ae5hDC;EACE,YAAA;Ef8hDH;Ae/hDC;EACE,qBAAA;EfiiDH;AeliDC;EACE,qBAAA;EfoiDH;AeriDC;EACE,YAAA;EfuiDH;AexiDC;EACE,qBAAA;Ef0iDH;Ae3iDC;EACE,qBAAA;Ef6iDH;Ae9iDC;EACE,YAAA;EfgjDH;AejjDC;EACE,qBAAA;EfmjDH;AepjDC;EACE,oBAAA;EfsjDH;AexiDC;EACE,aAAA;Ef0iDH;Ae3iDC;EACE,qBAAA;Ef6iDH;Ae9iDC;EACE,qBAAA;EfgjDH;AejjDC;EACE,YAAA;EfmjDH;AepjDC;EACE,qBAAA;EfsjDH;AevjDC;EACE,qBAAA;EfyjDH;Ae1jDC;EACE,YAAA;Ef4jDH;Ae7jDC;EACE,qBAAA;Ef+jDH;AehkDC;EACE,qBAAA;EfkkDH;AenkDC;EACE,YAAA;EfqkDH;AetkDC;EACE,qBAAA;EfwkDH;AezkDC;EACE,oBAAA;Ef2kDH;AevkDC;EACE,aAAA;EfykDH;AezlDC;EACE,YAAA;Ef2lDH;Ae5lDC;EACE,oBAAA;Ef8lDH;Ae/lDC;EACE,oBAAA;EfimDH;AelmDC;EACE,WAAA;EfomDH;AermDC;EACE,oBAAA;EfumDH;AexmDC;EACE,oBAAA;Ef0mDH;Ae3mDC;EACE,WAAA;Ef6mDH;Ae9mDC;EACE,oBAAA;EfgnDH;AejnDC;EACE,oBAAA;EfmnDH;AepnDC;EACE,WAAA;EfsnDH;AevnDC;EACE,oBAAA;EfynDH;Ae1nDC;EACE,mBAAA;Ef4nDH;AexnDC;EACE,YAAA;Ef0nDH;Ae5mDC;EACE,mBAAA;Ef8mDH;Ae/mDC;EACE,2BAAA;EfinDH;AelnDC;EACE,2BAAA;EfonDH;AernDC;EACE,kBAAA;EfunDH;AexnDC;EACE,2BAAA;Ef0nDH;Ae3nDC;EACE,2BAAA;Ef6nDH;Ae9nDC;EACE,kBAAA;EfgoDH;AejoDC;EACE,2BAAA;EfmoDH;AepoDC;EACE,2BAAA;EfsoDH;AevoDC;EACE,kBAAA;EfyoDH;Ae1oDC;EACE,2BAAA;Ef4oDH;Ae7oDC;EACE,0BAAA;Ef+oDH;AehpDC;EACE,iBAAA;EfkpDH;AalpDD;EElCI;IACE,aAAA;IfurDH;EehrDD;IACE,aAAA;IfkrDD;EenrDD;IACE,qBAAA;IfqrDD;EetrDD;IACE,qBAAA;IfwrDD;EezrDD;IACE,YAAA;If2rDD;Ee5rDD;IACE,qBAAA;If8rDD;Ee/rDD;IACE,qBAAA;IfisDD;EelsDD;IACE,YAAA;IfosDD;EersDD;IACE,qBAAA;IfusDD;EexsDD;IACE,qBAAA;If0sDD;Ee3sDD;IACE,YAAA;If6sDD;Ee9sDD;IACE,qBAAA;IfgtDD;EejtDD;IACE,oBAAA;IfmtDD;EersDD;IACE,aAAA;IfusDD;EexsDD;IACE,qBAAA;If0sDD;Ee3sDD;IACE,qBAAA;If6sDD;Ee9sDD;IACE,YAAA;IfgtDD;EejtDD;IACE,qBAAA;IfmtDD;EeptDD;IACE,qBAAA;IfstDD;EevtDD;IACE,YAAA;IfytDD;Ee1tDD;IACE,qBAAA;If4tDD;Ee7tDD;IACE,qBAAA;If+tDD;EehuDD;IACE,YAAA;IfkuDD;EenuDD;IACE,qBAAA;IfquDD;EetuDD;IACE,oBAAA;IfwuDD;EepuDD;IACE,aAAA;IfsuDD;EetvDD;IACE,YAAA;IfwvDD;EezvDD;IACE,oBAAA;If2vDD;Ee5vDD;IACE,oBAAA;If8vDD;Ee/vDD;IACE,WAAA;IfiwDD;EelwDD;IACE,oBAAA;IfowDD;EerwDD;IACE,oBAAA;IfuwDD;EexwDD;IACE,WAAA;If0wDD;Ee3wDD;IACE,oBAAA;If6wDD;Ee9wDD;IACE,oBAAA;IfgxDD;EejxDD;IACE,WAAA;IfmxDD;EepxDD;IACE,oBAAA;IfsxDD;EevxDD;IACE,mBAAA;IfyxDD;EerxDD;IACE,YAAA;IfuxDD;EezwDD;IACE,mBAAA;If2wDD;Ee5wDD;IACE,2BAAA;If8wDD;Ee/wDD;IACE,2BAAA;IfixDD;EelxDD;IACE,kBAAA;IfoxDD;EerxDD;IACE,2BAAA;IfuxDD;EexxDD;IACE,2BAAA;If0xDD;Ee3xDD;IACE,kBAAA;If6xDD;Ee9xDD;IACE,2BAAA;IfgyDD;EejyDD;IACE,2BAAA;IfmyDD;EepyDD;IACE,kBAAA;IfsyDD;EevyDD;IACE,2BAAA;IfyyDD;Ee1yDD;IACE,0BAAA;If4yDD;Ee7yDD;IACE,iBAAA;If+yDD;EACF;AavyDD;EE3CI;IACE,aAAA;Ifq1DH;Ee90DD;IACE,aAAA;Ifg1DD;Eej1DD;IACE,qBAAA;Ifm1DD;Eep1DD;IACE,qBAAA;Ifs1DD;Eev1DD;IACE,YAAA;Ify1DD;Ee11DD;IACE,qBAAA;If41DD;Ee71DD;IACE,qBAAA;If+1DD;Eeh2DD;IACE,YAAA;Ifk2DD;Een2DD;IACE,qBAAA;Ifq2DD;Eet2DD;IACE,qBAAA;Ifw2DD;Eez2DD;IACE,YAAA;If22DD;Ee52DD;IACE,qBAAA;If82DD;Ee/2DD;IACE,oBAAA;Ifi3DD;Een2DD;IACE,aAAA;Ifq2DD;Eet2DD;IACE,qBAAA;Ifw2DD;Eez2DD;IACE,qBAAA;If22DD;Ee52DD;IACE,YAAA;If82DD;Ee/2DD;IACE,qBAAA;Ifi3DD;Eel3DD;IACE,qBAAA;Ifo3DD;Eer3DD;IACE,YAAA;Ifu3DD;Eex3DD;IACE,qBAAA;If03DD;Ee33DD;IACE,qBAAA;If63DD;Ee93DD;IACE,YAAA;Ifg4DD;Eej4DD;IACE,qBAAA;Ifm4DD;Eep4DD;IACE,oBAAA;Ifs4DD;Eel4DD;IACE,aAAA;Ifo4DD;Eep5DD;IACE,YAAA;Ifs5DD;Eev5DD;IACE,oBAAA;Ify5DD;Ee15DD;IACE,oBAAA;If45DD;Ee75DD;IACE,WAAA;If+5DD;Eeh6DD;IACE,oBAAA;Ifk6DD;Een6DD;IACE,oBAAA;Ifq6DD;Eet6DD;IACE,WAAA;Ifw6DD;Eez6DD;IACE,oBAAA;If26DD;Ee56DD;IACE,oBAAA;If86DD;Ee/6DD;IACE,WAAA;Ifi7DD;Eel7DD;IACE,oBAAA;Ifo7DD;Eer7DD;IACE,mBAAA;Ifu7DD;Een7DD;IACE,YAAA;Ifq7DD;Eev6DD;IACE,mBAAA;Ify6DD;Ee16DD;IACE,2BAAA;If46DD;Ee76DD;IACE,2BAAA;If+6DD;Eeh7DD;IACE,kBAAA;Ifk7DD;Een7DD;IACE,2BAAA;Ifq7DD;Eet7DD;IACE,2BAAA;Ifw7DD;Eez7DD;IACE,kBAAA;If27DD;Ee57DD;IACE,2BAAA;If87DD;Ee/7DD;IACE,2BAAA;Ifi8DD;Eel8DD;IACE,kBAAA;Ifo8DD;Eer8DD;IACE,2BAAA;Ifu8DD;Eex8DD;IACE,0BAAA;If08DD;Ee38DD;IACE,iBAAA;If68DD;EACF;Aal8DD;EE9CI;IACE,aAAA;Ifm/DH;Ee5+DD;IACE,aAAA;If8+DD;Ee/+DD;IACE,qBAAA;Ifi/DD;Eel/DD;IACE,qBAAA;Ifo/DD;Eer/DD;IACE,YAAA;Ifu/DD;Eex/DD;IACE,qBAAA;If0/DD;Ee3/DD;IACE,qBAAA;If6/DD;Ee9/DD;IACE,YAAA;IfggED;EejgED;IACE,qBAAA;IfmgED;EepgED;IACE,qBAAA;IfsgED;EevgED;IACE,YAAA;IfygED;Ee1gED;IACE,qBAAA;If4gED;Ee7gED;IACE,oBAAA;If+gED;EejgED;IACE,aAAA;IfmgED;EepgED;IACE,qBAAA;IfsgED;EevgED;IACE,qBAAA;IfygED;Ee1gED;IACE,YAAA;If4gED;Ee7gED;IACE,qBAAA;If+gED;EehhED;IACE,qBAAA;IfkhED;EenhED;IACE,YAAA;IfqhED;EethED;IACE,qBAAA;IfwhED;EezhED;IACE,qBAAA;If2hED;Ee5hED;IACE,YAAA;If8hED;Ee/hED;IACE,qBAAA;IfiiED;EeliED;IACE,oBAAA;IfoiED;EehiED;IACE,aAAA;IfkiED;EeljED;IACE,YAAA;IfojED;EerjED;IACE,oBAAA;IfujED;EexjED;IACE,oBAAA;If0jED;Ee3jED;IACE,WAAA;If6jED;Ee9jED;IACE,oBAAA;IfgkED;EejkED;IACE,oBAAA;IfmkED;EepkED;IACE,WAAA;IfskED;EevkED;IACE,oBAAA;IfykED;Ee1kED;IACE,oBAAA;If4kED;Ee7kED;IACE,WAAA;If+kED;EehlED;IACE,oBAAA;IfklED;EenlED;IACE,mBAAA;IfqlED;EejlED;IACE,YAAA;IfmlED;EerkED;IACE,mBAAA;IfukED;EexkED;IACE,2BAAA;If0kED;Ee3kED;IACE,2BAAA;If6kED;Ee9kED;IACE,kBAAA;IfglED;EejlED;IACE,2BAAA;IfmlED;EeplED;IACE,2BAAA;IfslED;EevlED;IACE,kBAAA;IfylED;Ee1lED;IACE,2BAAA;If4lED;Ee7lED;IACE,2BAAA;If+lED;EehmED;IACE,kBAAA;IfkmED;EenmED;IACE,2BAAA;IfqmED;EetmED;IACE,0BAAA;IfwmED;EezmED;IACE,iBAAA;If2mED;EACF;AgB/qED;EACE,+BAAA;EhBirED;AgB/qED;EACE,kBAAA;EACA,qBAAA;EACA,gBAAA;EACA,kBAAA;EhBirED;AgB/qED;EACE,kBAAA;EhBirED;AgB3qED;EACE,aAAA;EACA,iBAAA;EACA,qBAAA;EhB6qED;AgBhrED;;;;;;EAWQ,cAAA;EACA,yBAAA;EACA,qBAAA;EACA,+BAAA;EhB6qEP;AgB3rED;EAoBI,wBAAA;EACA,kCAAA;EhB0qEH;AgB/rED;;;;;;EA8BQ,eAAA;EhByqEP;AgBvsED;EAoCI,+BAAA;EhBsqEH;AgB1sED;EAyCI,2BAAA;EhBoqEH;AgB7pED;;;;;;EAOQ,cAAA;EhB8pEP;AgBnpED;EACE,2BAAA;EhBqpED;AgBtpED;;;;;;EAQQ,2BAAA;EhBspEP;AgB9pED;;EAeM,0BAAA;EhBmpEL;AgBzoED;EAEI,2BAAA;EhB0oEH;AgBjoED;EAEI,2BAAA;EhBkoEH;AgBznED;EACE,kBAAA;EACA,aAAA;EACA,uBAAA;EhB2nED;AgBtnEG;;EACE,kBAAA;EACA,aAAA;EACA,qBAAA;EhBynEL;AiBrwEC;;;;;;;;;;;;EAOI,2BAAA;EjB4wEL;AiBtwEC;;;;;EAMI,2BAAA;EjBuwEL;AiB1xEC;;;;;;;;;;;;EAOI,2BAAA;EjBiyEL;AiB3xEC;;;;;EAMI,2BAAA;EjB4xEL;AiB/yEC;;;;;;;;;;;;EAOI,2BAAA;EjBszEL;AiBhzEC;;;;;EAMI,2BAAA;EjBizEL;AiBp0EC;;;;;;;;;;;;EAOI,2BAAA;EjB20EL;AiBr0EC;;;;;EAMI,2BAAA;EjBs0EL;AiBz1EC;;;;;;;;;;;;EAOI,2BAAA;EjBg2EL;AiB11EC;;;;;EAMI,2BAAA;EjB21EL;AgBzsED;EACE,kBAAA;EACA,mBAAA;EhB2sED;AgB9oED;EAAA;IA1DI,aAAA;IACA,qBAAA;IACA,oBAAA;IACA,8CAAA;IACA,2BAAA;IhB4sED;EgBtpEH;IAlDM,kBAAA;IhB2sEH;EgBzpEH;;;;;;IAzCY,qBAAA;IhB0sET;EgBjqEH;IAjCM,WAAA;IhBqsEH;EgBpqEH;;;;;;IAxBY,gBAAA;IhBosET;EgB5qEH;;;;;;IApBY,iBAAA;IhBwsET;EgBprEH;;;;IAPY,kBAAA;IhBisET;EACF;AkB35ED;EACE,YAAA;EACA,WAAA;EACA,WAAA;EAIA,cAAA;ElB05ED;AkBv5ED;EACE,gBAAA;EACA,aAAA;EACA,YAAA;EACA,qBAAA;EACA,iBAAA;EACA,sBAAA;EACA,gBAAA;EACA,WAAA;EACA,kCAAA;ElBy5ED;AkBt5ED;EACE,uBAAA;EACA,iBAAA;EACA,oBAAA;EACA,mBAAA;ElBw5ED;AkB74ED;Eb4BE,gCAAA;EACG,6BAAA;EACK,wBAAA;ELo3ET;AkB74ED;;EAEE,iBAAA;EACA,oBAAA;EACA,qBAAA;ElB+4ED;AkB34ED;EACE,gBAAA;ElB64ED;AkBz4ED;EACE,gBAAA;EACA,aAAA;ElB24ED;AkBv4ED;;EAEE,cAAA;ElBy4ED;AkBr4ED;;;EZxEE,sBAAA;EAEA,4CAAA;EACA,sBAAA;ENi9ED;AkBr4ED;EACE,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;ElBu4ED;AkB72ED;EACE,gBAAA;EACA,aAAA;EACA,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,2BAAA;EACA,wBAAA;EACA,2BAAA;EACA,oBAAA;EbzDA,0DAAA;EACQ,kDAAA;EAyHR,wFAAA;EACK,2EAAA;EACG,wEAAA;ELizET;AmBz7EC;EACE,uBAAA;EACA,YAAA;EdUF,wFAAA;EACQ,gFAAA;ELk7ET;AKj5EC;EACE,gBAAA;EACA,YAAA;ELm5EH;AKj5EC;EAA0B,gBAAA;ELo5E3B;AKn5EC;EAAgC,gBAAA;ELs5EjC;AkBr3EC;;;EAGE,2BAAA;EACA,YAAA;ElBu3EH;AkBp3EC;;EAEE,qBAAA;ElBs3EH;AkBl3EC;EACE,cAAA;ElBo3EH;AkBx2ED;EACE,0BAAA;ElB02ED;AkBt0ED;EAxBE;;;;IAIE,mBAAA;IlBi2ED;EkB/1EC;;;;;;;;IAEE,mBAAA;IlBu2EH;EkBp2EC;;;;;;;;IAEE,mBAAA;IlB42EH;EACF;AkBl2ED;EACE,qBAAA;ElBo2ED;AkB51ED;;EAEE,oBAAA;EACA,gBAAA;EACA,kBAAA;EACA,qBAAA;ElB81ED;AkBn2ED;;EAQI,kBAAA;EACA,oBAAA;EACA,kBAAA;EACA,qBAAA;EACA,iBAAA;ElB+1EH;AkB51ED;;;;EAIE,oBAAA;EACA,oBAAA;EACA,oBAAA;ElB81ED;AkB31ED;;EAEE,kBAAA;ElB61ED;AkBz1ED;;EAEE,oBAAA;EACA,uBAAA;EACA,oBAAA;EACA,kBAAA;EACA,wBAAA;EACA,qBAAA;EACA,iBAAA;ElB21ED;AkBz1ED;;EAEE,eAAA;EACA,mBAAA;ElB21ED;AkBl1EC;;;;;;EAGE,qBAAA;ElBu1EH;AkBj1EC;;;;EAEE,qBAAA;ElBq1EH;AkB/0EC;;;;EAGI,qBAAA;ElBk1EL;AkBv0ED;EAEE,kBAAA;EACA,qBAAA;EAEA,kBAAA;EACA,kBAAA;ElBu0ED;AkBr0EC;;EAEE,iBAAA;EACA,kBAAA;ElBu0EH;AkB1zED;EC1PE,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EnBujFD;AmBrjFC;EACE,cAAA;EACA,mBAAA;EnBujFH;AmBpjFC;;EAEE,cAAA;EnBsjFH;AkBt0ED;EC7PE,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EnBskFD;AmBpkFC;EACE,cAAA;EACA,mBAAA;EnBskFH;AmBnkFC;;EAEE,cAAA;EnBqkFH;AkBr1ED;EAKI,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,kBAAA;ElBm1EH;AkB/0ED;EC1QE,cAAA;EACA,oBAAA;EACA,iBAAA;EACA,wBAAA;EACA,oBAAA;EnB4lFD;AmB1lFC;EACE,cAAA;EACA,mBAAA;EnB4lFH;AmBzlFC;;EAEE,cAAA;EnB2lFH;AkB31ED;EC7QE,cAAA;EACA,oBAAA;EACA,iBAAA;EACA,wBAAA;EACA,oBAAA;EnB2mFD;AmBzmFC;EACE,cAAA;EACA,mBAAA;EnB2mFH;AmBxmFC;;EAEE,cAAA;EnB0mFH;AkB12ED;EAKI,cAAA;EACA,oBAAA;EACA,iBAAA;EACA,wBAAA;EACA,kBAAA;ElBw2EH;AkB/1ED;EAEE,oBAAA;ElBg2ED;AkBl2ED;EAMI,uBAAA;ElB+1EH;AkB31ED;EACE,oBAAA;EACA,QAAA;EACA,UAAA;EACA,YAAA;EACA,gBAAA;EACA,aAAA;EACA,cAAA;EACA,mBAAA;EACA,oBAAA;EACA,sBAAA;ElB61ED;AkB31ED;EACE,aAAA;EACA,cAAA;EACA,mBAAA;ElB61ED;AkB31ED;EACE,aAAA;EACA,cAAA;EACA,mBAAA;ElB61ED;AkBz1ED;;;;;;;;;;ECrXI,gBAAA;EnB0tFH;AkBr2ED;ECjXI,uBAAA;Ed+CF,0DAAA;EACQ,kDAAA;EL2qFT;AmBztFG;EACE,uBAAA;Ed4CJ,2EAAA;EACQ,mEAAA;ELgrFT;AkB/2ED;ECvWI,gBAAA;EACA,uBAAA;EACA,2BAAA;EnBytFH;AkBp3ED;ECjWI,gBAAA;EnBwtFH;AkBp3ED;;;;;;;;;;ECxXI,gBAAA;EnBwvFH;AkBh4ED;ECpXI,uBAAA;Ed+CF,0DAAA;EACQ,kDAAA;ELysFT;AmBvvFG;EACE,uBAAA;Ed4CJ,2EAAA;EACQ,mEAAA;EL8sFT;AkB14ED;EC1WI,gBAAA;EACA,uBAAA;EACA,2BAAA;EnBuvFH;AkB/4ED;ECpWI,gBAAA;EnBsvFH;AkB/4ED;;;;;;;;;;EC3XI,gBAAA;EnBsxFH;AkB35ED;ECvXI,uBAAA;Ed+CF,0DAAA;EACQ,kDAAA;ELuuFT;AmBrxFG;EACE,uBAAA;Ed4CJ,2EAAA;EACQ,mEAAA;EL4uFT;AkBr6ED;EC7WI,gBAAA;EACA,uBAAA;EACA,2BAAA;EnBqxFH;AkB16ED;ECvWI,gBAAA;EnBoxFH;AkBt6EC;EACG,WAAA;ElBw6EJ;AkBt6EC;EACG,QAAA;ElBw6EJ;AkB95ED;EACE,gBAAA;EACA,iBAAA;EACA,qBAAA;EACA,gBAAA;ElBg6ED;AkB70ED;EAAA;IA9DM,uBAAA;IACA,kBAAA;IACA,wBAAA;IlB+4EH;EkBn1EH;IAvDM,uBAAA;IACA,aAAA;IACA,wBAAA;IlB64EH;EkBx1EH;IAhDM,uBAAA;IlB24EH;EkB31EH;IA5CM,uBAAA;IACA,wBAAA;IlB04EH;EkB/1EH;;;IAtCQ,aAAA;IlB04EL;EkBp2EH;IAhCM,aAAA;IlBu4EH;EkBv2EH;IA5BM,kBAAA;IACA,wBAAA;IlBs4EH;EkB32EH;;IApBM,uBAAA;IACA,eAAA;IACA,kBAAA;IACA,wBAAA;IlBm4EH;EkBl3EH;;IAdQ,iBAAA;IlBo4EL;EkBt3EH;;IATM,oBAAA;IACA,gBAAA;IlBm4EH;EkB33EH;IAHM,QAAA;IlBi4EH;EACF;AkBv3ED;;;;EASI,eAAA;EACA,kBAAA;EACA,kBAAA;ElBo3EH;AkB/3ED;;EAiBI,kBAAA;ElBk3EH;AkBn4ED;EJjfE,oBAAA;EACA,qBAAA;Edu3FD;AkBh2EC;EAAA;IAVI,mBAAA;IACA,kBAAA;IACA,kBAAA;IlB82EH;EACF;AkB94ED;EAwCI,aAAA;ElBy2EH;AkB51EC;EAAA;IAHM,0BAAA;IlBm2EL;EACF;AkB11EC;EAAA;IAHM,kBAAA;IlBi2EL;EACF;AoBn5FD;EACE,uBAAA;EACA,kBAAA;EACA,qBAAA;EACA,oBAAA;EACA,wBAAA;EACA,gCAAA;MAAA,4BAAA;EACA,iBAAA;EACA,wBAAA;EACA,+BAAA;EACA,qBAAA;EC6BA,mBAAA;EACA,iBAAA;EACA,yBAAA;EACA,oBAAA;EhB4KA,2BAAA;EACG,wBAAA;EACC,uBAAA;EACI,mBAAA;EL8sFT;AoBt5FG;;;;;;EdrBF,sBAAA;EAEA,4CAAA;EACA,sBAAA;ENk7FD;AoB15FC;;;EAGE,gBAAA;EACA,uBAAA;EpB45FH;AoBz5FC;;EAEE,YAAA;EACA,wBAAA;Ef2BF,0DAAA;EACQ,kDAAA;ELi4FT;AoBz5FC;;;EAGE,qBAAA;EACA,sBAAA;EE9CF,eAAA;EAGA,2BAAA;EjB8DA,0BAAA;EACQ,kBAAA;EL24FT;AoBr5FD;ECrDE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErB68FD;AqB38FC;;;;;;EAME,gBAAA;EACA,2BAAA;EACI,uBAAA;ErB68FP;AqB38FC;;;EAGE,wBAAA;ErB68FH;AqBx8FG;;;;;;;;;;;;;;;;;;EAME,2BAAA;EACI,uBAAA;ErBs9FT;AoB97FD;ECnBI,gBAAA;EACA,2BAAA;ErBo9FH;AoB/7FD;ECxDE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErB0/FD;AqBx/FC;;;;;;EAME,gBAAA;EACA,2BAAA;EACI,uBAAA;ErB0/FP;AqBx/FC;;;EAGE,wBAAA;ErB0/FH;AqBr/FG;;;;;;;;;;;;;;;;;;EAME,2BAAA;EACI,uBAAA;ErBmgGT;AoBx+FD;ECtBI,gBAAA;EACA,2BAAA;ErBigGH;AoBx+FD;EC5DE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErBuiGD;AqBriGC;;;;;;EAME,gBAAA;EACA,2BAAA;EACI,uBAAA;ErBuiGP;AqBriGC;;;EAGE,wBAAA;ErBuiGH;AqBliGG;;;;;;;;;;;;;;;;;;EAME,2BAAA;EACI,uBAAA;ErBgjGT;AoBjhGD;EC1BI,gBAAA;EACA,2BAAA;ErB8iGH;AoBjhGD;EChEE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErBolGD;AqBllGC;;;;;;EAME,gBAAA;EACA,2BAAA;EACI,uBAAA;ErBolGP;AqBllGC;;;EAGE,wBAAA;ErBolGH;AqB/kGG;;;;;;;;;;;;;;;;;;EAME,2BAAA;EACI,uBAAA;ErB6lGT;AoB1jGD;EC9BI,gBAAA;EACA,2BAAA;ErB2lGH;AoB1jGD;ECpEE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErBioGD;AqB/nGC;;;;;;EAME,gBAAA;EACA,2BAAA;EACI,uBAAA;ErBioGP;AqB/nGC;;;EAGE,wBAAA;ErBioGH;AqB5nGG;;;;;;;;;;;;;;;;;;EAME,2BAAA;EACI,uBAAA;ErB0oGT;AoBnmGD;EClCI,gBAAA;EACA,2BAAA;ErBwoGH;AoBnmGD;ECxEE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErB8qGD;AqB5qGC;;;;;;EAME,gBAAA;EACA,2BAAA;EACI,uBAAA;ErB8qGP;AqB5qGC;;;EAGE,wBAAA;ErB8qGH;AqBzqGG;;;;;;;;;;;;;;;;;;EAME,2BAAA;EACI,uBAAA;ErBurGT;AoB5oGD;ECtCI,gBAAA;EACA,2BAAA;ErBqrGH;AoBvoGD;EACE,gBAAA;EACA,qBAAA;EACA,kBAAA;EpByoGD;AoBvoGC;;;;;EAKE,+BAAA;Ef7BF,0BAAA;EACQ,kBAAA;ELuqGT;AoBxoGC;;;;EAIE,2BAAA;EpB0oGH;AoBxoGC;;EAEE,gBAAA;EACA,4BAAA;EACA,+BAAA;EpB0oGH;AoBtoGG;;;;EAEE,gBAAA;EACA,uBAAA;EpB0oGL;AoBjoGD;;EC/EE,oBAAA;EACA,iBAAA;EACA,wBAAA;EACA,oBAAA;ErBotGD;AoBpoGD;;ECnFE,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;ErB2tGD;AoBvoGD;;ECvFE,kBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;ErBkuGD;AoBtoGD;EACE,gBAAA;EACA,aAAA;EpBwoGD;AoBpoGD;EACE,iBAAA;EpBsoGD;AoB/nGC;;;EACE,aAAA;EpBmoGH;AuBvxGD;EACE,YAAA;ElBoLA,0CAAA;EACK,qCAAA;EACG,kCAAA;ELsmGT;AuB1xGC;EACE,YAAA;EvB4xGH;AuBxxGD;EACE,eAAA;EvB0xGD;AuBxxGC;EAAY,gBAAA;EvB2xGb;AuB1xGC;EAAY,oBAAA;EvB6xGb;AuB5xGC;EAAY,0BAAA;EvB+xGb;AuB5xGD;EACE,oBAAA;EACA,WAAA;EACA,kBAAA;ElBuKA,iDAAA;EACQ,4CAAA;KAAA,yCAAA;EAOR,oCAAA;EACQ,+BAAA;KAAA,4BAAA;EAGR,0CAAA;EACQ,qCAAA;KAAA,kCAAA;ELgnGT;AwB1zGD;EACE,uBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,wBAAA;EACA,wBAAA;EACA,qCAAA;EACA,oCAAA;ExB4zGD;AwBxzGD;;EAEE,oBAAA;ExB0zGD;AwBtzGD;EACE,YAAA;ExBwzGD;AwBpzGD;EACE,oBAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA,eAAA;EACA,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;EACA,kBAAA;EACA,2BAAA;EACA,2BAAA;EACA,uCAAA;EACA,oBAAA;EnBuBA,qDAAA;EACQ,6CAAA;EmBtBR,sCAAA;UAAA,8BAAA;ExBuzGD;AwBlzGC;EACE,UAAA;EACA,YAAA;ExBozGH;AwB70GD;ECxBE,aAAA;EACA,eAAA;EACA,kBAAA;EACA,2BAAA;EzBw2GD;AwBn1GD;EAmCI,gBAAA;EACA,mBAAA;EACA,aAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;EACA,qBAAA;ExBmzGH;AwB7yGC;;EAEE,uBAAA;EACA,gBAAA;EACA,2BAAA;ExB+yGH;AwBzyGC;;;EAGE,gBAAA;EACA,uBAAA;EACA,YAAA;EACA,2BAAA;ExB2yGH;AwBlyGC;;;EAGE,gBAAA;ExBoyGH;AwBhyGC;;EAEE,uBAAA;EACA,+BAAA;EACA,wBAAA;EE1GF,qEAAA;EF4GE,qBAAA;ExBkyGH;AwB7xGD;EAGI,gBAAA;ExB6xGH;AwBhyGD;EAQI,YAAA;ExB2xGH;AwBnxGD;EACE,YAAA;EACA,UAAA;ExBqxGD;AwB7wGD;EACE,SAAA;EACA,aAAA;ExB+wGD;AwB3wGD;EACE,gBAAA;EACA,mBAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,qBAAA;ExB6wGD;AwBzwGD;EACE,iBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,QAAA;EACA,cAAA;ExB2wGD;AwBvwGD;EACE,UAAA;EACA,YAAA;ExBywGD;AwBjwGD;;EAII,eAAA;EACA,0BAAA;EACA,aAAA;ExBiwGH;AwBvwGD;;EAUI,WAAA;EACA,cAAA;EACA,oBAAA;ExBiwGH;AwB5uGD;EAXE;IAnEA,YAAA;IACA,UAAA;IxB8zGC;EwB5vGD;IAzDA,SAAA;IACA,aAAA;IxBwzGC;EACF;A2Bv8GD;;EAEE,oBAAA;EACA,uBAAA;EACA,wBAAA;E3By8GD;A2B78GD;;EAMI,oBAAA;EACA,aAAA;E3B28GH;A2Bz8GG;;;;;;;;EAIE,YAAA;E3B+8GL;A2Bz8GD;;;;EAKI,mBAAA;E3B08GH;A2Br8GD;EACE,mBAAA;E3Bu8GD;A2Bx8GD;;EAMI,aAAA;E3Bs8GH;A2B58GD;;;EAWI,kBAAA;E3Bs8GH;A2Bl8GD;EACE,kBAAA;E3Bo8GD;A2Bh8GD;EACE,gBAAA;E3Bk8GD;A2Bj8GC;ECjDA,+BAAA;EACG,4BAAA;E5Bq/GJ;A2Bh8GD;;EC9CE,8BAAA;EACG,2BAAA;E5Bk/GJ;A2B/7GD;EACE,aAAA;E3Bi8GD;A2B/7GD;EACE,kBAAA;E3Bi8GD;A2B/7GD;;EClEE,+BAAA;EACG,4BAAA;E5BqgHJ;A2B97GD;EChEE,8BAAA;EACG,2BAAA;E5BigHJ;A2B77GD;;EAEE,YAAA;E3B+7GD;A2B96GD;EACE,mBAAA;EACA,oBAAA;E3Bg7GD;A2B96GD;EACE,oBAAA;EACA,qBAAA;E3Bg7GD;A2B36GD;EtB9CE,0DAAA;EACQ,kDAAA;EL49GT;A2B36GC;EtBlDA,0BAAA;EACQ,kBAAA;ELg+GT;A2Bx6GD;EACE,gBAAA;E3B06GD;A2Bv6GD;EACE,yBAAA;EACA,wBAAA;E3By6GD;A2Bt6GD;EACE,yBAAA;E3Bw6GD;A2Bj6GD;;;EAII,gBAAA;EACA,aAAA;EACA,aAAA;EACA,iBAAA;E3Bk6GH;A2Bz6GD;EAcM,aAAA;E3B85GL;A2B56GD;;;;EAsBI,kBAAA;EACA,gBAAA;E3B45GH;A2Bv5GC;EACE,kBAAA;E3By5GH;A2Bv5GC;EACE,8BAAA;ECnKF,+BAAA;EACC,8BAAA;E5B6jHF;A2Bx5GC;EACE,gCAAA;EC/KF,4BAAA;EACC,2BAAA;E5B0kHF;A2Bx5GD;EACE,kBAAA;E3B05GD;A2Bx5GD;;EC9KE,+BAAA;EACC,8BAAA;E5B0kHF;A2Bv5GD;EC5LE,4BAAA;EACC,2BAAA;E5BslHF;A2Bn5GD;EACE,gBAAA;EACA,aAAA;EACA,qBAAA;EACA,2BAAA;E3Bq5GD;A2Bz5GD;;EAOI,aAAA;EACA,qBAAA;EACA,WAAA;E3Bs5GH;A2B/5GD;EAYI,aAAA;E3Bs5GH;A2Bl6GD;EAgBI,YAAA;E3Bq5GH;A2Bp4GD;;;;EAKM,oBAAA;EACA,wBAAA;EACA,sBAAA;E3Bq4GL;A6B9mHD;EACE,oBAAA;EACA,gBAAA;EACA,2BAAA;E7BgnHD;A6B7mHC;EACE,aAAA;EACA,iBAAA;EACA,kBAAA;E7B+mHH;A6BxnHD;EAeI,oBAAA;EACA,YAAA;EAKA,aAAA;EAEA,aAAA;EACA,kBAAA;E7BumHH;A6B9lHD;;;EV8BE,cAAA;EACA,oBAAA;EACA,iBAAA;EACA,wBAAA;EACA,oBAAA;EnBqkHD;AmBnkHC;;;EACE,cAAA;EACA,mBAAA;EnBukHH;AmBpkHC;;;;;;EAEE,cAAA;EnB0kHH;A6BhnHD;;;EVyBE,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EnB4lHD;AmB1lHC;;;EACE,cAAA;EACA,mBAAA;EnB8lHH;AmB3lHC;;;;;;EAEE,cAAA;EnBimHH;A6B9nHD;;;EAGE,qBAAA;E7BgoHD;A6B9nHC;;;EACE,kBAAA;E7BkoHH;A6B9nHD;;EAEE,WAAA;EACA,qBAAA;EACA,wBAAA;E7BgoHD;A6B3nHD;EACE,mBAAA;EACA,iBAAA;EACA,qBAAA;EACA,gBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;E7B6nHD;A6B1nHC;EACE,mBAAA;EACA,iBAAA;EACA,oBAAA;E7B4nHH;A6B1nHC;EACE,oBAAA;EACA,iBAAA;EACA,oBAAA;E7B4nHH;A6BhpHD;;EA0BI,eAAA;E7B0nHH;A6BrnHD;;;;;;;EDhGE,+BAAA;EACG,4BAAA;E5B8tHJ;A6BtnHD;EACE,iBAAA;E7BwnHD;A6BtnHD;;;;;;;EDpGE,8BAAA;EACG,2BAAA;E5BmuHJ;A6BvnHD;EACE,gBAAA;E7BynHD;A6BpnHD;EACE,oBAAA;EAGA,cAAA;EACA,qBAAA;E7BonHD;A6BznHD;EAUI,oBAAA;E7BknHH;A6B5nHD;EAYM,mBAAA;E7BmnHL;A6BhnHG;;;EAGE,YAAA;E7BknHL;A6B7mHC;;EAGI,oBAAA;E7B8mHL;A6B3mHC;;EAGI,mBAAA;E7B4mHL;A8BtwHD;EACE,kBAAA;EACA,iBAAA;EACA,kBAAA;E9BwwHD;A8B3wHD;EAOI,oBAAA;EACA,gBAAA;E9BuwHH;A8B/wHD;EAWM,oBAAA;EACA,gBAAA;EACA,oBAAA;E9BuwHL;A8BtwHK;;EAEE,uBAAA;EACA,2BAAA;E9BwwHP;A8BnwHG;EACE,gBAAA;E9BqwHL;A8BnwHK;;EAEE,gBAAA;EACA,uBAAA;EACA,+BAAA;EACA,qBAAA;E9BqwHP;A8B9vHG;;;EAGE,2BAAA;EACA,uBAAA;E9BgwHL;A8BzyHD;ELHE,aAAA;EACA,eAAA;EACA,kBAAA;EACA,2BAAA;EzB+yHD;A8B/yHD;EA0DI,iBAAA;E9BwvHH;A8B/uHD;EACE,kCAAA;E9BivHD;A8BlvHD;EAGI,aAAA;EAEA,qBAAA;E9BivHH;A8BtvHD;EASM,mBAAA;EACA,yBAAA;EACA,+BAAA;EACA,4BAAA;E9BgvHL;A8B/uHK;EACE,uCAAA;E9BivHP;A8B3uHK;;;EAGE,gBAAA;EACA,2BAAA;EACA,2BAAA;EACA,kCAAA;EACA,iBAAA;E9B6uHP;A8BxuHC;EAqDA,aAAA;EA8BA,kBAAA;E9BypHD;A8B5uHC;EAwDE,aAAA;E9BurHH;A8B/uHC;EA0DI,oBAAA;EACA,oBAAA;E9BwrHL;A8BnvHC;EAgEE,WAAA;EACA,YAAA;E9BsrHH;A8B1qHD;EAAA;IAPM,qBAAA;IACA,WAAA;I9BqrHH;E8B/qHH;IAJQ,kBAAA;I9BsrHL;EACF;A8BhwHC;EAuFE,iBAAA;EACA,oBAAA;E9B4qHH;A8BpwHC;;;EA8FE,2BAAA;E9B2qHH;A8B7pHD;EAAA;IATM,kCAAA;IACA,4BAAA;I9B0qHH;E8BlqHH;;;IAHM,8BAAA;I9B0qHH;EACF;A8B3wHD;EAEI,aAAA;E9B4wHH;A8B9wHD;EAMM,oBAAA;E9B2wHL;A8BjxHD;EASM,kBAAA;E9B2wHL;A8BtwHK;;;EAGE,gBAAA;EACA,2BAAA;E9BwwHP;A8BhwHD;EAEI,aAAA;E9BiwHH;A8BnwHD;EAIM,iBAAA;EACA,gBAAA;E9BkwHL;A8BtvHD;EACE,aAAA;E9BwvHD;A8BzvHD;EAII,aAAA;E9BwvHH;A8B5vHD;EAMM,oBAAA;EACA,oBAAA;E9ByvHL;A8BhwHD;EAYI,WAAA;EACA,YAAA;E9BuvHH;A8B3uHD;EAAA;IAPM,qBAAA;IACA,WAAA;I9BsvHH;E8BhvHH;IAJQ,kBAAA;I9BuvHL;EACF;A8B/uHD;EACE,kBAAA;E9BivHD;A8BlvHD;EAKI,iBAAA;EACA,oBAAA;E9BgvHH;A8BtvHD;;;EAYI,2BAAA;E9B+uHH;A8BjuHD;EAAA;IATM,kCAAA;IACA,4BAAA;I9B8uHH;E8BtuHH;;;IAHM,8BAAA;I9B8uHH;EACF;A8BruHD;EAEI,eAAA;E9BsuHH;A8BxuHD;EAKI,gBAAA;E9BsuHH;A8B7tHD;EAEE,kBAAA;EF3OA,4BAAA;EACC,2BAAA;E5B08HF;A+Bp8HD;EACE,oBAAA;EACA,kBAAA;EACA,qBAAA;EACA,+BAAA;E/Bs8HD;A+B97HD;EAAA;IAFI,oBAAA;I/Bo8HD;EACF;A+Br7HD;EAAA;IAFI,aAAA;I/B27HD;EACF;A+B76HD;EACE,qBAAA;EACA,qBAAA;EACA,oBAAA;EACA,mCAAA;EACA,4DAAA;UAAA,oDAAA;EAEA,mCAAA;E/B86HD;A+B56HC;EACE,kBAAA;E/B86HH;A+Bl5HD;EAAA;IAxBI,aAAA;IACA,eAAA;IACA,0BAAA;YAAA,kBAAA;I/B86HD;E+B56HC;IACE,2BAAA;IACA,yBAAA;IACA,mBAAA;IACA,8BAAA;I/B86HH;E+B36HC;IACE,qBAAA;I/B66HH;E+Bx6HC;;;IAGE,iBAAA;IACA,kBAAA;I/B06HH;EACF;A+Bt6HD;;EAGI,mBAAA;E/Bu6HH;A+Bl6HC;EAAA;;IAFI,mBAAA;I/By6HH;EACF;A+Bh6HD;;;;EAII,qBAAA;EACA,oBAAA;E/Bk6HH;A+B55HC;EAAA;;;;IAHI,iBAAA;IACA,gBAAA;I/Bs6HH;EACF;A+B15HD;EACE,eAAA;EACA,uBAAA;E/B45HD;A+Bv5HD;EAAA;IAFI,kBAAA;I/B65HD;EACF;A+Bz5HD;;EAEE,iBAAA;EACA,UAAA;EACA,SAAA;EACA,eAAA;E/B25HD;A+Br5HD;EAAA;;IAFI,kBAAA;I/B45HD;EACF;A+B15HD;EACE,QAAA;EACA,uBAAA;E/B45HD;A+B15HD;EACE,WAAA;EACA,kBAAA;EACA,uBAAA;E/B45HD;A+Bt5HD;EACE,aAAA;EACA,oBAAA;EACA,iBAAA;EACA,mBAAA;EACA,cAAA;E/Bw5HD;A+Bt5HC;;EAEE,uBAAA;E/Bw5HH;A+Bj6HD;EAaI,gBAAA;E/Bu5HH;A+B94HD;EALI;;IAEE,oBAAA;I/Bs5HH;EACF;A+B54HD;EACE,oBAAA;EACA,cAAA;EACA,oBAAA;EACA,mBAAA;EC9LA,iBAAA;EACA,oBAAA;ED+LA,+BAAA;EACA,wBAAA;EACA,+BAAA;EACA,oBAAA;E/B+4HD;A+B34HC;EACE,YAAA;E/B64HH;A+B35HD;EAmBI,gBAAA;EACA,aAAA;EACA,aAAA;EACA,oBAAA;E/B24HH;A+Bj6HD;EAyBI,iBAAA;E/B24HH;A+Br4HD;EAAA;IAFI,eAAA;I/B24HD;EACF;A+Bl4HD;EACE,qBAAA;E/Bo4HD;A+Br4HD;EAII,mBAAA;EACA,sBAAA;EACA,mBAAA;E/Bo4HH;A+Bx2HC;EAAA;IAtBI,kBAAA;IACA,aAAA;IACA,aAAA;IACA,eAAA;IACA,+BAAA;IACA,WAAA;IACA,0BAAA;YAAA,kBAAA;I/Bk4HH;E+Bl3HD;;IAbM,4BAAA;I/Bm4HL;E+Bt3HD;IAVM,mBAAA;I/Bm4HL;E+Bl4HK;;IAEE,wBAAA;I/Bo4HP;EACF;A+Bl3HD;EAAA;IAXI,aAAA;IACA,WAAA;I/Bi4HD;E+Bv3HH;IAPM,aAAA;I/Bi4HH;E+B13HH;IALQ,mBAAA;IACA,sBAAA;I/Bk4HL;EACF;A+Bv3HD;EACE,oBAAA;EACA,qBAAA;EACA,oBAAA;EACA,mCAAA;EACA,sCAAA;E1B9NA,8FAAA;EACQ,sFAAA;E2B/DR,iBAAA;EACA,oBAAA;EhCwpID;AkBvqHD;EAAA;IA9DM,uBAAA;IACA,kBAAA;IACA,wBAAA;IlByuHH;EkB7qHH;IAvDM,uBAAA;IACA,aAAA;IACA,wBAAA;IlBuuHH;EkBlrHH;IAhDM,uBAAA;IlBquHH;EkBrrHH;IA5CM,uBAAA;IACA,wBAAA;IlBouHH;EkBzrHH;;;IAtCQ,aAAA;IlBouHL;EkB9rHH;IAhCM,aAAA;IlBiuHH;EkBjsHH;IA5BM,kBAAA;IACA,wBAAA;IlBguHH;EkBrsHH;;IApBM,uBAAA;IACA,eAAA;IACA,kBAAA;IACA,wBAAA;IlB6tHH;EkB5sHH;;IAdQ,iBAAA;IlB8tHL;EkBhtHH;;IATM,oBAAA;IACA,gBAAA;IlB6tHH;EkBrtHH;IAHM,QAAA;IlB2tHH;EACF;A+Bh6HC;EAAA;IANI,oBAAA;I/B06HH;E+Bx6HG;IACE,kBAAA;I/B06HL;EACF;A+Bz5HD;EAAA;IARI,aAAA;IACA,WAAA;IACA,gBAAA;IACA,iBAAA;IACA,gBAAA;IACA,mBAAA;I1BzPF,0BAAA;IACQ,kBAAA;IL+pIP;EACF;A+B/5HD;EACE,eAAA;EHpUA,4BAAA;EACC,2BAAA;E5BsuIF;A+B/5HD;EACE,kBAAA;EHzUA,8BAAA;EACC,6BAAA;EAOD,+BAAA;EACC,8BAAA;E5BquIF;A+B35HD;EChVE,iBAAA;EACA,oBAAA;EhC8uID;A+B55HC;ECnVA,kBAAA;EACA,qBAAA;EhCkvID;A+B75HC;ECtVA,kBAAA;EACA,qBAAA;EhCsvID;A+Bv5HD;EChWE,kBAAA;EACA,qBAAA;EhC0vID;A+Bn5HD;EAAA;IAJI,aAAA;IACA,mBAAA;IACA,oBAAA;I/B25HD;EACF;A+B93HD;EAhBE;IExWA,wBAAA;IjC0vIC;E+Bj5HD;IE5WA,yBAAA;IF8WE,qBAAA;I/Bm5HD;E+Br5HD;IAKI,iBAAA;I/Bm5HH;EACF;A+B14HD;EACE,2BAAA;EACA,uBAAA;E/B44HD;A+B94HD;EAKI,gBAAA;E/B44HH;A+B34HG;;EAEE,gBAAA;EACA,+BAAA;E/B64HL;A+Bt5HD;EAcI,gBAAA;E/B24HH;A+Bz5HD;EAmBM,gBAAA;E/By4HL;A+Bv4HK;;EAEE,gBAAA;EACA,+BAAA;E/By4HP;A+Br4HK;;;EAGE,gBAAA;EACA,2BAAA;E/Bu4HP;A+Bn4HK;;;EAGE,gBAAA;EACA,+BAAA;E/Bq4HP;A+B76HD;EA8CI,uBAAA;E/Bk4HH;A+Bj4HG;;EAEE,2BAAA;E/Bm4HL;A+Bp7HD;EAoDM,2BAAA;E/Bm4HL;A+Bv7HD;;EA0DI,uBAAA;E/Bi4HH;A+B13HK;;;EAGE,2BAAA;EACA,gBAAA;E/B43HP;A+B31HC;EAAA;IAzBQ,gBAAA;I/Bw3HP;E+Bv3HO;;IAEE,gBAAA;IACA,+BAAA;I/By3HT;E+Br3HO;;;IAGE,gBAAA;IACA,2BAAA;I/Bu3HT;E+Bn3HO;;;IAGE,gBAAA;IACA,+BAAA;I/Bq3HT;EACF;A+Bv9HD;EA8GI,gBAAA;E/B42HH;A+B32HG;EACE,gBAAA;E/B62HL;A+B79HD;EAqHI,gBAAA;E/B22HH;A+B12HG;;EAEE,gBAAA;E/B42HL;A+Bx2HK;;;;EAEE,gBAAA;E/B42HP;A+Bp2HD;EACE,2BAAA;EACA,uBAAA;E/Bs2HD;A+Bx2HD;EAKI,gBAAA;E/Bs2HH;A+Br2HG;;EAEE,gBAAA;EACA,+BAAA;E/Bu2HL;A+Bh3HD;EAcI,gBAAA;E/Bq2HH;A+Bn3HD;EAmBM,gBAAA;E/Bm2HL;A+Bj2HK;;EAEE,gBAAA;EACA,+BAAA;E/Bm2HP;A+B/1HK;;;EAGE,gBAAA;EACA,2BAAA;E/Bi2HP;A+B71HK;;;EAGE,gBAAA;EACA,+BAAA;E/B+1HP;A+Bv4HD;EA+CI,uBAAA;E/B21HH;A+B11HG;;EAEE,2BAAA;E/B41HL;A+B94HD;EAqDM,2BAAA;E/B41HL;A+Bj5HD;;EA2DI,uBAAA;E/B01HH;A+Bp1HK;;;EAGE,2BAAA;EACA,gBAAA;E/Bs1HP;A+B/yHC;EAAA;IA/BQ,uBAAA;I/Bk1HP;E+BnzHD;IA5BQ,2BAAA;I/Bk1HP;E+BtzHD;IAzBQ,gBAAA;I/Bk1HP;E+Bj1HO;;IAEE,gBAAA;IACA,+BAAA;I/Bm1HT;E+B/0HO;;;IAGE,gBAAA;IACA,2BAAA;I/Bi1HT;E+B70HO;;;IAGE,gBAAA;IACA,+BAAA;I/B+0HT;EACF;A+Bv7HD;EA+GI,gBAAA;E/B20HH;A+B10HG;EACE,gBAAA;E/B40HL;A+B77HD;EAsHI,gBAAA;E/B00HH;A+Bz0HG;;EAEE,gBAAA;E/B20HL;A+Bv0HK;;;;EAEE,gBAAA;E/B20HP;AkCr9ID;EACE,mBAAA;EACA,qBAAA;EACA,kBAAA;EACA,2BAAA;EACA,oBAAA;ElCu9ID;AkC59ID;EAQI,uBAAA;ElCu9IH;AkC/9ID;EAWM,mBAAA;EACA,gBAAA;EACA,gBAAA;ElCu9IL;AkCp+ID;EAkBI,gBAAA;ElCq9IH;AmCz+ID;EACE,uBAAA;EACA,iBAAA;EACA,gBAAA;EACA,oBAAA;EnC2+ID;AmC/+ID;EAOI,iBAAA;EnC2+IH;AmCl/ID;;EAUM,oBAAA;EACA,aAAA;EACA,mBAAA;EACA,yBAAA;EACA,uBAAA;EACA,gBAAA;EACA,2BAAA;EACA,2BAAA;EACA,mBAAA;EnC4+IL;AmC1+IG;;EAGI,gBAAA;EPXN,gCAAA;EACG,6BAAA;E5Bu/IJ;AmCz+IG;;EPvBF,iCAAA;EACG,8BAAA;E5BogJJ;AmCp+IG;;;;EAEE,gBAAA;EACA,2BAAA;EACA,uBAAA;EnCw+IL;AmCl+IG;;;;;;EAGE,YAAA;EACA,gBAAA;EACA,2BAAA;EACA,uBAAA;EACA,iBAAA;EnCu+IL;AmC7hJD;;;;;;EAiEM,gBAAA;EACA,2BAAA;EACA,uBAAA;EACA,qBAAA;EnCo+IL;AmC39ID;;EC1EM,oBAAA;EACA,iBAAA;EpCyiJL;AoCviJG;;ERMF,gCAAA;EACG,6BAAA;E5BqiJJ;AoCtiJG;;ERRF,iCAAA;EACG,8BAAA;E5BkjJJ;AmCr+ID;;EC/EM,mBAAA;EACA,iBAAA;EpCwjJL;AoCtjJG;;ERMF,gCAAA;EACG,6BAAA;E5BojJJ;AoCrjJG;;ERRF,iCAAA;EACG,8BAAA;E5BikJJ;AqCpkJD;EACE,iBAAA;EACA,gBAAA;EACA,kBAAA;EACA,oBAAA;ErCskJD;AqC1kJD;EAOI,iBAAA;ErCskJH;AqC7kJD;;EAUM,uBAAA;EACA,mBAAA;EACA,2BAAA;EACA,2BAAA;EACA,qBAAA;ErCukJL;AqCrlJD;;EAmBM,uBAAA;EACA,2BAAA;ErCskJL;AqC1lJD;;EA2BM,cAAA;ErCmkJL;AqC9lJD;;EAkCM,aAAA;ErCgkJL;AqClmJD;;;;EA2CM,gBAAA;EACA,2BAAA;EACA,qBAAA;ErC6jJL;AsC3mJD;EACE,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA;EACA,oBAAA;EACA,qBAAA;EACA,0BAAA;EACA,sBAAA;EtC6mJD;AsCzmJG;;EAEE,gBAAA;EACA,uBAAA;EACA,iBAAA;EtC2mJL;AsCtmJC;EACE,eAAA;EtCwmJH;AsCpmJC;EACE,oBAAA;EACA,WAAA;EtCsmJH;AsC/lJD;ECtCE,2BAAA;EvCwoJD;AuCroJG;;EAEE,2BAAA;EvCuoJL;AsClmJD;EC1CE,2BAAA;EvC+oJD;AuC5oJG;;EAEE,2BAAA;EvC8oJL;AsCrmJD;EC9CE,2BAAA;EvCspJD;AuCnpJG;;EAEE,2BAAA;EvCqpJL;AsCxmJD;EClDE,2BAAA;EvC6pJD;AuC1pJG;;EAEE,2BAAA;EvC4pJL;AsC3mJD;ECtDE,2BAAA;EvCoqJD;AuCjqJG;;EAEE,2BAAA;EvCmqJL;AsC9mJD;EC1DE,2BAAA;EvC2qJD;AuCxqJG;;EAEE,2BAAA;EvC0qJL;AwC5qJD;EACE,uBAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA;EACA,0BAAA;EACA,qBAAA;EACA,oBAAA;EACA,2BAAA;EACA,qBAAA;ExC8qJD;AwC3qJC;EACE,eAAA;ExC6qJH;AwCzqJC;EACE,oBAAA;EACA,WAAA;ExC2qJH;AwCxqJC;;EAEE,QAAA;EACA,kBAAA;ExC0qJH;AwCrqJG;;EAEE,gBAAA;EACA,uBAAA;EACA,iBAAA;ExCuqJL;AwClqJC;;EAEE,gBAAA;EACA,2BAAA;ExCoqJH;AwCjqJC;EACE,cAAA;ExCmqJH;AwChqJC;EACE,mBAAA;ExCkqJH;AwC/pJC;EACE,kBAAA;ExCiqJH;AyC3tJD;EACE,oBAAA;EACA,qBAAA;EACA,gBAAA;EACA,2BAAA;EzC6tJD;AyCjuJD;;EAQI,gBAAA;EzC6tJH;AyCruJD;EAYI,qBAAA;EACA,iBAAA;EACA,kBAAA;EzC4tJH;AyC1uJD;EAkBI,2BAAA;EzC2tJH;AyCxtJC;;EAEE,oBAAA;EzC0tJH;AyCjvJD;EA2BI,iBAAA;EzCytJH;AyCxsJD;EAAA;IAbI,iBAAA;IzCytJD;EyCvtJC;;IAEE,oBAAA;IACA,qBAAA;IzCytJH;EyCjtJH;;IAHM,iBAAA;IzCwtJH;EACF;A0CjwJD;EACE,gBAAA;EACA,cAAA;EACA,qBAAA;EACA,yBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;ErCiLA,6CAAA;EACK,wCAAA;EACG,qCAAA;ELmlJT;A0C7wJD;;EAaI,mBAAA;EACA,oBAAA;E1CowJH;A0ChwJC;;;EAGE,uBAAA;E1CkwJH;A0CvxJD;EA0BI,cAAA;EACA,gBAAA;E1CgwJH;A2CzxJD;EACE,eAAA;EACA,qBAAA;EACA,+BAAA;EACA,oBAAA;E3C2xJD;A2C/xJD;EAQI,eAAA;EAEA,gBAAA;E3CyxJH;A2CnyJD;EAeI,mBAAA;E3CuxJH;A2CtyJD;;EAqBI,kBAAA;E3CqxJH;A2C1yJD;EAyBI,iBAAA;E3CoxJH;A2C5wJD;;EAEE,qBAAA;E3C8wJD;A2ChxJD;;EAMI,oBAAA;EACA,WAAA;EACA,cAAA;EACA,gBAAA;E3C8wJH;A2CtwJD;ECvDE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5Cg0JD;A2C3wJD;EClDI,2BAAA;E5Cg0JH;A2C9wJD;EC/CI,gBAAA;E5Cg0JH;A2C7wJD;EC3DE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5C20JD;A2ClxJD;ECtDI,2BAAA;E5C20JH;A2CrxJD;ECnDI,gBAAA;E5C20JH;A2CpxJD;EC/DE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5Cs1JD;A2CzxJD;EC1DI,2BAAA;E5Cs1JH;A2C5xJD;ECvDI,gBAAA;E5Cs1JH;A2C3xJD;ECnEE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5Ci2JD;A2ChyJD;EC9DI,2BAAA;E5Ci2JH;A2CnyJD;EC3DI,gBAAA;E5Ci2JH;A6Cn2JD;EACE;IAAQ,6BAAA;I7Cs2JP;E6Cr2JD;IAAQ,0BAAA;I7Cw2JP;EACF;A6Cr2JD;EACE;IAAQ,6BAAA;I7Cw2JP;E6Cv2JD;IAAQ,0BAAA;I7C02JP;EACF;A6C72JD;EACE;IAAQ,6BAAA;I7Cw2JP;E6Cv2JD;IAAQ,0BAAA;I7C02JP;EACF;A6Cn2JD;EACE,kBAAA;EACA,cAAA;EACA,qBAAA;EACA,2BAAA;EACA,oBAAA;ExCsCA,wDAAA;EACQ,gDAAA;ELg0JT;A6Cl2JD;EACE,aAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2BAAA;ExCyBA,wDAAA;EACQ,gDAAA;EAyHR,qCAAA;EACK,gCAAA;EACG,6BAAA;ELotJT;A6C/1JD;;ECCI,+MAAA;EACA,0MAAA;EACA,uMAAA;EDAF,oCAAA;UAAA,4BAAA;E7Cm2JD;A6C51JD;;ExC5CE,4DAAA;EACK,uDAAA;EACG,oDAAA;EL44JT;A6Cz1JD;EErEE,2BAAA;E/Ci6JD;A+C95JC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9Ci3JH;A6C71JD;EEzEE,2BAAA;E/Cy6JD;A+Ct6JC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9Cy3JH;A6Cj2JD;EE7EE,2BAAA;E/Ci7JD;A+C96JC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9Ci4JH;A6Cr2JD;EEjFE,2BAAA;E/Cy7JD;A+Ct7JC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9Cy4JH;AgDj8JD;EAEE,kBAAA;EhDk8JD;AgDh8JC;EACE,eAAA;EhDk8JH;AgD97JD;;EAEE,SAAA;EACA,kBAAA;EhDg8JD;AgD77JD;EACE,gBAAA;EhD+7JD;AgD57JD;EACE,gBAAA;EhD87JD;AgD37JD;;EAEE,oBAAA;EhD67JD;AgD17JD;;EAEE,qBAAA;EhD47JD;AgDz7JD;;;EAGE,qBAAA;EACA,qBAAA;EhD27JD;AgDx7JD;EACE,wBAAA;EhD07JD;AgDv7JD;EACE,wBAAA;EhDy7JD;AgDr7JD;EACE,eAAA;EACA,oBAAA;EhDu7JD;AgDj7JD;EACE,iBAAA;EACA,kBAAA;EhDm7JD;AiDr+JD;EAEE,qBAAA;EACA,iBAAA;EjDs+JD;AiD99JD;EACE,oBAAA;EACA,gBAAA;EACA,oBAAA;EAEA,qBAAA;EACA,2BAAA;EACA,2BAAA;EjD+9JD;AiD59JC;ErB3BA,8BAAA;EACC,6BAAA;E5B0/JF;AiD79JC;EACE,kBAAA;ErBvBF,iCAAA;EACC,gCAAA;E5Bu/JF;AiDt9JD;EACE,gBAAA;EjDw9JD;AiDz9JD;EAII,gBAAA;EjDw9JH;AiDp9JC;;EAEE,uBAAA;EACA,gBAAA;EACA,2BAAA;EjDs9JH;AiDh9JC;;;EAGE,2BAAA;EACA,gBAAA;EACA,qBAAA;EjDk9JH;AiDv9JC;;;EASI,gBAAA;EjDm9JL;AiD59JC;;;EAYI,gBAAA;EjDq9JL;AiDh9JC;;;EAGE,YAAA;EACA,gBAAA;EACA,2BAAA;EACA,uBAAA;EjDk9JH;AiDx9JC;;;;;;;;;EAYI,gBAAA;EjDu9JL;AiDn+JC;;;EAeI,gBAAA;EjDy9JL;AkDrjKC;EACE,gBAAA;EACA,2BAAA;ElDujKH;AkDrjKG;EACE,gBAAA;ElDujKL;AkDxjKG;EAII,gBAAA;ElDujKP;AkDpjKK;;EAEE,gBAAA;EACA,2BAAA;ElDsjKP;AkDpjKK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElDsjKP;AkD3kKC;EACE,gBAAA;EACA,2BAAA;ElD6kKH;AkD3kKG;EACE,gBAAA;ElD6kKL;AkD9kKG;EAII,gBAAA;ElD6kKP;AkD1kKK;;EAEE,gBAAA;EACA,2BAAA;ElD4kKP;AkD1kKK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElD4kKP;AkDjmKC;EACE,gBAAA;EACA,2BAAA;ElDmmKH;AkDjmKG;EACE,gBAAA;ElDmmKL;AkDpmKG;EAII,gBAAA;ElDmmKP;AkDhmKK;;EAEE,gBAAA;EACA,2BAAA;ElDkmKP;AkDhmKK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElDkmKP;AkDvnKC;EACE,gBAAA;EACA,2BAAA;ElDynKH;AkDvnKG;EACE,gBAAA;ElDynKL;AkD1nKG;EAII,gBAAA;ElDynKP;AkDtnKK;;EAEE,gBAAA;EACA,2BAAA;ElDwnKP;AkDtnKK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElDwnKP;AiD5hKD;EACE,eAAA;EACA,oBAAA;EjD8hKD;AiD5hKD;EACE,kBAAA;EACA,kBAAA;EjD8hKD;AmDlpKD;EACE,qBAAA;EACA,2BAAA;EACA,+BAAA;EACA,oBAAA;E9C0DA,mDAAA;EACQ,2CAAA;EL2lKT;AmDjpKD;EACE,eAAA;EnDmpKD;AmD9oKD;EACE,oBAAA;EACA,sCAAA;EvBpBA,8BAAA;EACC,6BAAA;E5BqqKF;AmDppKD;EAMI,gBAAA;EnDipKH;AmD5oKD;EACE,eAAA;EACA,kBAAA;EACA,iBAAA;EACA,gBAAA;EnD8oKD;AmDlpKD;;;;;EAWI,gBAAA;EnD8oKH;AmDzoKD;EACE,oBAAA;EACA,2BAAA;EACA,+BAAA;EvBxCA,iCAAA;EACC,gCAAA;E5BorKF;AmDnoKD;;EAGI,kBAAA;EnDooKH;AmDvoKD;;EAMM,qBAAA;EACA,kBAAA;EnDqoKL;AmDjoKG;;EAEI,eAAA;EvBvEN,8BAAA;EACC,6BAAA;E5B2sKF;AmDhoKG;;EAEI,kBAAA;EvBtEN,iCAAA;EACC,gCAAA;E5BysKF;AmD7nKD;EAEI,qBAAA;EnD8nKH;AmD3nKD;EACE,qBAAA;EnD6nKD;AmDrnKD;;;EAII,kBAAA;EnDsnKH;AmD1nKD;;;EAOM,oBAAA;EACA,qBAAA;EnDwnKL;AmDhoKD;;EvBnGE,8BAAA;EACC,6BAAA;E5BuuKF;AmDroKD;;;;EAmBQ,6BAAA;EACA,8BAAA;EnDwnKP;AmD5oKD;;;;;;;;EAwBU,6BAAA;EnD8nKT;AmDtpKD;;;;;;;;EA4BU,8BAAA;EnDooKT;AmDhqKD;;EvB3FE,iCAAA;EACC,gCAAA;E5B+vKF;AmDrqKD;;;;EAyCQ,gCAAA;EACA,iCAAA;EnDkoKP;AmD5qKD;;;;;;;;EA8CU,gCAAA;EnDwoKT;AmDtrKD;;;;;;;;EAkDU,iCAAA;EnD8oKT;AmDhsKD;;;;EA2DI,+BAAA;EnD2oKH;AmDtsKD;;EA+DI,eAAA;EnD2oKH;AmD1sKD;;EAmEI,WAAA;EnD2oKH;AmD9sKD;;;;;;;;;;;;EA0EU,gBAAA;EnDkpKT;AmD5tKD;;;;;;;;;;;;EA8EU,iBAAA;EnD4pKT;AmD1uKD;;;;;;;;EAuFU,kBAAA;EnD6pKT;AmDpvKD;;;;;;;;EAgGU,kBAAA;EnD8pKT;AmD9vKD;EAsGI,WAAA;EACA,kBAAA;EnD2pKH;AmDjpKD;EACE,qBAAA;EnDmpKD;AmDppKD;EAKI,kBAAA;EACA,oBAAA;EnDkpKH;AmDxpKD;EASM,iBAAA;EnDkpKL;AmD3pKD;EAcI,kBAAA;EnDgpKH;AmD9pKD;;EAkBM,+BAAA;EnDgpKL;AmDlqKD;EAuBI,eAAA;EnD8oKH;AmDrqKD;EAyBM,kCAAA;EnD+oKL;AmDxoKD;ECpPE,uBAAA;EpD+3KD;AoD73KC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpD+3KH;AoDl4KC;EAMI,2BAAA;EpD+3KL;AoDr4KC;EASI,gBAAA;EACA,2BAAA;EpD+3KL;AoD53KC;EAEI,8BAAA;EpD63KL;AmDvpKD;ECvPE,uBAAA;EpDi5KD;AoD/4KC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDi5KH;AoDp5KC;EAMI,2BAAA;EpDi5KL;AoDv5KC;EASI,gBAAA;EACA,2BAAA;EpDi5KL;AoD94KC;EAEI,8BAAA;EpD+4KL;AmDtqKD;EC1PE,uBAAA;EpDm6KD;AoDj6KC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDm6KH;AoDt6KC;EAMI,2BAAA;EpDm6KL;AoDz6KC;EASI,gBAAA;EACA,2BAAA;EpDm6KL;AoDh6KC;EAEI,8BAAA;EpDi6KL;AmDrrKD;EC7PE,uBAAA;EpDq7KD;AoDn7KC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDq7KH;AoDx7KC;EAMI,2BAAA;EpDq7KL;AoD37KC;EASI,gBAAA;EACA,2BAAA;EpDq7KL;AoDl7KC;EAEI,8BAAA;EpDm7KL;AmDpsKD;EChQE,uBAAA;EpDu8KD;AoDr8KC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDu8KH;AoD18KC;EAMI,2BAAA;EpDu8KL;AoD78KC;EASI,gBAAA;EACA,2BAAA;EpDu8KL;AoDp8KC;EAEI,8BAAA;EpDq8KL;AmDntKD;ECnQE,uBAAA;EpDy9KD;AoDv9KC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDy9KH;AoD59KC;EAMI,2BAAA;EpDy9KL;AoD/9KC;EASI,gBAAA;EACA,2BAAA;EpDy9KL;AoDt9KC;EAEI,8BAAA;EpDu9KL;AqDv+KD;EACE,oBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;ErDy+KD;AqD9+KD;;;;;EAYI,oBAAA;EACA,QAAA;EACA,SAAA;EACA,WAAA;EACA,cAAA;EACA,aAAA;EACA,WAAA;ErDy+KH;AqDp+KD;EACE,wBAAA;ErDs+KD;AqDl+KD;EACE,qBAAA;ErDo+KD;AsD//KD;EACE,kBAAA;EACA,eAAA;EACA,qBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;EjDwDA,yDAAA;EACQ,iDAAA;EL08KT;AsDzgLD;EASI,oBAAA;EACA,mCAAA;EtDmgLH;AsD9/KD;EACE,eAAA;EACA,oBAAA;EtDggLD;AsD9/KD;EACE,cAAA;EACA,oBAAA;EtDggLD;AuDthLD;EACE,cAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA;EACA,8BAAA;EjCRA,cAAA;EAGA,2BAAA;EtB+hLD;AuDvhLC;;EAEE,gBAAA;EACA,uBAAA;EACA,iBAAA;EjCfF,cAAA;EAGA,2BAAA;EtBuiLD;AuDnhLC;EACE,YAAA;EACA,iBAAA;EACA,yBAAA;EACA,WAAA;EACA,0BAAA;EvDqhLH;AwD1iLD;EACE,kBAAA;ExD4iLD;AwDxiLD;EACE,eAAA;EACA,kBAAA;EACA,iBAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA,mCAAA;EAIA,YAAA;ExDuiLD;AwDpiLC;EnD+GA,uCAAA;EACI,mCAAA;EACC,kCAAA;EACG,+BAAA;EAkER,qDAAA;EAEK,2CAAA;EACG,qCAAA;ELu3KT;AwD1iLC;EnD2GA,oCAAA;EACI,gCAAA;EACC,+BAAA;EACG,4BAAA;ELk8KT;AwD9iLD;EACE,oBAAA;EACA,kBAAA;ExDgjLD;AwD5iLD;EACE,oBAAA;EACA,aAAA;EACA,cAAA;ExD8iLD;AwD1iLD;EACE,oBAAA;EACA,2BAAA;EACA,2BAAA;EACA,sCAAA;EACA,oBAAA;EnDaA,kDAAA;EACQ,0CAAA;EmDZR,sCAAA;UAAA,8BAAA;EAEA,YAAA;ExD4iLD;AwDxiLD;EACE,iBAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA,2BAAA;ExD0iLD;AwDxiLC;ElCrEA,YAAA;EAGA,0BAAA;EtB8mLD;AwD3iLC;ElCtEA,cAAA;EAGA,2BAAA;EtBknLD;AwD1iLD;EACE,eAAA;EACA,kCAAA;EACA,2BAAA;ExD4iLD;AwDziLD;EACE,kBAAA;ExD2iLD;AwDviLD;EACE,WAAA;EACA,yBAAA;ExDyiLD;AwDpiLD;EACE,oBAAA;EACA,eAAA;ExDsiLD;AwDliLD;EACE,eAAA;EACA,mBAAA;EACA,+BAAA;ExDoiLD;AwDviLD;EAQI,kBAAA;EACA,kBAAA;ExDkiLH;AwD3iLD;EAaI,mBAAA;ExDiiLH;AwD9iLD;EAiBI,gBAAA;ExDgiLH;AwD3hLD;EACE,oBAAA;EACA,cAAA;EACA,aAAA;EACA,cAAA;EACA,kBAAA;ExD6hLD;AwD3gLD;EAZE;IACE,cAAA;IACA,mBAAA;IxD0hLD;EwDxhLD;InDvEA,mDAAA;IACQ,2CAAA;ILkmLP;EwDvhLD;IAAY,cAAA;IxD0hLX;EACF;AwDrhLD;EAFE;IAAY,cAAA;IxD2hLX;EACF;AyD1qLD;EACE,oBAAA;EACA,eAAA;EACA,gBAAA;EAEA,6DAAA;EACA,iBAAA;EACA,qBAAA;EACA,kBAAA;EnCXA,YAAA;EAGA,0BAAA;EtBqrLD;AyD1qLC;EnCdA,cAAA;EAGA,2BAAA;EtByrLD;AyD7qLC;EAAW,kBAAA;EAAmB,gBAAA;EzDirL/B;AyDhrLC;EAAW,kBAAA;EAAmB,gBAAA;EzDorL/B;AyDnrLC;EAAW,iBAAA;EAAmB,gBAAA;EzDurL/B;AyDtrLC;EAAW,mBAAA;EAAmB,gBAAA;EzD0rL/B;AyDtrLD;EACE,kBAAA;EACA,kBAAA;EACA,gBAAA;EACA,oBAAA;EACA,uBAAA;EACA,2BAAA;EACA,oBAAA;EzDwrLD;AyDprLD;EACE,oBAAA;EACA,UAAA;EACA,WAAA;EACA,2BAAA;EACA,qBAAA;EzDsrLD;AyDlrLC;EACE,WAAA;EACA,WAAA;EACA,mBAAA;EACA,yBAAA;EACA,2BAAA;EzDorLH;AyDlrLC;EACE,WAAA;EACA,YAAA;EACA,qBAAA;EACA,yBAAA;EACA,2BAAA;EzDorLH;AyDlrLC;EACE,WAAA;EACA,WAAA;EACA,qBAAA;EACA,yBAAA;EACA,2BAAA;EzDorLH;AyDlrLC;EACE,UAAA;EACA,SAAA;EACA,kBAAA;EACA,6BAAA;EACA,6BAAA;EzDorLH;AyDlrLC;EACE,UAAA;EACA,UAAA;EACA,kBAAA;EACA,6BAAA;EACA,4BAAA;EzDorLH;AyDlrLC;EACE,QAAA;EACA,WAAA;EACA,mBAAA;EACA,yBAAA;EACA,8BAAA;EzDorLH;AyDlrLC;EACE,QAAA;EACA,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,8BAAA;EzDorLH;AyDlrLC;EACE,QAAA;EACA,WAAA;EACA,kBAAA;EACA,yBAAA;EACA,8BAAA;EzDorLH;A0DlxLD;EACE,oBAAA;EACA,QAAA;EACA,SAAA;EACA,eAAA;EACA,eAAA;EACA,kBAAA;EACA,cAAA;EAEA,6DAAA;EACA,iBAAA;EACA,qBAAA;EACA,yBAAA;EACA,kBAAA;EACA,2BAAA;EACA,sCAAA;UAAA,8BAAA;EACA,2BAAA;EACA,sCAAA;EACA,oBAAA;ErD6CA,mDAAA;EACQ,2CAAA;EqD1CR,qBAAA;E1DkxLD;A0D/wLC;EAAY,mBAAA;E1DkxLb;A0DjxLC;EAAY,mBAAA;E1DoxLb;A0DnxLC;EAAY,kBAAA;E1DsxLb;A0DrxLC;EAAY,oBAAA;E1DwxLb;A0DrxLD;EACE,WAAA;EACA,mBAAA;EACA,iBAAA;EACA,2BAAA;EACA,kCAAA;EACA,4BAAA;E1DuxLD;A0DpxLD;EACE,mBAAA;E1DsxLD;A0D9wLC;;EAEE,oBAAA;EACA,gBAAA;EACA,UAAA;EACA,WAAA;EACA,2BAAA;EACA,qBAAA;E1DgxLH;A0D7wLD;EACE,oBAAA;E1D+wLD;A0D7wLD;EACE,oBAAA;EACA,aAAA;E1D+wLD;A0D3wLC;EACE,WAAA;EACA,oBAAA;EACA,wBAAA;EACA,2BAAA;EACA,uCAAA;EACA,eAAA;E1D6wLH;A0D5wLG;EACE,cAAA;EACA,aAAA;EACA,oBAAA;EACA,wBAAA;EACA,2BAAA;E1D8wLL;A0D3wLC;EACE,UAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,6BAAA;EACA,yCAAA;E1D6wLH;A0D5wLG;EACE,cAAA;EACA,WAAA;EACA,eAAA;EACA,sBAAA;EACA,6BAAA;E1D8wLL;A0D3wLC;EACE,WAAA;EACA,oBAAA;EACA,qBAAA;EACA,8BAAA;EACA,0CAAA;EACA,YAAA;E1D6wLH;A0D5wLG;EACE,cAAA;EACA,UAAA;EACA,oBAAA;EACA,qBAAA;EACA,8BAAA;E1D8wLL;A0D1wLC;EACE,UAAA;EACA,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,4BAAA;EACA,wCAAA;E1D4wLH;A0D3wLG;EACE,cAAA;EACA,YAAA;EACA,uBAAA;EACA,4BAAA;EACA,eAAA;E1D6wLL;A2D14LD;EACE,oBAAA;E3D44LD;A2Dz4LD;EACE,oBAAA;EACA,kBAAA;EACA,aAAA;E3D24LD;A2D94LD;EAMI,eAAA;EACA,oBAAA;EtD6KF,2CAAA;EACK,sCAAA;EACG,mCAAA;EL+tLT;A2Dr5LD;;EAcM,gBAAA;E3D24LL;A2Dj3LC;EAAA;ItDiKA,wDAAA;IAEK,8CAAA;IACG,wCAAA;IA7JR,qCAAA;IAEQ,6BAAA;IA+GR,2BAAA;IAEQ,mBAAA;ILowLP;E2D/4LG;;ItDmHJ,4CAAA;IACQ,oCAAA;IsDjHF,SAAA;I3Dk5LL;E2Dh5LG;;ItD8GJ,6CAAA;IACQ,qCAAA;IsD5GF,SAAA;I3Dm5LL;E2Dj5LG;;;ItDyGJ,yCAAA;IACQ,iCAAA;IsDtGF,SAAA;I3Do5LL;EACF;A2D17LD;;;EA6CI,gBAAA;E3Dk5LH;A2D/7LD;EAiDI,SAAA;E3Di5LH;A2Dl8LD;;EAsDI,oBAAA;EACA,QAAA;EACA,aAAA;E3Dg5LH;A2Dx8LD;EA4DI,YAAA;E3D+4LH;A2D38LD;EA+DI,aAAA;E3D+4LH;A2D98LD;;EAmEI,SAAA;E3D+4LH;A2Dl9LD;EAuEI,aAAA;E3D84LH;A2Dr9LD;EA0EI,YAAA;E3D84LH;A2Dt4LD;EACE,oBAAA;EACA,QAAA;EACA,SAAA;EACA,WAAA;EACA,YAAA;ErC9FA,cAAA;EAGA,2BAAA;EqC6FA,iBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2CAAA;E3Dy4LD;A2Dp4LC;EblGE,oGAAA;EACA,+FAAA;EACA,sHAAA;EAAA,gGAAA;EACA,6BAAA;EACA,wHAAA;E9Cy+LH;A2Dx4LC;EACE,YAAA;EACA,UAAA;EbvGA,oGAAA;EACA,+FAAA;EACA,sHAAA;EAAA,gGAAA;EACA,6BAAA;EACA,wHAAA;E9Ck/LH;A2D14LC;;EAEE,YAAA;EACA,gBAAA;EACA,uBAAA;ErCtHF,cAAA;EAGA,2BAAA;EtBigMD;A2D36LD;;;;EAsCI,oBAAA;EACA,UAAA;EACA,YAAA;EACA,uBAAA;E3D24LH;A2Dp7LD;;EA6CI,WAAA;EACA,oBAAA;E3D24LH;A2Dz7LD;;EAkDI,YAAA;EACA,qBAAA;E3D24LH;A2D97LD;;EAuDI,aAAA;EACA,cAAA;EACA,mBAAA;EACA,gBAAA;EACA,oBAAA;E3D24LH;A2Dt4LG;EACE,kBAAA;E3Dw4LL;A2Dp4LG;EACE,kBAAA;E3Ds4LL;A2D53LD;EACE,oBAAA;EACA,cAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;E3D83LD;A2Dv4LD;EAYI,uBAAA;EACA,aAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,2BAAA;EACA,qBAAA;EACA,iBAAA;EAWA,2BAAA;EACA,oCAAA;E3Do3LH;A2Dn5LD;EAkCI,WAAA;EACA,aAAA;EACA,cAAA;EACA,2BAAA;E3Do3LH;A2D72LD;EACE,oBAAA;EACA,WAAA;EACA,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2CAAA;E3D+2LD;A2D92LC;EACE,mBAAA;E3Dg3LH;A2Dv0LD;EAhCE;;;;IAKI,aAAA;IACA,cAAA;IACA,mBAAA;IACA,iBAAA;I3Dy2LH;E2Dj3LD;;IAYI,oBAAA;I3Dy2LH;E2Dr3LD;;IAgBI,qBAAA;I3Dy2LH;E2Dp2LD;IACE,WAAA;IACA,YAAA;IACA,sBAAA;I3Ds2LD;E2Dl2LD;IACE,cAAA;I3Do2LD;EACF;A4DlmMC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEE,cAAA;EACA,gBAAA;E5DgoMH;A4D9nMC;;;;;;;;;;;;;;;EACE,aAAA;E5D8oMH;AiCtpMD;E4BRE,gBAAA;EACA,mBAAA;EACA,oBAAA;E7DiqMD;AiCxpMD;EACE,yBAAA;EjC0pMD;AiCxpMD;EACE,wBAAA;EjC0pMD;AiClpMD;EACE,0BAAA;EjCopMD;AiClpMD;EACE,2BAAA;EjCopMD;AiClpMD;EACE,oBAAA;EjCopMD;AiClpMD;E6BzBE,aAAA;EACA,oBAAA;EACA,mBAAA;EACA,+BAAA;EACA,WAAA;E9D8qMD;AiChpMD;EACE,0BAAA;EjCkpMD;AiC3oMD;EACE,iBAAA;EjC6oMD;A+D9qMD;EACE,qBAAA;E/DgrMD;A+D1qMD;;;;ECdE,0BAAA;EhE8rMD;A+DzqMD;;;;;;;;;;;;EAYE,0BAAA;E/D2qMD;A+DpqMD;EAAA;IChDE,2BAAA;IhEwtMC;EgEvtMD;IAAU,gBAAA;IhE0tMT;EgEztMD;IAAU,+BAAA;IhE4tMT;EgE3tMD;;IACU,gCAAA;IhE8tMT;EACF;A+D9qMD;EAAA;IAFI,2BAAA;I/DorMD;EACF;A+D9qMD;EAAA;IAFI,4BAAA;I/DorMD;EACF;A+D9qMD;EAAA;IAFI,kCAAA;I/DorMD;EACF;A+D7qMD;EAAA;ICrEE,2BAAA;IhEsvMC;EgErvMD;IAAU,gBAAA;IhEwvMT;EgEvvMD;IAAU,+BAAA;IhE0vMT;EgEzvMD;;IACU,gCAAA;IhE4vMT;EACF;A+DvrMD;EAAA;IAFI,2BAAA;I/D6rMD;EACF;A+DvrMD;EAAA;IAFI,4BAAA;I/D6rMD;EACF;A+DvrMD;EAAA;IAFI,kCAAA;I/D6rMD;EACF;A+DtrMD;EAAA;IC1FE,2BAAA;IhEoxMC;EgEnxMD;IAAU,gBAAA;IhEsxMT;EgErxMD;IAAU,+BAAA;IhEwxMT;EgEvxMD;;IACU,gCAAA;IhE0xMT;EACF;A+DhsMD;EAAA;IAFI,2BAAA;I/DssMD;EACF;A+DhsMD;EAAA;IAFI,4BAAA;I/DssMD;EACF;A+DhsMD;EAAA;IAFI,kCAAA;I/DssMD;EACF;A+D/rMD;EAAA;IC/GE,2BAAA;IhEkzMC;EgEjzMD;IAAU,gBAAA;IhEozMT;EgEnzMD;IAAU,+BAAA;IhEszMT;EgErzMD;;IACU,gCAAA;IhEwzMT;EACF;A+DzsMD;EAAA;IAFI,2BAAA;I/D+sMD;EACF;A+DzsMD;EAAA;IAFI,4BAAA;I/D+sMD;EACF;A+DzsMD;EAAA;IAFI,kCAAA;I/D+sMD;EACF;A+DxsMD;EAAA;IC5HE,0BAAA;IhEw0MC;EACF;A+DxsMD;EAAA;ICjIE,0BAAA;IhE60MC;EACF;A+DxsMD;EAAA;ICtIE,0BAAA;IhEk1MC;EACF;A+DxsMD;EAAA;IC3IE,0BAAA;IhEu1MC;EACF;A+DrsMD;ECnJE,0BAAA;EhE21MD;A+DlsMD;EAAA;ICjKE,2BAAA;IhEu2MC;EgEt2MD;IAAU,gBAAA;IhEy2MT;EgEx2MD;IAAU,+BAAA;IhE22MT;EgE12MD;;IACU,gCAAA;IhE62MT;EACF;A+DhtMD;EACE,0BAAA;E/DktMD;A+D7sMD;EAAA;IAFI,2BAAA;I/DmtMD;EACF;A+DjtMD;EACE,0BAAA;E/DmtMD;A+D9sMD;EAAA;IAFI,4BAAA;I/DotMD;EACF;A+DltMD;EACE,0BAAA;E/DotMD;A+D/sMD;EAAA;IAFI,kCAAA;I/DqtMD;EACF;A+D9sMD;EAAA;ICpLE,0BAAA;IhEs4MC;EACF","file":"bootstrap.css","sourcesContent":["/*! normalize.css v3.0.2 | MIT License | git.io/normalize */\nhtml {\n font-family: sans-serif;\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n}\nbody {\n margin: 0;\n}\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block;\n vertical-align: baseline;\n}\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n[hidden],\ntemplate {\n display: none;\n}\na {\n background-color: transparent;\n}\na:active,\na:hover {\n outline: 0;\n}\nabbr[title] {\n border-bottom: 1px dotted;\n}\nb,\nstrong {\n font-weight: bold;\n}\ndfn {\n font-style: italic;\n}\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\nmark {\n background: #ff0;\n color: #000;\n}\nsmall {\n font-size: 80%;\n}\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsup {\n top: -0.5em;\n}\nsub {\n bottom: -0.25em;\n}\nimg {\n border: 0;\n}\nsvg:not(:root) {\n overflow: hidden;\n}\nfigure {\n margin: 1em 40px;\n}\nhr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n}\npre {\n overflow: auto;\n}\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit;\n font: inherit;\n margin: 0;\n}\nbutton {\n overflow: visible;\n}\nbutton,\nselect {\n text-transform: none;\n}\nbutton,\nhtml input[type=\"button\"],\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n cursor: pointer;\n}\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\ninput {\n line-height: normal;\n}\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n padding: 0;\n}\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\ninput[type=\"search\"] {\n -webkit-appearance: textfield;\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n}\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\nlegend {\n border: 0;\n padding: 0;\n}\ntextarea {\n overflow: auto;\n}\noptgroup {\n font-weight: bold;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\ntd,\nth {\n padding: 0;\n}\n/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n@media print {\n *,\n *:before,\n *:after {\n background: transparent !important;\n color: #000 !important;\n box-shadow: none !important;\n text-shadow: none !important;\n }\n a,\n a:visited {\n text-decoration: underline;\n }\n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n thead {\n display: table-header-group;\n }\n tr,\n img {\n page-break-inside: avoid;\n }\n img {\n max-width: 100% !important;\n }\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n h2,\n h3 {\n page-break-after: avoid;\n }\n select {\n background: #fff !important;\n }\n .navbar {\n display: none;\n }\n .btn > .caret,\n .dropup > .btn > .caret {\n border-top-color: #000 !important;\n }\n .label {\n border: 1px solid #000;\n }\n .table {\n border-collapse: collapse !important;\n }\n .table td,\n .table th {\n background-color: #fff !important;\n }\n .table-bordered th,\n .table-bordered td {\n border: 1px solid #ddd !important;\n }\n}\n@font-face {\n font-family: 'Glyphicons Halflings';\n src: url('../fonts/glyphicons-halflings-regular.eot');\n src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');\n}\n.glyphicon {\n position: relative;\n top: 1px;\n display: inline-block;\n font-family: 'Glyphicons Halflings';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.glyphicon-asterisk:before {\n content: \"\\2a\";\n}\n.glyphicon-plus:before {\n content: \"\\2b\";\n}\n.glyphicon-euro:before,\n.glyphicon-eur:before {\n content: \"\\20ac\";\n}\n.glyphicon-minus:before {\n content: \"\\2212\";\n}\n.glyphicon-cloud:before {\n content: \"\\2601\";\n}\n.glyphicon-envelope:before {\n content: \"\\2709\";\n}\n.glyphicon-pencil:before {\n content: \"\\270f\";\n}\n.glyphicon-glass:before {\n content: \"\\e001\";\n}\n.glyphicon-music:before {\n content: \"\\e002\";\n}\n.glyphicon-search:before {\n content: \"\\e003\";\n}\n.glyphicon-heart:before {\n content: \"\\e005\";\n}\n.glyphicon-star:before {\n content: \"\\e006\";\n}\n.glyphicon-star-empty:before {\n content: \"\\e007\";\n}\n.glyphicon-user:before {\n content: \"\\e008\";\n}\n.glyphicon-film:before {\n content: \"\\e009\";\n}\n.glyphicon-th-large:before {\n content: \"\\e010\";\n}\n.glyphicon-th:before {\n content: \"\\e011\";\n}\n.glyphicon-th-list:before {\n content: \"\\e012\";\n}\n.glyphicon-ok:before {\n content: \"\\e013\";\n}\n.glyphicon-remove:before {\n content: \"\\e014\";\n}\n.glyphicon-zoom-in:before {\n content: \"\\e015\";\n}\n.glyphicon-zoom-out:before {\n content: \"\\e016\";\n}\n.glyphicon-off:before {\n content: \"\\e017\";\n}\n.glyphicon-signal:before {\n content: \"\\e018\";\n}\n.glyphicon-cog:before {\n content: \"\\e019\";\n}\n.glyphicon-trash:before {\n content: \"\\e020\";\n}\n.glyphicon-home:before {\n content: \"\\e021\";\n}\n.glyphicon-file:before {\n content: \"\\e022\";\n}\n.glyphicon-time:before {\n content: \"\\e023\";\n}\n.glyphicon-road:before {\n content: \"\\e024\";\n}\n.glyphicon-download-alt:before {\n content: \"\\e025\";\n}\n.glyphicon-download:before {\n content: \"\\e026\";\n}\n.glyphicon-upload:before {\n content: \"\\e027\";\n}\n.glyphicon-inbox:before {\n content: \"\\e028\";\n}\n.glyphicon-play-circle:before {\n content: \"\\e029\";\n}\n.glyphicon-repeat:before {\n content: \"\\e030\";\n}\n.glyphicon-refresh:before {\n content: \"\\e031\";\n}\n.glyphicon-list-alt:before {\n content: \"\\e032\";\n}\n.glyphicon-lock:before {\n content: \"\\e033\";\n}\n.glyphicon-flag:before {\n content: \"\\e034\";\n}\n.glyphicon-headphones:before {\n content: \"\\e035\";\n}\n.glyphicon-volume-off:before {\n content: \"\\e036\";\n}\n.glyphicon-volume-down:before {\n content: \"\\e037\";\n}\n.glyphicon-volume-up:before {\n content: \"\\e038\";\n}\n.glyphicon-qrcode:before {\n content: \"\\e039\";\n}\n.glyphicon-barcode:before {\n content: \"\\e040\";\n}\n.glyphicon-tag:before {\n content: \"\\e041\";\n}\n.glyphicon-tags:before {\n content: \"\\e042\";\n}\n.glyphicon-book:before {\n content: \"\\e043\";\n}\n.glyphicon-bookmark:before {\n content: \"\\e044\";\n}\n.glyphicon-print:before {\n content: \"\\e045\";\n}\n.glyphicon-camera:before {\n content: \"\\e046\";\n}\n.glyphicon-font:before {\n content: \"\\e047\";\n}\n.glyphicon-bold:before {\n content: \"\\e048\";\n}\n.glyphicon-italic:before {\n content: \"\\e049\";\n}\n.glyphicon-text-height:before {\n content: \"\\e050\";\n}\n.glyphicon-text-width:before {\n content: \"\\e051\";\n}\n.glyphicon-align-left:before {\n content: \"\\e052\";\n}\n.glyphicon-align-center:before {\n content: \"\\e053\";\n}\n.glyphicon-align-right:before {\n content: \"\\e054\";\n}\n.glyphicon-align-justify:before {\n content: \"\\e055\";\n}\n.glyphicon-list:before {\n content: \"\\e056\";\n}\n.glyphicon-indent-left:before {\n content: \"\\e057\";\n}\n.glyphicon-indent-right:before {\n content: \"\\e058\";\n}\n.glyphicon-facetime-video:before {\n content: \"\\e059\";\n}\n.glyphicon-picture:before {\n content: \"\\e060\";\n}\n.glyphicon-map-marker:before {\n content: \"\\e062\";\n}\n.glyphicon-adjust:before {\n content: \"\\e063\";\n}\n.glyphicon-tint:before {\n content: \"\\e064\";\n}\n.glyphicon-edit:before {\n content: \"\\e065\";\n}\n.glyphicon-share:before {\n content: \"\\e066\";\n}\n.glyphicon-check:before {\n content: \"\\e067\";\n}\n.glyphicon-move:before {\n content: \"\\e068\";\n}\n.glyphicon-step-backward:before {\n content: \"\\e069\";\n}\n.glyphicon-fast-backward:before {\n content: \"\\e070\";\n}\n.glyphicon-backward:before {\n content: \"\\e071\";\n}\n.glyphicon-play:before {\n content: \"\\e072\";\n}\n.glyphicon-pause:before {\n content: \"\\e073\";\n}\n.glyphicon-stop:before {\n content: \"\\e074\";\n}\n.glyphicon-forward:before {\n content: \"\\e075\";\n}\n.glyphicon-fast-forward:before {\n content: \"\\e076\";\n}\n.glyphicon-step-forward:before {\n content: \"\\e077\";\n}\n.glyphicon-eject:before {\n content: \"\\e078\";\n}\n.glyphicon-chevron-left:before {\n content: \"\\e079\";\n}\n.glyphicon-chevron-right:before {\n content: \"\\e080\";\n}\n.glyphicon-plus-sign:before {\n content: \"\\e081\";\n}\n.glyphicon-minus-sign:before {\n content: \"\\e082\";\n}\n.glyphicon-remove-sign:before {\n content: \"\\e083\";\n}\n.glyphicon-ok-sign:before {\n content: \"\\e084\";\n}\n.glyphicon-question-sign:before {\n content: \"\\e085\";\n}\n.glyphicon-info-sign:before {\n content: \"\\e086\";\n}\n.glyphicon-screenshot:before {\n content: \"\\e087\";\n}\n.glyphicon-remove-circle:before {\n content: \"\\e088\";\n}\n.glyphicon-ok-circle:before {\n content: \"\\e089\";\n}\n.glyphicon-ban-circle:before {\n content: \"\\e090\";\n}\n.glyphicon-arrow-left:before {\n content: \"\\e091\";\n}\n.glyphicon-arrow-right:before {\n content: \"\\e092\";\n}\n.glyphicon-arrow-up:before {\n content: \"\\e093\";\n}\n.glyphicon-arrow-down:before {\n content: \"\\e094\";\n}\n.glyphicon-share-alt:before {\n content: \"\\e095\";\n}\n.glyphicon-resize-full:before {\n content: \"\\e096\";\n}\n.glyphicon-resize-small:before {\n content: \"\\e097\";\n}\n.glyphicon-exclamation-sign:before {\n content: \"\\e101\";\n}\n.glyphicon-gift:before {\n content: \"\\e102\";\n}\n.glyphicon-leaf:before {\n content: \"\\e103\";\n}\n.glyphicon-fire:before {\n content: \"\\e104\";\n}\n.glyphicon-eye-open:before {\n content: \"\\e105\";\n}\n.glyphicon-eye-close:before {\n content: \"\\e106\";\n}\n.glyphicon-warning-sign:before {\n content: \"\\e107\";\n}\n.glyphicon-plane:before {\n content: \"\\e108\";\n}\n.glyphicon-calendar:before {\n content: \"\\e109\";\n}\n.glyphicon-random:before {\n content: \"\\e110\";\n}\n.glyphicon-comment:before {\n content: \"\\e111\";\n}\n.glyphicon-magnet:before {\n content: \"\\e112\";\n}\n.glyphicon-chevron-up:before {\n content: \"\\e113\";\n}\n.glyphicon-chevron-down:before {\n content: \"\\e114\";\n}\n.glyphicon-retweet:before {\n content: \"\\e115\";\n}\n.glyphicon-shopping-cart:before {\n content: \"\\e116\";\n}\n.glyphicon-folder-close:before {\n content: \"\\e117\";\n}\n.glyphicon-folder-open:before {\n content: \"\\e118\";\n}\n.glyphicon-resize-vertical:before {\n content: \"\\e119\";\n}\n.glyphicon-resize-horizontal:before {\n content: \"\\e120\";\n}\n.glyphicon-hdd:before {\n content: \"\\e121\";\n}\n.glyphicon-bullhorn:before {\n content: \"\\e122\";\n}\n.glyphicon-bell:before {\n content: \"\\e123\";\n}\n.glyphicon-certificate:before {\n content: \"\\e124\";\n}\n.glyphicon-thumbs-up:before {\n content: \"\\e125\";\n}\n.glyphicon-thumbs-down:before {\n content: \"\\e126\";\n}\n.glyphicon-hand-right:before {\n content: \"\\e127\";\n}\n.glyphicon-hand-left:before {\n content: \"\\e128\";\n}\n.glyphicon-hand-up:before {\n content: \"\\e129\";\n}\n.glyphicon-hand-down:before {\n content: \"\\e130\";\n}\n.glyphicon-circle-arrow-right:before {\n content: \"\\e131\";\n}\n.glyphicon-circle-arrow-left:before {\n content: \"\\e132\";\n}\n.glyphicon-circle-arrow-up:before {\n content: \"\\e133\";\n}\n.glyphicon-circle-arrow-down:before {\n content: \"\\e134\";\n}\n.glyphicon-globe:before {\n content: \"\\e135\";\n}\n.glyphicon-wrench:before {\n content: \"\\e136\";\n}\n.glyphicon-tasks:before {\n content: \"\\e137\";\n}\n.glyphicon-filter:before {\n content: \"\\e138\";\n}\n.glyphicon-briefcase:before {\n content: \"\\e139\";\n}\n.glyphicon-fullscreen:before {\n content: \"\\e140\";\n}\n.glyphicon-dashboard:before {\n content: \"\\e141\";\n}\n.glyphicon-paperclip:before {\n content: \"\\e142\";\n}\n.glyphicon-heart-empty:before {\n content: \"\\e143\";\n}\n.glyphicon-link:before {\n content: \"\\e144\";\n}\n.glyphicon-phone:before {\n content: \"\\e145\";\n}\n.glyphicon-pushpin:before {\n content: \"\\e146\";\n}\n.glyphicon-usd:before {\n content: \"\\e148\";\n}\n.glyphicon-gbp:before {\n content: \"\\e149\";\n}\n.glyphicon-sort:before {\n content: \"\\e150\";\n}\n.glyphicon-sort-by-alphabet:before {\n content: \"\\e151\";\n}\n.glyphicon-sort-by-alphabet-alt:before {\n content: \"\\e152\";\n}\n.glyphicon-sort-by-order:before {\n content: \"\\e153\";\n}\n.glyphicon-sort-by-order-alt:before {\n content: \"\\e154\";\n}\n.glyphicon-sort-by-attributes:before {\n content: \"\\e155\";\n}\n.glyphicon-sort-by-attributes-alt:before {\n content: \"\\e156\";\n}\n.glyphicon-unchecked:before {\n content: \"\\e157\";\n}\n.glyphicon-expand:before {\n content: \"\\e158\";\n}\n.glyphicon-collapse-down:before {\n content: \"\\e159\";\n}\n.glyphicon-collapse-up:before {\n content: \"\\e160\";\n}\n.glyphicon-log-in:before {\n content: \"\\e161\";\n}\n.glyphicon-flash:before {\n content: \"\\e162\";\n}\n.glyphicon-log-out:before {\n content: \"\\e163\";\n}\n.glyphicon-new-window:before {\n content: \"\\e164\";\n}\n.glyphicon-record:before {\n content: \"\\e165\";\n}\n.glyphicon-save:before {\n content: \"\\e166\";\n}\n.glyphicon-open:before {\n content: \"\\e167\";\n}\n.glyphicon-saved:before {\n content: \"\\e168\";\n}\n.glyphicon-import:before {\n content: \"\\e169\";\n}\n.glyphicon-export:before {\n content: \"\\e170\";\n}\n.glyphicon-send:before {\n content: \"\\e171\";\n}\n.glyphicon-floppy-disk:before {\n content: \"\\e172\";\n}\n.glyphicon-floppy-saved:before {\n content: \"\\e173\";\n}\n.glyphicon-floppy-remove:before {\n content: \"\\e174\";\n}\n.glyphicon-floppy-save:before {\n content: \"\\e175\";\n}\n.glyphicon-floppy-open:before {\n content: \"\\e176\";\n}\n.glyphicon-credit-card:before {\n content: \"\\e177\";\n}\n.glyphicon-transfer:before {\n content: \"\\e178\";\n}\n.glyphicon-cutlery:before {\n content: \"\\e179\";\n}\n.glyphicon-header:before {\n content: \"\\e180\";\n}\n.glyphicon-compressed:before {\n content: \"\\e181\";\n}\n.glyphicon-earphone:before {\n content: \"\\e182\";\n}\n.glyphicon-phone-alt:before {\n content: \"\\e183\";\n}\n.glyphicon-tower:before {\n content: \"\\e184\";\n}\n.glyphicon-stats:before {\n content: \"\\e185\";\n}\n.glyphicon-sd-video:before {\n content: \"\\e186\";\n}\n.glyphicon-hd-video:before {\n content: \"\\e187\";\n}\n.glyphicon-subtitles:before {\n content: \"\\e188\";\n}\n.glyphicon-sound-stereo:before {\n content: \"\\e189\";\n}\n.glyphicon-sound-dolby:before {\n content: \"\\e190\";\n}\n.glyphicon-sound-5-1:before {\n content: \"\\e191\";\n}\n.glyphicon-sound-6-1:before {\n content: \"\\e192\";\n}\n.glyphicon-sound-7-1:before {\n content: \"\\e193\";\n}\n.glyphicon-copyright-mark:before {\n content: \"\\e194\";\n}\n.glyphicon-registration-mark:before {\n content: \"\\e195\";\n}\n.glyphicon-cloud-download:before {\n content: \"\\e197\";\n}\n.glyphicon-cloud-upload:before {\n content: \"\\e198\";\n}\n.glyphicon-tree-conifer:before {\n content: \"\\e199\";\n}\n.glyphicon-tree-deciduous:before {\n content: \"\\e200\";\n}\n.glyphicon-cd:before {\n content: \"\\e201\";\n}\n.glyphicon-save-file:before {\n content: \"\\e202\";\n}\n.glyphicon-open-file:before {\n content: \"\\e203\";\n}\n.glyphicon-level-up:before {\n content: \"\\e204\";\n}\n.glyphicon-copy:before {\n content: \"\\e205\";\n}\n.glyphicon-paste:before {\n content: \"\\e206\";\n}\n.glyphicon-alert:before {\n content: \"\\e209\";\n}\n.glyphicon-equalizer:before {\n content: \"\\e210\";\n}\n.glyphicon-king:before {\n content: \"\\e211\";\n}\n.glyphicon-queen:before {\n content: \"\\e212\";\n}\n.glyphicon-pawn:before {\n content: \"\\e213\";\n}\n.glyphicon-bishop:before {\n content: \"\\e214\";\n}\n.glyphicon-knight:before {\n content: \"\\e215\";\n}\n.glyphicon-baby-formula:before {\n content: \"\\e216\";\n}\n.glyphicon-tent:before {\n content: \"\\26fa\";\n}\n.glyphicon-blackboard:before {\n content: \"\\e218\";\n}\n.glyphicon-bed:before {\n content: \"\\e219\";\n}\n.glyphicon-apple:before {\n content: \"\\f8ff\";\n}\n.glyphicon-erase:before {\n content: \"\\e221\";\n}\n.glyphicon-hourglass:before {\n content: \"\\231b\";\n}\n.glyphicon-lamp:before {\n content: \"\\e223\";\n}\n.glyphicon-duplicate:before {\n content: \"\\e224\";\n}\n.glyphicon-piggy-bank:before {\n content: \"\\e225\";\n}\n.glyphicon-scissors:before {\n content: \"\\e226\";\n}\n.glyphicon-bitcoin:before {\n content: \"\\e227\";\n}\n.glyphicon-btc:before {\n content: \"\\e227\";\n}\n.glyphicon-xbt:before {\n content: \"\\e227\";\n}\n.glyphicon-yen:before {\n content: \"\\00a5\";\n}\n.glyphicon-jpy:before {\n content: \"\\00a5\";\n}\n.glyphicon-ruble:before {\n content: \"\\20bd\";\n}\n.glyphicon-rub:before {\n content: \"\\20bd\";\n}\n.glyphicon-scale:before {\n content: \"\\e230\";\n}\n.glyphicon-ice-lolly:before {\n content: \"\\e231\";\n}\n.glyphicon-ice-lolly-tasted:before {\n content: \"\\e232\";\n}\n.glyphicon-education:before {\n content: \"\\e233\";\n}\n.glyphicon-option-horizontal:before {\n content: \"\\e234\";\n}\n.glyphicon-option-vertical:before {\n content: \"\\e235\";\n}\n.glyphicon-menu-hamburger:before {\n content: \"\\e236\";\n}\n.glyphicon-modal-window:before {\n content: \"\\e237\";\n}\n.glyphicon-oil:before {\n content: \"\\e238\";\n}\n.glyphicon-grain:before {\n content: \"\\e239\";\n}\n.glyphicon-sunglasses:before {\n content: \"\\e240\";\n}\n.glyphicon-text-size:before {\n content: \"\\e241\";\n}\n.glyphicon-text-color:before {\n content: \"\\e242\";\n}\n.glyphicon-text-background:before {\n content: \"\\e243\";\n}\n.glyphicon-object-align-top:before {\n content: \"\\e244\";\n}\n.glyphicon-object-align-bottom:before {\n content: \"\\e245\";\n}\n.glyphicon-object-align-horizontal:before {\n content: \"\\e246\";\n}\n.glyphicon-object-align-left:before {\n content: \"\\e247\";\n}\n.glyphicon-object-align-vertical:before {\n content: \"\\e248\";\n}\n.glyphicon-object-align-right:before {\n content: \"\\e249\";\n}\n.glyphicon-triangle-right:before {\n content: \"\\e250\";\n}\n.glyphicon-triangle-left:before {\n content: \"\\e251\";\n}\n.glyphicon-triangle-bottom:before {\n content: \"\\e252\";\n}\n.glyphicon-triangle-top:before {\n content: \"\\e253\";\n}\n.glyphicon-console:before {\n content: \"\\e254\";\n}\n.glyphicon-superscript:before {\n content: \"\\e255\";\n}\n.glyphicon-subscript:before {\n content: \"\\e256\";\n}\n.glyphicon-menu-left:before {\n content: \"\\e257\";\n}\n.glyphicon-menu-right:before {\n content: \"\\e258\";\n}\n.glyphicon-menu-down:before {\n content: \"\\e259\";\n}\n.glyphicon-menu-up:before {\n content: \"\\e260\";\n}\n* {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n*:before,\n*:after {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\nhtml {\n font-size: 10px;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n line-height: 1.42857143;\n color: #333333;\n background-color: #ffffff;\n}\ninput,\nbutton,\nselect,\ntextarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\na {\n color: #337ab7;\n text-decoration: none;\n}\na:hover,\na:focus {\n color: #23527c;\n text-decoration: underline;\n}\na:focus {\n outline: thin dotted;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\nfigure {\n margin: 0;\n}\nimg {\n vertical-align: middle;\n}\n.img-responsive,\n.thumbnail > img,\n.thumbnail a > img,\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.img-rounded {\n border-radius: 6px;\n}\n.img-thumbnail {\n padding: 4px;\n line-height: 1.42857143;\n background-color: #ffffff;\n border: 1px solid #dddddd;\n border-radius: 4px;\n -webkit-transition: all 0.2s ease-in-out;\n -o-transition: all 0.2s ease-in-out;\n transition: all 0.2s ease-in-out;\n display: inline-block;\n max-width: 100%;\n height: auto;\n}\n.img-circle {\n border-radius: 50%;\n}\nhr {\n margin-top: 20px;\n margin-bottom: 20px;\n border: 0;\n border-top: 1px solid #eeeeee;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n}\n.sr-only-focusable:active,\n.sr-only-focusable:focus {\n position: static;\n width: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n clip: auto;\n}\n[role=\"button\"] {\n cursor: pointer;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n font-family: inherit;\n font-weight: 500;\n line-height: 1.1;\n color: inherit;\n}\nh1 small,\nh2 small,\nh3 small,\nh4 small,\nh5 small,\nh6 small,\n.h1 small,\n.h2 small,\n.h3 small,\n.h4 small,\n.h5 small,\n.h6 small,\nh1 .small,\nh2 .small,\nh3 .small,\nh4 .small,\nh5 .small,\nh6 .small,\n.h1 .small,\n.h2 .small,\n.h3 .small,\n.h4 .small,\n.h5 .small,\n.h6 .small {\n font-weight: normal;\n line-height: 1;\n color: #777777;\n}\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: 20px;\n margin-bottom: 10px;\n}\nh1 small,\n.h1 small,\nh2 small,\n.h2 small,\nh3 small,\n.h3 small,\nh1 .small,\n.h1 .small,\nh2 .small,\n.h2 .small,\nh3 .small,\n.h3 .small {\n font-size: 65%;\n}\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: 10px;\n margin-bottom: 10px;\n}\nh4 small,\n.h4 small,\nh5 small,\n.h5 small,\nh6 small,\n.h6 small,\nh4 .small,\n.h4 .small,\nh5 .small,\n.h5 .small,\nh6 .small,\n.h6 .small {\n font-size: 75%;\n}\nh1,\n.h1 {\n font-size: 36px;\n}\nh2,\n.h2 {\n font-size: 30px;\n}\nh3,\n.h3 {\n font-size: 24px;\n}\nh4,\n.h4 {\n font-size: 18px;\n}\nh5,\n.h5 {\n font-size: 14px;\n}\nh6,\n.h6 {\n font-size: 12px;\n}\np {\n margin: 0 0 10px;\n}\n.lead {\n margin-bottom: 20px;\n font-size: 16px;\n font-weight: 300;\n line-height: 1.4;\n}\n@media (min-width: 768px) {\n .lead {\n font-size: 21px;\n }\n}\nsmall,\n.small {\n font-size: 85%;\n}\nmark,\n.mark {\n background-color: #fcf8e3;\n padding: .2em;\n}\n.text-left {\n text-align: left;\n}\n.text-right {\n text-align: right;\n}\n.text-center {\n text-align: center;\n}\n.text-justify {\n text-align: justify;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-lowercase {\n text-transform: lowercase;\n}\n.text-uppercase {\n text-transform: uppercase;\n}\n.text-capitalize {\n text-transform: capitalize;\n}\n.text-muted {\n color: #777777;\n}\n.text-primary {\n color: #337ab7;\n}\na.text-primary:hover {\n color: #286090;\n}\n.text-success {\n color: #3c763d;\n}\na.text-success:hover {\n color: #2b542c;\n}\n.text-info {\n color: #31708f;\n}\na.text-info:hover {\n color: #245269;\n}\n.text-warning {\n color: #8a6d3b;\n}\na.text-warning:hover {\n color: #66512c;\n}\n.text-danger {\n color: #a94442;\n}\na.text-danger:hover {\n color: #843534;\n}\n.bg-primary {\n color: #fff;\n background-color: #337ab7;\n}\na.bg-primary:hover {\n background-color: #286090;\n}\n.bg-success {\n background-color: #dff0d8;\n}\na.bg-success:hover {\n background-color: #c1e2b3;\n}\n.bg-info {\n background-color: #d9edf7;\n}\na.bg-info:hover {\n background-color: #afd9ee;\n}\n.bg-warning {\n background-color: #fcf8e3;\n}\na.bg-warning:hover {\n background-color: #f7ecb5;\n}\n.bg-danger {\n background-color: #f2dede;\n}\na.bg-danger:hover {\n background-color: #e4b9b9;\n}\n.page-header {\n padding-bottom: 9px;\n margin: 40px 0 20px;\n border-bottom: 1px solid #eeeeee;\n}\nul,\nol {\n margin-top: 0;\n margin-bottom: 10px;\n}\nul ul,\nol ul,\nul ol,\nol ol {\n margin-bottom: 0;\n}\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n.list-inline {\n padding-left: 0;\n list-style: none;\n margin-left: -5px;\n}\n.list-inline > li {\n display: inline-block;\n padding-left: 5px;\n padding-right: 5px;\n}\ndl {\n margin-top: 0;\n margin-bottom: 20px;\n}\ndt,\ndd {\n line-height: 1.42857143;\n}\ndt {\n font-weight: bold;\n}\ndd {\n margin-left: 0;\n}\n@media (min-width: 768px) {\n .dl-horizontal dt {\n float: left;\n width: 160px;\n clear: left;\n text-align: right;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .dl-horizontal dd {\n margin-left: 180px;\n }\n}\nabbr[title],\nabbr[data-original-title] {\n cursor: help;\n border-bottom: 1px dotted #777777;\n}\n.initialism {\n font-size: 90%;\n text-transform: uppercase;\n}\nblockquote {\n padding: 10px 20px;\n margin: 0 0 20px;\n font-size: 17.5px;\n border-left: 5px solid #eeeeee;\n}\nblockquote p:last-child,\nblockquote ul:last-child,\nblockquote ol:last-child {\n margin-bottom: 0;\n}\nblockquote footer,\nblockquote small,\nblockquote .small {\n display: block;\n font-size: 80%;\n line-height: 1.42857143;\n color: #777777;\n}\nblockquote footer:before,\nblockquote small:before,\nblockquote .small:before {\n content: '\\2014 \\00A0';\n}\n.blockquote-reverse,\nblockquote.pull-right {\n padding-right: 15px;\n padding-left: 0;\n border-right: 5px solid #eeeeee;\n border-left: 0;\n text-align: right;\n}\n.blockquote-reverse footer:before,\nblockquote.pull-right footer:before,\n.blockquote-reverse small:before,\nblockquote.pull-right small:before,\n.blockquote-reverse .small:before,\nblockquote.pull-right .small:before {\n content: '';\n}\n.blockquote-reverse footer:after,\nblockquote.pull-right footer:after,\n.blockquote-reverse small:after,\nblockquote.pull-right small:after,\n.blockquote-reverse .small:after,\nblockquote.pull-right .small:after {\n content: '\\00A0 \\2014';\n}\naddress {\n margin-bottom: 20px;\n font-style: normal;\n line-height: 1.42857143;\n}\ncode,\nkbd,\npre,\nsamp {\n font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\ncode {\n padding: 2px 4px;\n font-size: 90%;\n color: #c7254e;\n background-color: #f9f2f4;\n border-radius: 4px;\n}\nkbd {\n padding: 2px 4px;\n font-size: 90%;\n color: #ffffff;\n background-color: #333333;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\nkbd kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n box-shadow: none;\n}\npre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333333;\n background-color: #f5f5f5;\n border: 1px solid #cccccc;\n border-radius: 4px;\n}\npre code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n white-space: pre-wrap;\n background-color: transparent;\n border-radius: 0;\n}\n.pre-scrollable {\n max-height: 340px;\n overflow-y: scroll;\n}\n.container {\n margin-right: auto;\n margin-left: auto;\n padding-left: 15px;\n padding-right: 15px;\n}\n@media (min-width: 768px) {\n .container {\n width: 750px;\n }\n}\n@media (min-width: 992px) {\n .container {\n width: 970px;\n }\n}\n@media (min-width: 1200px) {\n .container {\n width: 1170px;\n }\n}\n.container-fluid {\n margin-right: auto;\n margin-left: auto;\n padding-left: 15px;\n padding-right: 15px;\n}\n.row {\n margin-left: -15px;\n margin-right: -15px;\n}\n.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {\n position: relative;\n min-height: 1px;\n padding-left: 15px;\n padding-right: 15px;\n}\n.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {\n float: left;\n}\n.col-xs-12 {\n width: 100%;\n}\n.col-xs-11 {\n width: 91.66666667%;\n}\n.col-xs-10 {\n width: 83.33333333%;\n}\n.col-xs-9 {\n width: 75%;\n}\n.col-xs-8 {\n width: 66.66666667%;\n}\n.col-xs-7 {\n width: 58.33333333%;\n}\n.col-xs-6 {\n width: 50%;\n}\n.col-xs-5 {\n width: 41.66666667%;\n}\n.col-xs-4 {\n width: 33.33333333%;\n}\n.col-xs-3 {\n width: 25%;\n}\n.col-xs-2 {\n width: 16.66666667%;\n}\n.col-xs-1 {\n width: 8.33333333%;\n}\n.col-xs-pull-12 {\n right: 100%;\n}\n.col-xs-pull-11 {\n right: 91.66666667%;\n}\n.col-xs-pull-10 {\n right: 83.33333333%;\n}\n.col-xs-pull-9 {\n right: 75%;\n}\n.col-xs-pull-8 {\n right: 66.66666667%;\n}\n.col-xs-pull-7 {\n right: 58.33333333%;\n}\n.col-xs-pull-6 {\n right: 50%;\n}\n.col-xs-pull-5 {\n right: 41.66666667%;\n}\n.col-xs-pull-4 {\n right: 33.33333333%;\n}\n.col-xs-pull-3 {\n right: 25%;\n}\n.col-xs-pull-2 {\n right: 16.66666667%;\n}\n.col-xs-pull-1 {\n right: 8.33333333%;\n}\n.col-xs-pull-0 {\n right: auto;\n}\n.col-xs-push-12 {\n left: 100%;\n}\n.col-xs-push-11 {\n left: 91.66666667%;\n}\n.col-xs-push-10 {\n left: 83.33333333%;\n}\n.col-xs-push-9 {\n left: 75%;\n}\n.col-xs-push-8 {\n left: 66.66666667%;\n}\n.col-xs-push-7 {\n left: 58.33333333%;\n}\n.col-xs-push-6 {\n left: 50%;\n}\n.col-xs-push-5 {\n left: 41.66666667%;\n}\n.col-xs-push-4 {\n left: 33.33333333%;\n}\n.col-xs-push-3 {\n left: 25%;\n}\n.col-xs-push-2 {\n left: 16.66666667%;\n}\n.col-xs-push-1 {\n left: 8.33333333%;\n}\n.col-xs-push-0 {\n left: auto;\n}\n.col-xs-offset-12 {\n margin-left: 100%;\n}\n.col-xs-offset-11 {\n margin-left: 91.66666667%;\n}\n.col-xs-offset-10 {\n margin-left: 83.33333333%;\n}\n.col-xs-offset-9 {\n margin-left: 75%;\n}\n.col-xs-offset-8 {\n margin-left: 66.66666667%;\n}\n.col-xs-offset-7 {\n margin-left: 58.33333333%;\n}\n.col-xs-offset-6 {\n margin-left: 50%;\n}\n.col-xs-offset-5 {\n margin-left: 41.66666667%;\n}\n.col-xs-offset-4 {\n margin-left: 33.33333333%;\n}\n.col-xs-offset-3 {\n margin-left: 25%;\n}\n.col-xs-offset-2 {\n margin-left: 16.66666667%;\n}\n.col-xs-offset-1 {\n margin-left: 8.33333333%;\n}\n.col-xs-offset-0 {\n margin-left: 0%;\n}\n@media (min-width: 768px) {\n .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {\n float: left;\n }\n .col-sm-12 {\n width: 100%;\n }\n .col-sm-11 {\n width: 91.66666667%;\n }\n .col-sm-10 {\n width: 83.33333333%;\n }\n .col-sm-9 {\n width: 75%;\n }\n .col-sm-8 {\n width: 66.66666667%;\n }\n .col-sm-7 {\n width: 58.33333333%;\n }\n .col-sm-6 {\n width: 50%;\n }\n .col-sm-5 {\n width: 41.66666667%;\n }\n .col-sm-4 {\n width: 33.33333333%;\n }\n .col-sm-3 {\n width: 25%;\n }\n .col-sm-2 {\n width: 16.66666667%;\n }\n .col-sm-1 {\n width: 8.33333333%;\n }\n .col-sm-pull-12 {\n right: 100%;\n }\n .col-sm-pull-11 {\n right: 91.66666667%;\n }\n .col-sm-pull-10 {\n right: 83.33333333%;\n }\n .col-sm-pull-9 {\n right: 75%;\n }\n .col-sm-pull-8 {\n right: 66.66666667%;\n }\n .col-sm-pull-7 {\n right: 58.33333333%;\n }\n .col-sm-pull-6 {\n right: 50%;\n }\n .col-sm-pull-5 {\n right: 41.66666667%;\n }\n .col-sm-pull-4 {\n right: 33.33333333%;\n }\n .col-sm-pull-3 {\n right: 25%;\n }\n .col-sm-pull-2 {\n right: 16.66666667%;\n }\n .col-sm-pull-1 {\n right: 8.33333333%;\n }\n .col-sm-pull-0 {\n right: auto;\n }\n .col-sm-push-12 {\n left: 100%;\n }\n .col-sm-push-11 {\n left: 91.66666667%;\n }\n .col-sm-push-10 {\n left: 83.33333333%;\n }\n .col-sm-push-9 {\n left: 75%;\n }\n .col-sm-push-8 {\n left: 66.66666667%;\n }\n .col-sm-push-7 {\n left: 58.33333333%;\n }\n .col-sm-push-6 {\n left: 50%;\n }\n .col-sm-push-5 {\n left: 41.66666667%;\n }\n .col-sm-push-4 {\n left: 33.33333333%;\n }\n .col-sm-push-3 {\n left: 25%;\n }\n .col-sm-push-2 {\n left: 16.66666667%;\n }\n .col-sm-push-1 {\n left: 8.33333333%;\n }\n .col-sm-push-0 {\n left: auto;\n }\n .col-sm-offset-12 {\n margin-left: 100%;\n }\n .col-sm-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-sm-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-sm-offset-9 {\n margin-left: 75%;\n }\n .col-sm-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-sm-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-sm-offset-6 {\n margin-left: 50%;\n }\n .col-sm-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-sm-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-sm-offset-3 {\n margin-left: 25%;\n }\n .col-sm-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-sm-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-sm-offset-0 {\n margin-left: 0%;\n }\n}\n@media (min-width: 992px) {\n .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {\n float: left;\n }\n .col-md-12 {\n width: 100%;\n }\n .col-md-11 {\n width: 91.66666667%;\n }\n .col-md-10 {\n width: 83.33333333%;\n }\n .col-md-9 {\n width: 75%;\n }\n .col-md-8 {\n width: 66.66666667%;\n }\n .col-md-7 {\n width: 58.33333333%;\n }\n .col-md-6 {\n width: 50%;\n }\n .col-md-5 {\n width: 41.66666667%;\n }\n .col-md-4 {\n width: 33.33333333%;\n }\n .col-md-3 {\n width: 25%;\n }\n .col-md-2 {\n width: 16.66666667%;\n }\n .col-md-1 {\n width: 8.33333333%;\n }\n .col-md-pull-12 {\n right: 100%;\n }\n .col-md-pull-11 {\n right: 91.66666667%;\n }\n .col-md-pull-10 {\n right: 83.33333333%;\n }\n .col-md-pull-9 {\n right: 75%;\n }\n .col-md-pull-8 {\n right: 66.66666667%;\n }\n .col-md-pull-7 {\n right: 58.33333333%;\n }\n .col-md-pull-6 {\n right: 50%;\n }\n .col-md-pull-5 {\n right: 41.66666667%;\n }\n .col-md-pull-4 {\n right: 33.33333333%;\n }\n .col-md-pull-3 {\n right: 25%;\n }\n .col-md-pull-2 {\n right: 16.66666667%;\n }\n .col-md-pull-1 {\n right: 8.33333333%;\n }\n .col-md-pull-0 {\n right: auto;\n }\n .col-md-push-12 {\n left: 100%;\n }\n .col-md-push-11 {\n left: 91.66666667%;\n }\n .col-md-push-10 {\n left: 83.33333333%;\n }\n .col-md-push-9 {\n left: 75%;\n }\n .col-md-push-8 {\n left: 66.66666667%;\n }\n .col-md-push-7 {\n left: 58.33333333%;\n }\n .col-md-push-6 {\n left: 50%;\n }\n .col-md-push-5 {\n left: 41.66666667%;\n }\n .col-md-push-4 {\n left: 33.33333333%;\n }\n .col-md-push-3 {\n left: 25%;\n }\n .col-md-push-2 {\n left: 16.66666667%;\n }\n .col-md-push-1 {\n left: 8.33333333%;\n }\n .col-md-push-0 {\n left: auto;\n }\n .col-md-offset-12 {\n margin-left: 100%;\n }\n .col-md-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-md-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-md-offset-9 {\n margin-left: 75%;\n }\n .col-md-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-md-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-md-offset-6 {\n margin-left: 50%;\n }\n .col-md-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-md-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-md-offset-3 {\n margin-left: 25%;\n }\n .col-md-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-md-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-md-offset-0 {\n margin-left: 0%;\n }\n}\n@media (min-width: 1200px) {\n .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {\n float: left;\n }\n .col-lg-12 {\n width: 100%;\n }\n .col-lg-11 {\n width: 91.66666667%;\n }\n .col-lg-10 {\n width: 83.33333333%;\n }\n .col-lg-9 {\n width: 75%;\n }\n .col-lg-8 {\n width: 66.66666667%;\n }\n .col-lg-7 {\n width: 58.33333333%;\n }\n .col-lg-6 {\n width: 50%;\n }\n .col-lg-5 {\n width: 41.66666667%;\n }\n .col-lg-4 {\n width: 33.33333333%;\n }\n .col-lg-3 {\n width: 25%;\n }\n .col-lg-2 {\n width: 16.66666667%;\n }\n .col-lg-1 {\n width: 8.33333333%;\n }\n .col-lg-pull-12 {\n right: 100%;\n }\n .col-lg-pull-11 {\n right: 91.66666667%;\n }\n .col-lg-pull-10 {\n right: 83.33333333%;\n }\n .col-lg-pull-9 {\n right: 75%;\n }\n .col-lg-pull-8 {\n right: 66.66666667%;\n }\n .col-lg-pull-7 {\n right: 58.33333333%;\n }\n .col-lg-pull-6 {\n right: 50%;\n }\n .col-lg-pull-5 {\n right: 41.66666667%;\n }\n .col-lg-pull-4 {\n right: 33.33333333%;\n }\n .col-lg-pull-3 {\n right: 25%;\n }\n .col-lg-pull-2 {\n right: 16.66666667%;\n }\n .col-lg-pull-1 {\n right: 8.33333333%;\n }\n .col-lg-pull-0 {\n right: auto;\n }\n .col-lg-push-12 {\n left: 100%;\n }\n .col-lg-push-11 {\n left: 91.66666667%;\n }\n .col-lg-push-10 {\n left: 83.33333333%;\n }\n .col-lg-push-9 {\n left: 75%;\n }\n .col-lg-push-8 {\n left: 66.66666667%;\n }\n .col-lg-push-7 {\n left: 58.33333333%;\n }\n .col-lg-push-6 {\n left: 50%;\n }\n .col-lg-push-5 {\n left: 41.66666667%;\n }\n .col-lg-push-4 {\n left: 33.33333333%;\n }\n .col-lg-push-3 {\n left: 25%;\n }\n .col-lg-push-2 {\n left: 16.66666667%;\n }\n .col-lg-push-1 {\n left: 8.33333333%;\n }\n .col-lg-push-0 {\n left: auto;\n }\n .col-lg-offset-12 {\n margin-left: 100%;\n }\n .col-lg-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-lg-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-lg-offset-9 {\n margin-left: 75%;\n }\n .col-lg-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-lg-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-lg-offset-6 {\n margin-left: 50%;\n }\n .col-lg-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-lg-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-lg-offset-3 {\n margin-left: 25%;\n }\n .col-lg-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-lg-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-lg-offset-0 {\n margin-left: 0%;\n }\n}\ntable {\n background-color: transparent;\n}\ncaption {\n padding-top: 8px;\n padding-bottom: 8px;\n color: #777777;\n text-align: left;\n}\nth {\n text-align: left;\n}\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: 20px;\n}\n.table > thead > tr > th,\n.table > tbody > tr > th,\n.table > tfoot > tr > th,\n.table > thead > tr > td,\n.table > tbody > tr > td,\n.table > tfoot > tr > td {\n padding: 8px;\n line-height: 1.42857143;\n vertical-align: top;\n border-top: 1px solid #dddddd;\n}\n.table > thead > tr > th {\n vertical-align: bottom;\n border-bottom: 2px solid #dddddd;\n}\n.table > caption + thead > tr:first-child > th,\n.table > colgroup + thead > tr:first-child > th,\n.table > thead:first-child > tr:first-child > th,\n.table > caption + thead > tr:first-child > td,\n.table > colgroup + thead > tr:first-child > td,\n.table > thead:first-child > tr:first-child > td {\n border-top: 0;\n}\n.table > tbody + tbody {\n border-top: 2px solid #dddddd;\n}\n.table .table {\n background-color: #ffffff;\n}\n.table-condensed > thead > tr > th,\n.table-condensed > tbody > tr > th,\n.table-condensed > tfoot > tr > th,\n.table-condensed > thead > tr > td,\n.table-condensed > tbody > tr > td,\n.table-condensed > tfoot > tr > td {\n padding: 5px;\n}\n.table-bordered {\n border: 1px solid #dddddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > tbody > tr > th,\n.table-bordered > tfoot > tr > th,\n.table-bordered > thead > tr > td,\n.table-bordered > tbody > tr > td,\n.table-bordered > tfoot > tr > td {\n border: 1px solid #dddddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > thead > tr > td {\n border-bottom-width: 2px;\n}\n.table-striped > tbody > tr:nth-of-type(odd) {\n background-color: #f9f9f9;\n}\n.table-hover > tbody > tr:hover {\n background-color: #f5f5f5;\n}\ntable col[class*=\"col-\"] {\n position: static;\n float: none;\n display: table-column;\n}\ntable td[class*=\"col-\"],\ntable th[class*=\"col-\"] {\n position: static;\n float: none;\n display: table-cell;\n}\n.table > thead > tr > td.active,\n.table > tbody > tr > td.active,\n.table > tfoot > tr > td.active,\n.table > thead > tr > th.active,\n.table > tbody > tr > th.active,\n.table > tfoot > tr > th.active,\n.table > thead > tr.active > td,\n.table > tbody > tr.active > td,\n.table > tfoot > tr.active > td,\n.table > thead > tr.active > th,\n.table > tbody > tr.active > th,\n.table > tfoot > tr.active > th {\n background-color: #f5f5f5;\n}\n.table-hover > tbody > tr > td.active:hover,\n.table-hover > tbody > tr > th.active:hover,\n.table-hover > tbody > tr.active:hover > td,\n.table-hover > tbody > tr:hover > .active,\n.table-hover > tbody > tr.active:hover > th {\n background-color: #e8e8e8;\n}\n.table > thead > tr > td.success,\n.table > tbody > tr > td.success,\n.table > tfoot > tr > td.success,\n.table > thead > tr > th.success,\n.table > tbody > tr > th.success,\n.table > tfoot > tr > th.success,\n.table > thead > tr.success > td,\n.table > tbody > tr.success > td,\n.table > tfoot > tr.success > td,\n.table > thead > tr.success > th,\n.table > tbody > tr.success > th,\n.table > tfoot > tr.success > th {\n background-color: #dff0d8;\n}\n.table-hover > tbody > tr > td.success:hover,\n.table-hover > tbody > tr > th.success:hover,\n.table-hover > tbody > tr.success:hover > td,\n.table-hover > tbody > tr:hover > .success,\n.table-hover > tbody > tr.success:hover > th {\n background-color: #d0e9c6;\n}\n.table > thead > tr > td.info,\n.table > tbody > tr > td.info,\n.table > tfoot > tr > td.info,\n.table > thead > tr > th.info,\n.table > tbody > tr > th.info,\n.table > tfoot > tr > th.info,\n.table > thead > tr.info > td,\n.table > tbody > tr.info > td,\n.table > tfoot > tr.info > td,\n.table > thead > tr.info > th,\n.table > tbody > tr.info > th,\n.table > tfoot > tr.info > th {\n background-color: #d9edf7;\n}\n.table-hover > tbody > tr > td.info:hover,\n.table-hover > tbody > tr > th.info:hover,\n.table-hover > tbody > tr.info:hover > td,\n.table-hover > tbody > tr:hover > .info,\n.table-hover > tbody > tr.info:hover > th {\n background-color: #c4e3f3;\n}\n.table > thead > tr > td.warning,\n.table > tbody > tr > td.warning,\n.table > tfoot > tr > td.warning,\n.table > thead > tr > th.warning,\n.table > tbody > tr > th.warning,\n.table > tfoot > tr > th.warning,\n.table > thead > tr.warning > td,\n.table > tbody > tr.warning > td,\n.table > tfoot > tr.warning > td,\n.table > thead > tr.warning > th,\n.table > tbody > tr.warning > th,\n.table > tfoot > tr.warning > th {\n background-color: #fcf8e3;\n}\n.table-hover > tbody > tr > td.warning:hover,\n.table-hover > tbody > tr > th.warning:hover,\n.table-hover > tbody > tr.warning:hover > td,\n.table-hover > tbody > tr:hover > .warning,\n.table-hover > tbody > tr.warning:hover > th {\n background-color: #faf2cc;\n}\n.table > thead > tr > td.danger,\n.table > tbody > tr > td.danger,\n.table > tfoot > tr > td.danger,\n.table > thead > tr > th.danger,\n.table > tbody > tr > th.danger,\n.table > tfoot > tr > th.danger,\n.table > thead > tr.danger > td,\n.table > tbody > tr.danger > td,\n.table > tfoot > tr.danger > td,\n.table > thead > tr.danger > th,\n.table > tbody > tr.danger > th,\n.table > tfoot > tr.danger > th {\n background-color: #f2dede;\n}\n.table-hover > tbody > tr > td.danger:hover,\n.table-hover > tbody > tr > th.danger:hover,\n.table-hover > tbody > tr.danger:hover > td,\n.table-hover > tbody > tr:hover > .danger,\n.table-hover > tbody > tr.danger:hover > th {\n background-color: #ebcccc;\n}\n.table-responsive {\n overflow-x: auto;\n min-height: 0.01%;\n}\n@media screen and (max-width: 767px) {\n .table-responsive {\n width: 100%;\n margin-bottom: 15px;\n overflow-y: hidden;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n border: 1px solid #dddddd;\n }\n .table-responsive > .table {\n margin-bottom: 0;\n }\n .table-responsive > .table > thead > tr > th,\n .table-responsive > .table > tbody > tr > th,\n .table-responsive > .table > tfoot > tr > th,\n .table-responsive > .table > thead > tr > td,\n .table-responsive > .table > tbody > tr > td,\n .table-responsive > .table > tfoot > tr > td {\n white-space: nowrap;\n }\n .table-responsive > .table-bordered {\n border: 0;\n }\n .table-responsive > .table-bordered > thead > tr > th:first-child,\n .table-responsive > .table-bordered > tbody > tr > th:first-child,\n .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n .table-responsive > .table-bordered > thead > tr > td:first-child,\n .table-responsive > .table-bordered > tbody > tr > td:first-child,\n .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n border-left: 0;\n }\n .table-responsive > .table-bordered > thead > tr > th:last-child,\n .table-responsive > .table-bordered > tbody > tr > th:last-child,\n .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n .table-responsive > .table-bordered > thead > tr > td:last-child,\n .table-responsive > .table-bordered > tbody > tr > td:last-child,\n .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n border-right: 0;\n }\n .table-responsive > .table-bordered > tbody > tr:last-child > th,\n .table-responsive > .table-bordered > tfoot > tr:last-child > th,\n .table-responsive > .table-bordered > tbody > tr:last-child > td,\n .table-responsive > .table-bordered > tfoot > tr:last-child > td {\n border-bottom: 0;\n }\n}\nfieldset {\n padding: 0;\n margin: 0;\n border: 0;\n min-width: 0;\n}\nlegend {\n display: block;\n width: 100%;\n padding: 0;\n margin-bottom: 20px;\n font-size: 21px;\n line-height: inherit;\n color: #333333;\n border: 0;\n border-bottom: 1px solid #e5e5e5;\n}\nlabel {\n display: inline-block;\n max-width: 100%;\n margin-bottom: 5px;\n font-weight: bold;\n}\ninput[type=\"search\"] {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n margin: 4px 0 0;\n margin-top: 1px \\9;\n line-height: normal;\n}\ninput[type=\"file\"] {\n display: block;\n}\ninput[type=\"range\"] {\n display: block;\n width: 100%;\n}\nselect[multiple],\nselect[size] {\n height: auto;\n}\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n outline: thin dotted;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\noutput {\n display: block;\n padding-top: 7px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555555;\n}\n.form-control {\n display: block;\n width: 100%;\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555555;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #cccccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n.form-control:focus {\n border-color: #66afe9;\n outline: 0;\n -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n}\n.form-control::-moz-placeholder {\n color: #999999;\n opacity: 1;\n}\n.form-control:-ms-input-placeholder {\n color: #999999;\n}\n.form-control::-webkit-input-placeholder {\n color: #999999;\n}\n.form-control[disabled],\n.form-control[readonly],\nfieldset[disabled] .form-control {\n background-color: #eeeeee;\n opacity: 1;\n}\n.form-control[disabled],\nfieldset[disabled] .form-control {\n cursor: not-allowed;\n}\ntextarea.form-control {\n height: auto;\n}\ninput[type=\"search\"] {\n -webkit-appearance: none;\n}\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n input[type=\"date\"],\n input[type=\"time\"],\n input[type=\"datetime-local\"],\n input[type=\"month\"] {\n line-height: 34px;\n }\n input[type=\"date\"].input-sm,\n input[type=\"time\"].input-sm,\n input[type=\"datetime-local\"].input-sm,\n input[type=\"month\"].input-sm,\n .input-group-sm input[type=\"date\"],\n .input-group-sm input[type=\"time\"],\n .input-group-sm input[type=\"datetime-local\"],\n .input-group-sm input[type=\"month\"] {\n line-height: 30px;\n }\n input[type=\"date\"].input-lg,\n input[type=\"time\"].input-lg,\n input[type=\"datetime-local\"].input-lg,\n input[type=\"month\"].input-lg,\n .input-group-lg input[type=\"date\"],\n .input-group-lg input[type=\"time\"],\n .input-group-lg input[type=\"datetime-local\"],\n .input-group-lg input[type=\"month\"] {\n line-height: 46px;\n }\n}\n.form-group {\n margin-bottom: 15px;\n}\n.radio,\n.checkbox {\n position: relative;\n display: block;\n margin-top: 10px;\n margin-bottom: 10px;\n}\n.radio label,\n.checkbox label {\n min-height: 20px;\n padding-left: 20px;\n margin-bottom: 0;\n font-weight: normal;\n cursor: pointer;\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n position: absolute;\n margin-left: -20px;\n margin-top: 4px \\9;\n}\n.radio + .radio,\n.checkbox + .checkbox {\n margin-top: -5px;\n}\n.radio-inline,\n.checkbox-inline {\n position: relative;\n display: inline-block;\n padding-left: 20px;\n margin-bottom: 0;\n vertical-align: middle;\n font-weight: normal;\n cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n margin-top: 0;\n margin-left: 10px;\n}\ninput[type=\"radio\"][disabled],\ninput[type=\"checkbox\"][disabled],\ninput[type=\"radio\"].disabled,\ninput[type=\"checkbox\"].disabled,\nfieldset[disabled] input[type=\"radio\"],\nfieldset[disabled] input[type=\"checkbox\"] {\n cursor: not-allowed;\n}\n.radio-inline.disabled,\n.checkbox-inline.disabled,\nfieldset[disabled] .radio-inline,\nfieldset[disabled] .checkbox-inline {\n cursor: not-allowed;\n}\n.radio.disabled label,\n.checkbox.disabled label,\nfieldset[disabled] .radio label,\nfieldset[disabled] .checkbox label {\n cursor: not-allowed;\n}\n.form-control-static {\n padding-top: 7px;\n padding-bottom: 7px;\n margin-bottom: 0;\n min-height: 34px;\n}\n.form-control-static.input-lg,\n.form-control-static.input-sm {\n padding-left: 0;\n padding-right: 0;\n}\n.input-sm {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.input-sm {\n height: 30px;\n line-height: 30px;\n}\ntextarea.input-sm,\nselect[multiple].input-sm {\n height: auto;\n}\n.form-group-sm .form-control {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.form-group-sm .form-control {\n height: 30px;\n line-height: 30px;\n}\ntextarea.form-group-sm .form-control,\nselect[multiple].form-group-sm .form-control {\n height: auto;\n}\n.form-group-sm .form-control-static {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n min-height: 32px;\n}\n.input-lg {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.input-lg {\n height: 46px;\n line-height: 46px;\n}\ntextarea.input-lg,\nselect[multiple].input-lg {\n height: auto;\n}\n.form-group-lg .form-control {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.form-group-lg .form-control {\n height: 46px;\n line-height: 46px;\n}\ntextarea.form-group-lg .form-control,\nselect[multiple].form-group-lg .form-control {\n height: auto;\n}\n.form-group-lg .form-control-static {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n min-height: 38px;\n}\n.has-feedback {\n position: relative;\n}\n.has-feedback .form-control {\n padding-right: 42.5px;\n}\n.form-control-feedback {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n display: block;\n width: 34px;\n height: 34px;\n line-height: 34px;\n text-align: center;\n pointer-events: none;\n}\n.input-lg + .form-control-feedback {\n width: 46px;\n height: 46px;\n line-height: 46px;\n}\n.input-sm + .form-control-feedback {\n width: 30px;\n height: 30px;\n line-height: 30px;\n}\n.has-success .help-block,\n.has-success .control-label,\n.has-success .radio,\n.has-success .checkbox,\n.has-success .radio-inline,\n.has-success .checkbox-inline,\n.has-success.radio label,\n.has-success.checkbox label,\n.has-success.radio-inline label,\n.has-success.checkbox-inline label {\n color: #3c763d;\n}\n.has-success .form-control {\n border-color: #3c763d;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-success .form-control:focus {\n border-color: #2b542c;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n}\n.has-success .input-group-addon {\n color: #3c763d;\n border-color: #3c763d;\n background-color: #dff0d8;\n}\n.has-success .form-control-feedback {\n color: #3c763d;\n}\n.has-warning .help-block,\n.has-warning .control-label,\n.has-warning .radio,\n.has-warning .checkbox,\n.has-warning .radio-inline,\n.has-warning .checkbox-inline,\n.has-warning.radio label,\n.has-warning.checkbox label,\n.has-warning.radio-inline label,\n.has-warning.checkbox-inline label {\n color: #8a6d3b;\n}\n.has-warning .form-control {\n border-color: #8a6d3b;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-warning .form-control:focus {\n border-color: #66512c;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n}\n.has-warning .input-group-addon {\n color: #8a6d3b;\n border-color: #8a6d3b;\n background-color: #fcf8e3;\n}\n.has-warning .form-control-feedback {\n color: #8a6d3b;\n}\n.has-error .help-block,\n.has-error .control-label,\n.has-error .radio,\n.has-error .checkbox,\n.has-error .radio-inline,\n.has-error .checkbox-inline,\n.has-error.radio label,\n.has-error.checkbox label,\n.has-error.radio-inline label,\n.has-error.checkbox-inline label {\n color: #a94442;\n}\n.has-error .form-control {\n border-color: #a94442;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-error .form-control:focus {\n border-color: #843534;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n}\n.has-error .input-group-addon {\n color: #a94442;\n border-color: #a94442;\n background-color: #f2dede;\n}\n.has-error .form-control-feedback {\n color: #a94442;\n}\n.has-feedback label ~ .form-control-feedback {\n top: 25px;\n}\n.has-feedback label.sr-only ~ .form-control-feedback {\n top: 0;\n}\n.help-block {\n display: block;\n margin-top: 5px;\n margin-bottom: 10px;\n color: #737373;\n}\n@media (min-width: 768px) {\n .form-inline .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .form-inline .form-control-static {\n display: inline-block;\n }\n .form-inline .input-group {\n display: inline-table;\n vertical-align: middle;\n }\n .form-inline .input-group .input-group-addon,\n .form-inline .input-group .input-group-btn,\n .form-inline .input-group .form-control {\n width: auto;\n }\n .form-inline .input-group > .form-control {\n width: 100%;\n }\n .form-inline .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .radio,\n .form-inline .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .radio label,\n .form-inline .checkbox label {\n padding-left: 0;\n }\n .form-inline .radio input[type=\"radio\"],\n .form-inline .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n .form-inline .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox,\n.form-horizontal .radio-inline,\n.form-horizontal .checkbox-inline {\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 7px;\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox {\n min-height: 27px;\n}\n.form-horizontal .form-group {\n margin-left: -15px;\n margin-right: -15px;\n}\n@media (min-width: 768px) {\n .form-horizontal .control-label {\n text-align: right;\n margin-bottom: 0;\n padding-top: 7px;\n }\n}\n.form-horizontal .has-feedback .form-control-feedback {\n right: 15px;\n}\n@media (min-width: 768px) {\n .form-horizontal .form-group-lg .control-label {\n padding-top: 14.333333px;\n }\n}\n@media (min-width: 768px) {\n .form-horizontal .form-group-sm .control-label {\n padding-top: 6px;\n }\n}\n.btn {\n display: inline-block;\n margin-bottom: 0;\n font-weight: normal;\n text-align: center;\n vertical-align: middle;\n touch-action: manipulation;\n cursor: pointer;\n background-image: none;\n border: 1px solid transparent;\n white-space: nowrap;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n border-radius: 4px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.btn:focus,\n.btn:active:focus,\n.btn.active:focus,\n.btn.focus,\n.btn:active.focus,\n.btn.active.focus {\n outline: thin dotted;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\n.btn:hover,\n.btn:focus,\n.btn.focus {\n color: #333333;\n text-decoration: none;\n}\n.btn:active,\n.btn.active {\n outline: 0;\n background-image: none;\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn.disabled,\n.btn[disabled],\nfieldset[disabled] .btn {\n cursor: not-allowed;\n pointer-events: none;\n opacity: 0.65;\n filter: alpha(opacity=65);\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn-default {\n color: #333333;\n background-color: #ffffff;\n border-color: #cccccc;\n}\n.btn-default:hover,\n.btn-default:focus,\n.btn-default.focus,\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n color: #333333;\n background-color: #e6e6e6;\n border-color: #adadad;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n background-image: none;\n}\n.btn-default.disabled,\n.btn-default[disabled],\nfieldset[disabled] .btn-default,\n.btn-default.disabled:hover,\n.btn-default[disabled]:hover,\nfieldset[disabled] .btn-default:hover,\n.btn-default.disabled:focus,\n.btn-default[disabled]:focus,\nfieldset[disabled] .btn-default:focus,\n.btn-default.disabled.focus,\n.btn-default[disabled].focus,\nfieldset[disabled] .btn-default.focus,\n.btn-default.disabled:active,\n.btn-default[disabled]:active,\nfieldset[disabled] .btn-default:active,\n.btn-default.disabled.active,\n.btn-default[disabled].active,\nfieldset[disabled] .btn-default.active {\n background-color: #ffffff;\n border-color: #cccccc;\n}\n.btn-default .badge {\n color: #ffffff;\n background-color: #333333;\n}\n.btn-primary {\n color: #ffffff;\n background-color: #337ab7;\n border-color: #2e6da4;\n}\n.btn-primary:hover,\n.btn-primary:focus,\n.btn-primary.focus,\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n color: #ffffff;\n background-color: #286090;\n border-color: #204d74;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n background-image: none;\n}\n.btn-primary.disabled,\n.btn-primary[disabled],\nfieldset[disabled] .btn-primary,\n.btn-primary.disabled:hover,\n.btn-primary[disabled]:hover,\nfieldset[disabled] .btn-primary:hover,\n.btn-primary.disabled:focus,\n.btn-primary[disabled]:focus,\nfieldset[disabled] .btn-primary:focus,\n.btn-primary.disabled.focus,\n.btn-primary[disabled].focus,\nfieldset[disabled] .btn-primary.focus,\n.btn-primary.disabled:active,\n.btn-primary[disabled]:active,\nfieldset[disabled] .btn-primary:active,\n.btn-primary.disabled.active,\n.btn-primary[disabled].active,\nfieldset[disabled] .btn-primary.active {\n background-color: #337ab7;\n border-color: #2e6da4;\n}\n.btn-primary .badge {\n color: #337ab7;\n background-color: #ffffff;\n}\n.btn-success {\n color: #ffffff;\n background-color: #5cb85c;\n border-color: #4cae4c;\n}\n.btn-success:hover,\n.btn-success:focus,\n.btn-success.focus,\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n color: #ffffff;\n background-color: #449d44;\n border-color: #398439;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n background-image: none;\n}\n.btn-success.disabled,\n.btn-success[disabled],\nfieldset[disabled] .btn-success,\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled.focus,\n.btn-success[disabled].focus,\nfieldset[disabled] .btn-success.focus,\n.btn-success.disabled:active,\n.btn-success[disabled]:active,\nfieldset[disabled] .btn-success:active,\n.btn-success.disabled.active,\n.btn-success[disabled].active,\nfieldset[disabled] .btn-success.active {\n background-color: #5cb85c;\n border-color: #4cae4c;\n}\n.btn-success .badge {\n color: #5cb85c;\n background-color: #ffffff;\n}\n.btn-info {\n color: #ffffff;\n background-color: #5bc0de;\n border-color: #46b8da;\n}\n.btn-info:hover,\n.btn-info:focus,\n.btn-info.focus,\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n color: #ffffff;\n background-color: #31b0d5;\n border-color: #269abc;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n background-image: none;\n}\n.btn-info.disabled,\n.btn-info[disabled],\nfieldset[disabled] .btn-info,\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled.focus,\n.btn-info[disabled].focus,\nfieldset[disabled] .btn-info.focus,\n.btn-info.disabled:active,\n.btn-info[disabled]:active,\nfieldset[disabled] .btn-info:active,\n.btn-info.disabled.active,\n.btn-info[disabled].active,\nfieldset[disabled] .btn-info.active {\n background-color: #5bc0de;\n border-color: #46b8da;\n}\n.btn-info .badge {\n color: #5bc0de;\n background-color: #ffffff;\n}\n.btn-warning {\n color: #ffffff;\n background-color: #f0ad4e;\n border-color: #eea236;\n}\n.btn-warning:hover,\n.btn-warning:focus,\n.btn-warning.focus,\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n color: #ffffff;\n background-color: #ec971f;\n border-color: #d58512;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n background-image: none;\n}\n.btn-warning.disabled,\n.btn-warning[disabled],\nfieldset[disabled] .btn-warning,\n.btn-warning.disabled:hover,\n.btn-warning[disabled]:hover,\nfieldset[disabled] .btn-warning:hover,\n.btn-warning.disabled:focus,\n.btn-warning[disabled]:focus,\nfieldset[disabled] .btn-warning:focus,\n.btn-warning.disabled.focus,\n.btn-warning[disabled].focus,\nfieldset[disabled] .btn-warning.focus,\n.btn-warning.disabled:active,\n.btn-warning[disabled]:active,\nfieldset[disabled] .btn-warning:active,\n.btn-warning.disabled.active,\n.btn-warning[disabled].active,\nfieldset[disabled] .btn-warning.active {\n background-color: #f0ad4e;\n border-color: #eea236;\n}\n.btn-warning .badge {\n color: #f0ad4e;\n background-color: #ffffff;\n}\n.btn-danger {\n color: #ffffff;\n background-color: #d9534f;\n border-color: #d43f3a;\n}\n.btn-danger:hover,\n.btn-danger:focus,\n.btn-danger.focus,\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n color: #ffffff;\n background-color: #c9302c;\n border-color: #ac2925;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n background-image: none;\n}\n.btn-danger.disabled,\n.btn-danger[disabled],\nfieldset[disabled] .btn-danger,\n.btn-danger.disabled:hover,\n.btn-danger[disabled]:hover,\nfieldset[disabled] .btn-danger:hover,\n.btn-danger.disabled:focus,\n.btn-danger[disabled]:focus,\nfieldset[disabled] .btn-danger:focus,\n.btn-danger.disabled.focus,\n.btn-danger[disabled].focus,\nfieldset[disabled] .btn-danger.focus,\n.btn-danger.disabled:active,\n.btn-danger[disabled]:active,\nfieldset[disabled] .btn-danger:active,\n.btn-danger.disabled.active,\n.btn-danger[disabled].active,\nfieldset[disabled] .btn-danger.active {\n background-color: #d9534f;\n border-color: #d43f3a;\n}\n.btn-danger .badge {\n color: #d9534f;\n background-color: #ffffff;\n}\n.btn-link {\n color: #337ab7;\n font-weight: normal;\n border-radius: 0;\n}\n.btn-link,\n.btn-link:active,\n.btn-link.active,\n.btn-link[disabled],\nfieldset[disabled] .btn-link {\n background-color: transparent;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn-link,\n.btn-link:hover,\n.btn-link:focus,\n.btn-link:active {\n border-color: transparent;\n}\n.btn-link:hover,\n.btn-link:focus {\n color: #23527c;\n text-decoration: underline;\n background-color: transparent;\n}\n.btn-link[disabled]:hover,\nfieldset[disabled] .btn-link:hover,\n.btn-link[disabled]:focus,\nfieldset[disabled] .btn-link:focus {\n color: #777777;\n text-decoration: none;\n}\n.btn-lg,\n.btn-group-lg > .btn {\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\n.btn-sm,\n.btn-group-sm > .btn {\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.btn-xs,\n.btn-group-xs > .btn {\n padding: 1px 5px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.btn-block {\n display: block;\n width: 100%;\n}\n.btn-block + .btn-block {\n margin-top: 5px;\n}\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n width: 100%;\n}\n.fade {\n opacity: 0;\n -webkit-transition: opacity 0.15s linear;\n -o-transition: opacity 0.15s linear;\n transition: opacity 0.15s linear;\n}\n.fade.in {\n opacity: 1;\n}\n.collapse {\n display: none;\n}\n.collapse.in {\n display: block;\n}\ntr.collapse.in {\n display: table-row;\n}\ntbody.collapse.in {\n display: table-row-group;\n}\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n -webkit-transition-property: height, visibility;\n transition-property: height, visibility;\n -webkit-transition-duration: 0.35s;\n transition-duration: 0.35s;\n -webkit-transition-timing-function: ease;\n transition-timing-function: ease;\n}\n.caret {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 2px;\n vertical-align: middle;\n border-top: 4px dashed;\n border-right: 4px solid transparent;\n border-left: 4px solid transparent;\n}\n.dropup,\n.dropdown {\n position: relative;\n}\n.dropdown-toggle:focus {\n outline: 0;\n}\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n list-style: none;\n font-size: 14px;\n text-align: left;\n background-color: #ffffff;\n border: 1px solid #cccccc;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n background-clip: padding-box;\n}\n.dropdown-menu.pull-right {\n right: 0;\n left: auto;\n}\n.dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n}\n.dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333333;\n white-space: nowrap;\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n text-decoration: none;\n color: #262626;\n background-color: #f5f5f5;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n color: #ffffff;\n text-decoration: none;\n outline: 0;\n background-color: #337ab7;\n}\n.dropdown-menu > .disabled > a,\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n color: #777777;\n}\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n cursor: not-allowed;\n}\n.open > .dropdown-menu {\n display: block;\n}\n.open > a {\n outline: 0;\n}\n.dropdown-menu-right {\n left: auto;\n right: 0;\n}\n.dropdown-menu-left {\n left: 0;\n right: auto;\n}\n.dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777777;\n white-space: nowrap;\n}\n.dropdown-backdrop {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: 990;\n}\n.pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n}\n.dropup .caret,\n.navbar-fixed-bottom .dropdown .caret {\n border-top: 0;\n border-bottom: 4px solid;\n content: \"\";\n}\n.dropup .dropdown-menu,\n.navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n}\n@media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n left: auto;\n right: 0;\n }\n .navbar-right .dropdown-menu-left {\n left: 0;\n right: auto;\n }\n}\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n}\n.btn-group > .btn,\n.btn-group-vertical > .btn {\n position: relative;\n float: left;\n}\n.btn-group > .btn:hover,\n.btn-group-vertical > .btn:hover,\n.btn-group > .btn:focus,\n.btn-group-vertical > .btn:focus,\n.btn-group > .btn:active,\n.btn-group-vertical > .btn:active,\n.btn-group > .btn.active,\n.btn-group-vertical > .btn.active {\n z-index: 2;\n}\n.btn-group .btn + .btn,\n.btn-group .btn + .btn-group,\n.btn-group .btn-group + .btn,\n.btn-group .btn-group + .btn-group {\n margin-left: -1px;\n}\n.btn-toolbar {\n margin-left: -5px;\n}\n.btn-toolbar .btn-group,\n.btn-toolbar .input-group {\n float: left;\n}\n.btn-toolbar > .btn,\n.btn-toolbar > .btn-group,\n.btn-toolbar > .input-group {\n margin-left: 5px;\n}\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n border-radius: 0;\n}\n.btn-group > .btn:first-child {\n margin-left: 0;\n}\n.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group > .btn-group {\n float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n outline: 0;\n}\n.btn-group > .btn + .dropdown-toggle {\n padding-left: 8px;\n padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n padding-left: 12px;\n padding-right: 12px;\n}\n.btn-group.open .dropdown-toggle {\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-group.open .dropdown-toggle.btn-link {\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn .caret {\n margin-left: 0;\n}\n.btn-lg .caret {\n border-width: 5px 5px 0;\n border-bottom-width: 0;\n}\n.dropup .btn-lg .caret {\n border-width: 0 5px 5px;\n}\n.btn-group-vertical > .btn,\n.btn-group-vertical > .btn-group,\n.btn-group-vertical > .btn-group > .btn {\n display: block;\n float: none;\n width: 100%;\n max-width: 100%;\n}\n.btn-group-vertical > .btn-group > .btn {\n float: none;\n}\n.btn-group-vertical > .btn + .btn,\n.btn-group-vertical > .btn + .btn-group,\n.btn-group-vertical > .btn-group + .btn,\n.btn-group-vertical > .btn-group + .btn-group {\n margin-top: -1px;\n margin-left: 0;\n}\n.btn-group-vertical > .btn:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n.btn-group-vertical > .btn:first-child:not(:last-child) {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn:last-child:not(:first-child) {\n border-bottom-left-radius: 4px;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group-justified {\n display: table;\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n}\n.btn-group-justified > .btn,\n.btn-group-justified > .btn-group {\n float: none;\n display: table-cell;\n width: 1%;\n}\n.btn-group-justified > .btn-group .btn {\n width: 100%;\n}\n.btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n}\n[data-toggle=\"buttons\"] > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn input[type=\"checkbox\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n.input-group {\n position: relative;\n display: table;\n border-collapse: separate;\n}\n.input-group[class*=\"col-\"] {\n float: none;\n padding-left: 0;\n padding-right: 0;\n}\n.input-group .form-control {\n position: relative;\n z-index: 2;\n float: left;\n width: 100%;\n margin-bottom: 0;\n}\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.input-group-lg > .form-control,\nselect.input-group-lg > .input-group-addon,\nselect.input-group-lg > .input-group-btn > .btn {\n height: 46px;\n line-height: 46px;\n}\ntextarea.input-group-lg > .form-control,\ntextarea.input-group-lg > .input-group-addon,\ntextarea.input-group-lg > .input-group-btn > .btn,\nselect[multiple].input-group-lg > .form-control,\nselect[multiple].input-group-lg > .input-group-addon,\nselect[multiple].input-group-lg > .input-group-btn > .btn {\n height: auto;\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.input-group-sm > .form-control,\nselect.input-group-sm > .input-group-addon,\nselect.input-group-sm > .input-group-btn > .btn {\n height: 30px;\n line-height: 30px;\n}\ntextarea.input-group-sm > .form-control,\ntextarea.input-group-sm > .input-group-addon,\ntextarea.input-group-sm > .input-group-btn > .btn,\nselect[multiple].input-group-sm > .form-control,\nselect[multiple].input-group-sm > .input-group-addon,\nselect[multiple].input-group-sm > .input-group-btn > .btn {\n height: auto;\n}\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n display: table-cell;\n}\n.input-group-addon:not(:first-child):not(:last-child),\n.input-group-btn:not(:first-child):not(:last-child),\n.input-group .form-control:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n.input-group-addon,\n.input-group-btn {\n width: 1%;\n white-space: nowrap;\n vertical-align: middle;\n}\n.input-group-addon {\n padding: 6px 12px;\n font-size: 14px;\n font-weight: normal;\n line-height: 1;\n color: #555555;\n text-align: center;\n background-color: #eeeeee;\n border: 1px solid #cccccc;\n border-radius: 4px;\n}\n.input-group-addon.input-sm {\n padding: 5px 10px;\n font-size: 12px;\n border-radius: 3px;\n}\n.input-group-addon.input-lg {\n padding: 10px 16px;\n font-size: 18px;\n border-radius: 6px;\n}\n.input-group-addon input[type=\"radio\"],\n.input-group-addon input[type=\"checkbox\"] {\n margin-top: 0;\n}\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.input-group-addon:first-child {\n border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.input-group-addon:last-child {\n border-left: 0;\n}\n.input-group-btn {\n position: relative;\n font-size: 0;\n white-space: nowrap;\n}\n.input-group-btn > .btn {\n position: relative;\n}\n.input-group-btn > .btn + .btn {\n margin-left: -1px;\n}\n.input-group-btn > .btn:hover,\n.input-group-btn > .btn:focus,\n.input-group-btn > .btn:active {\n z-index: 2;\n}\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group {\n margin-right: -1px;\n}\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group {\n margin-left: -1px;\n}\n.nav {\n margin-bottom: 0;\n padding-left: 0;\n list-style: none;\n}\n.nav > li {\n position: relative;\n display: block;\n}\n.nav > li > a {\n position: relative;\n display: block;\n padding: 10px 15px;\n}\n.nav > li > a:hover,\n.nav > li > a:focus {\n text-decoration: none;\n background-color: #eeeeee;\n}\n.nav > li.disabled > a {\n color: #777777;\n}\n.nav > li.disabled > a:hover,\n.nav > li.disabled > a:focus {\n color: #777777;\n text-decoration: none;\n background-color: transparent;\n cursor: not-allowed;\n}\n.nav .open > a,\n.nav .open > a:hover,\n.nav .open > a:focus {\n background-color: #eeeeee;\n border-color: #337ab7;\n}\n.nav .nav-divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n}\n.nav > li > a > img {\n max-width: none;\n}\n.nav-tabs {\n border-bottom: 1px solid #dddddd;\n}\n.nav-tabs > li {\n float: left;\n margin-bottom: -1px;\n}\n.nav-tabs > li > a {\n margin-right: 2px;\n line-height: 1.42857143;\n border: 1px solid transparent;\n border-radius: 4px 4px 0 0;\n}\n.nav-tabs > li > a:hover {\n border-color: #eeeeee #eeeeee #dddddd;\n}\n.nav-tabs > li.active > a,\n.nav-tabs > li.active > a:hover,\n.nav-tabs > li.active > a:focus {\n color: #555555;\n background-color: #ffffff;\n border: 1px solid #dddddd;\n border-bottom-color: transparent;\n cursor: default;\n}\n.nav-tabs.nav-justified {\n width: 100%;\n border-bottom: 0;\n}\n.nav-tabs.nav-justified > li {\n float: none;\n}\n.nav-tabs.nav-justified > li > a {\n text-align: center;\n margin-bottom: 5px;\n}\n.nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n}\n@media (min-width: 768px) {\n .nav-tabs.nav-justified > li {\n display: table-cell;\n width: 1%;\n }\n .nav-tabs.nav-justified > li > a {\n margin-bottom: 0;\n }\n}\n.nav-tabs.nav-justified > li > a {\n margin-right: 0;\n border-radius: 4px;\n}\n.nav-tabs.nav-justified > .active > a,\n.nav-tabs.nav-justified > .active > a:hover,\n.nav-tabs.nav-justified > .active > a:focus {\n border: 1px solid #dddddd;\n}\n@media (min-width: 768px) {\n .nav-tabs.nav-justified > li > a {\n border-bottom: 1px solid #dddddd;\n border-radius: 4px 4px 0 0;\n }\n .nav-tabs.nav-justified > .active > a,\n .nav-tabs.nav-justified > .active > a:hover,\n .nav-tabs.nav-justified > .active > a:focus {\n border-bottom-color: #ffffff;\n }\n}\n.nav-pills > li {\n float: left;\n}\n.nav-pills > li > a {\n border-radius: 4px;\n}\n.nav-pills > li + li {\n margin-left: 2px;\n}\n.nav-pills > li.active > a,\n.nav-pills > li.active > a:hover,\n.nav-pills > li.active > a:focus {\n color: #ffffff;\n background-color: #337ab7;\n}\n.nav-stacked > li {\n float: none;\n}\n.nav-stacked > li + li {\n margin-top: 2px;\n margin-left: 0;\n}\n.nav-justified {\n width: 100%;\n}\n.nav-justified > li {\n float: none;\n}\n.nav-justified > li > a {\n text-align: center;\n margin-bottom: 5px;\n}\n.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n}\n@media (min-width: 768px) {\n .nav-justified > li {\n display: table-cell;\n width: 1%;\n }\n .nav-justified > li > a {\n margin-bottom: 0;\n }\n}\n.nav-tabs-justified {\n border-bottom: 0;\n}\n.nav-tabs-justified > li > a {\n margin-right: 0;\n border-radius: 4px;\n}\n.nav-tabs-justified > .active > a,\n.nav-tabs-justified > .active > a:hover,\n.nav-tabs-justified > .active > a:focus {\n border: 1px solid #dddddd;\n}\n@media (min-width: 768px) {\n .nav-tabs-justified > li > a {\n border-bottom: 1px solid #dddddd;\n border-radius: 4px 4px 0 0;\n }\n .nav-tabs-justified > .active > a,\n .nav-tabs-justified > .active > a:hover,\n .nav-tabs-justified > .active > a:focus {\n border-bottom-color: #ffffff;\n }\n}\n.tab-content > .tab-pane {\n display: none;\n}\n.tab-content > .active {\n display: block;\n}\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.navbar {\n position: relative;\n min-height: 50px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n}\n@media (min-width: 768px) {\n .navbar {\n border-radius: 4px;\n }\n}\n@media (min-width: 768px) {\n .navbar-header {\n float: left;\n }\n}\n.navbar-collapse {\n overflow-x: visible;\n padding-right: 15px;\n padding-left: 15px;\n border-top: 1px solid transparent;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);\n -webkit-overflow-scrolling: touch;\n}\n.navbar-collapse.in {\n overflow-y: auto;\n}\n@media (min-width: 768px) {\n .navbar-collapse {\n width: auto;\n border-top: 0;\n box-shadow: none;\n }\n .navbar-collapse.collapse {\n display: block !important;\n height: auto !important;\n padding-bottom: 0;\n overflow: visible !important;\n }\n .navbar-collapse.in {\n overflow-y: visible;\n }\n .navbar-fixed-top .navbar-collapse,\n .navbar-static-top .navbar-collapse,\n .navbar-fixed-bottom .navbar-collapse {\n padding-left: 0;\n padding-right: 0;\n }\n}\n.navbar-fixed-top .navbar-collapse,\n.navbar-fixed-bottom .navbar-collapse {\n max-height: 340px;\n}\n@media (max-device-width: 480px) and (orientation: landscape) {\n .navbar-fixed-top .navbar-collapse,\n .navbar-fixed-bottom .navbar-collapse {\n max-height: 200px;\n }\n}\n.container > .navbar-header,\n.container-fluid > .navbar-header,\n.container > .navbar-collapse,\n.container-fluid > .navbar-collapse {\n margin-right: -15px;\n margin-left: -15px;\n}\n@media (min-width: 768px) {\n .container > .navbar-header,\n .container-fluid > .navbar-header,\n .container > .navbar-collapse,\n .container-fluid > .navbar-collapse {\n margin-right: 0;\n margin-left: 0;\n }\n}\n.navbar-static-top {\n z-index: 1000;\n border-width: 0 0 1px;\n}\n@media (min-width: 768px) {\n .navbar-static-top {\n border-radius: 0;\n }\n}\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n position: fixed;\n right: 0;\n left: 0;\n z-index: 1030;\n}\n@media (min-width: 768px) {\n .navbar-fixed-top,\n .navbar-fixed-bottom {\n border-radius: 0;\n }\n}\n.navbar-fixed-top {\n top: 0;\n border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n bottom: 0;\n margin-bottom: 0;\n border-width: 1px 0 0;\n}\n.navbar-brand {\n float: left;\n padding: 15px 15px;\n font-size: 18px;\n line-height: 20px;\n height: 50px;\n}\n.navbar-brand:hover,\n.navbar-brand:focus {\n text-decoration: none;\n}\n.navbar-brand > img {\n display: block;\n}\n@media (min-width: 768px) {\n .navbar > .container .navbar-brand,\n .navbar > .container-fluid .navbar-brand {\n margin-left: -15px;\n }\n}\n.navbar-toggle {\n position: relative;\n float: right;\n margin-right: 15px;\n padding: 9px 10px;\n margin-top: 8px;\n margin-bottom: 8px;\n background-color: transparent;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.navbar-toggle:focus {\n outline: 0;\n}\n.navbar-toggle .icon-bar {\n display: block;\n width: 22px;\n height: 2px;\n border-radius: 1px;\n}\n.navbar-toggle .icon-bar + .icon-bar {\n margin-top: 4px;\n}\n@media (min-width: 768px) {\n .navbar-toggle {\n display: none;\n }\n}\n.navbar-nav {\n margin: 7.5px -15px;\n}\n.navbar-nav > li > a {\n padding-top: 10px;\n padding-bottom: 10px;\n line-height: 20px;\n}\n@media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n}\n@media (min-width: 768px) {\n .navbar-nav {\n float: left;\n margin: 0;\n }\n .navbar-nav > li {\n float: left;\n }\n .navbar-nav > li > a {\n padding-top: 15px;\n padding-bottom: 15px;\n }\n}\n.navbar-form {\n margin-left: -15px;\n margin-right: -15px;\n padding: 10px 15px;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n margin-top: 8px;\n margin-bottom: 8px;\n}\n@media (min-width: 768px) {\n .navbar-form .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .navbar-form .form-control-static {\n display: inline-block;\n }\n .navbar-form .input-group {\n display: inline-table;\n vertical-align: middle;\n }\n .navbar-form .input-group .input-group-addon,\n .navbar-form .input-group .input-group-btn,\n .navbar-form .input-group .form-control {\n width: auto;\n }\n .navbar-form .input-group > .form-control {\n width: 100%;\n }\n .navbar-form .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .radio,\n .navbar-form .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .radio label,\n .navbar-form .checkbox label {\n padding-left: 0;\n }\n .navbar-form .radio input[type=\"radio\"],\n .navbar-form .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n .navbar-form .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n@media (max-width: 767px) {\n .navbar-form .form-group {\n margin-bottom: 5px;\n }\n .navbar-form .form-group:last-child {\n margin-bottom: 0;\n }\n}\n@media (min-width: 768px) {\n .navbar-form {\n width: auto;\n border: 0;\n margin-left: 0;\n margin-right: 0;\n padding-top: 0;\n padding-bottom: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n}\n.navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.navbar-btn {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n.navbar-btn.btn-sm {\n margin-top: 10px;\n margin-bottom: 10px;\n}\n.navbar-btn.btn-xs {\n margin-top: 14px;\n margin-bottom: 14px;\n}\n.navbar-text {\n margin-top: 15px;\n margin-bottom: 15px;\n}\n@media (min-width: 768px) {\n .navbar-text {\n float: left;\n margin-left: 15px;\n margin-right: 15px;\n }\n}\n@media (min-width: 768px) {\n .navbar-left {\n float: left !important;\n }\n .navbar-right {\n float: right !important;\n margin-right: -15px;\n }\n .navbar-right ~ .navbar-right {\n margin-right: 0;\n }\n}\n.navbar-default {\n background-color: #f8f8f8;\n border-color: #e7e7e7;\n}\n.navbar-default .navbar-brand {\n color: #777777;\n}\n.navbar-default .navbar-brand:hover,\n.navbar-default .navbar-brand:focus {\n color: #5e5e5e;\n background-color: transparent;\n}\n.navbar-default .navbar-text {\n color: #777777;\n}\n.navbar-default .navbar-nav > li > a {\n color: #777777;\n}\n.navbar-default .navbar-nav > li > a:hover,\n.navbar-default .navbar-nav > li > a:focus {\n color: #333333;\n background-color: transparent;\n}\n.navbar-default .navbar-nav > .active > a,\n.navbar-default .navbar-nav > .active > a:hover,\n.navbar-default .navbar-nav > .active > a:focus {\n color: #555555;\n background-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .disabled > a,\n.navbar-default .navbar-nav > .disabled > a:hover,\n.navbar-default .navbar-nav > .disabled > a:focus {\n color: #cccccc;\n background-color: transparent;\n}\n.navbar-default .navbar-toggle {\n border-color: #dddddd;\n}\n.navbar-default .navbar-toggle:hover,\n.navbar-default .navbar-toggle:focus {\n background-color: #dddddd;\n}\n.navbar-default .navbar-toggle .icon-bar {\n background-color: #888888;\n}\n.navbar-default .navbar-collapse,\n.navbar-default .navbar-form {\n border-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .open > a:hover,\n.navbar-default .navbar-nav > .open > a:focus {\n background-color: #e7e7e7;\n color: #555555;\n}\n@media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #cccccc;\n background-color: transparent;\n }\n}\n.navbar-default .navbar-link {\n color: #777777;\n}\n.navbar-default .navbar-link:hover {\n color: #333333;\n}\n.navbar-default .btn-link {\n color: #777777;\n}\n.navbar-default .btn-link:hover,\n.navbar-default .btn-link:focus {\n color: #333333;\n}\n.navbar-default .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-default .btn-link:hover,\n.navbar-default .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-default .btn-link:focus {\n color: #cccccc;\n}\n.navbar-inverse {\n background-color: #222222;\n border-color: #080808;\n}\n.navbar-inverse .navbar-brand {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-brand:hover,\n.navbar-inverse .navbar-brand:focus {\n color: #ffffff;\n background-color: transparent;\n}\n.navbar-inverse .navbar-text {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a:hover,\n.navbar-inverse .navbar-nav > li > a:focus {\n color: #ffffff;\n background-color: transparent;\n}\n.navbar-inverse .navbar-nav > .active > a,\n.navbar-inverse .navbar-nav > .active > a:hover,\n.navbar-inverse .navbar-nav > .active > a:focus {\n color: #ffffff;\n background-color: #080808;\n}\n.navbar-inverse .navbar-nav > .disabled > a,\n.navbar-inverse .navbar-nav > .disabled > a:hover,\n.navbar-inverse .navbar-nav > .disabled > a:focus {\n color: #444444;\n background-color: transparent;\n}\n.navbar-inverse .navbar-toggle {\n border-color: #333333;\n}\n.navbar-inverse .navbar-toggle:hover,\n.navbar-inverse .navbar-toggle:focus {\n background-color: #333333;\n}\n.navbar-inverse .navbar-toggle .icon-bar {\n background-color: #ffffff;\n}\n.navbar-inverse .navbar-collapse,\n.navbar-inverse .navbar-form {\n border-color: #101010;\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .open > a:hover,\n.navbar-inverse .navbar-nav > .open > a:focus {\n background-color: #080808;\n color: #ffffff;\n}\n@media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #ffffff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #ffffff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444444;\n background-color: transparent;\n }\n}\n.navbar-inverse .navbar-link {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-link:hover {\n color: #ffffff;\n}\n.navbar-inverse .btn-link {\n color: #9d9d9d;\n}\n.navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link:focus {\n color: #ffffff;\n}\n.navbar-inverse .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-inverse .btn-link:focus {\n color: #444444;\n}\n.breadcrumb {\n padding: 8px 15px;\n margin-bottom: 20px;\n list-style: none;\n background-color: #f5f5f5;\n border-radius: 4px;\n}\n.breadcrumb > li {\n display: inline-block;\n}\n.breadcrumb > li + li:before {\n content: \"/\\00a0\";\n padding: 0 5px;\n color: #cccccc;\n}\n.breadcrumb > .active {\n color: #777777;\n}\n.pagination {\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n border-radius: 4px;\n}\n.pagination > li {\n display: inline;\n}\n.pagination > li > a,\n.pagination > li > span {\n position: relative;\n float: left;\n padding: 6px 12px;\n line-height: 1.42857143;\n text-decoration: none;\n color: #337ab7;\n background-color: #ffffff;\n border: 1px solid #dddddd;\n margin-left: -1px;\n}\n.pagination > li:first-child > a,\n.pagination > li:first-child > span {\n margin-left: 0;\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n}\n.pagination > li:last-child > a,\n.pagination > li:last-child > span {\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n}\n.pagination > li > a:hover,\n.pagination > li > span:hover,\n.pagination > li > a:focus,\n.pagination > li > span:focus {\n color: #23527c;\n background-color: #eeeeee;\n border-color: #dddddd;\n}\n.pagination > .active > a,\n.pagination > .active > span,\n.pagination > .active > a:hover,\n.pagination > .active > span:hover,\n.pagination > .active > a:focus,\n.pagination > .active > span:focus {\n z-index: 2;\n color: #ffffff;\n background-color: #337ab7;\n border-color: #337ab7;\n cursor: default;\n}\n.pagination > .disabled > span,\n.pagination > .disabled > span:hover,\n.pagination > .disabled > span:focus,\n.pagination > .disabled > a,\n.pagination > .disabled > a:hover,\n.pagination > .disabled > a:focus {\n color: #777777;\n background-color: #ffffff;\n border-color: #dddddd;\n cursor: not-allowed;\n}\n.pagination-lg > li > a,\n.pagination-lg > li > span {\n padding: 10px 16px;\n font-size: 18px;\n}\n.pagination-lg > li:first-child > a,\n.pagination-lg > li:first-child > span {\n border-bottom-left-radius: 6px;\n border-top-left-radius: 6px;\n}\n.pagination-lg > li:last-child > a,\n.pagination-lg > li:last-child > span {\n border-bottom-right-radius: 6px;\n border-top-right-radius: 6px;\n}\n.pagination-sm > li > a,\n.pagination-sm > li > span {\n padding: 5px 10px;\n font-size: 12px;\n}\n.pagination-sm > li:first-child > a,\n.pagination-sm > li:first-child > span {\n border-bottom-left-radius: 3px;\n border-top-left-radius: 3px;\n}\n.pagination-sm > li:last-child > a,\n.pagination-sm > li:last-child > span {\n border-bottom-right-radius: 3px;\n border-top-right-radius: 3px;\n}\n.pager {\n padding-left: 0;\n margin: 20px 0;\n list-style: none;\n text-align: center;\n}\n.pager li {\n display: inline;\n}\n.pager li > a,\n.pager li > span {\n display: inline-block;\n padding: 5px 14px;\n background-color: #ffffff;\n border: 1px solid #dddddd;\n border-radius: 15px;\n}\n.pager li > a:hover,\n.pager li > a:focus {\n text-decoration: none;\n background-color: #eeeeee;\n}\n.pager .next > a,\n.pager .next > span {\n float: right;\n}\n.pager .previous > a,\n.pager .previous > span {\n float: left;\n}\n.pager .disabled > a,\n.pager .disabled > a:hover,\n.pager .disabled > a:focus,\n.pager .disabled > span {\n color: #777777;\n background-color: #ffffff;\n cursor: not-allowed;\n}\n.label {\n display: inline;\n padding: .2em .6em .3em;\n font-size: 75%;\n font-weight: bold;\n line-height: 1;\n color: #ffffff;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: .25em;\n}\na.label:hover,\na.label:focus {\n color: #ffffff;\n text-decoration: none;\n cursor: pointer;\n}\n.label:empty {\n display: none;\n}\n.btn .label {\n position: relative;\n top: -1px;\n}\n.label-default {\n background-color: #777777;\n}\n.label-default[href]:hover,\n.label-default[href]:focus {\n background-color: #5e5e5e;\n}\n.label-primary {\n background-color: #337ab7;\n}\n.label-primary[href]:hover,\n.label-primary[href]:focus {\n background-color: #286090;\n}\n.label-success {\n background-color: #5cb85c;\n}\n.label-success[href]:hover,\n.label-success[href]:focus {\n background-color: #449d44;\n}\n.label-info {\n background-color: #5bc0de;\n}\n.label-info[href]:hover,\n.label-info[href]:focus {\n background-color: #31b0d5;\n}\n.label-warning {\n background-color: #f0ad4e;\n}\n.label-warning[href]:hover,\n.label-warning[href]:focus {\n background-color: #ec971f;\n}\n.label-danger {\n background-color: #d9534f;\n}\n.label-danger[href]:hover,\n.label-danger[href]:focus {\n background-color: #c9302c;\n}\n.badge {\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: 12px;\n font-weight: bold;\n color: #ffffff;\n line-height: 1;\n vertical-align: baseline;\n white-space: nowrap;\n text-align: center;\n background-color: #777777;\n border-radius: 10px;\n}\n.badge:empty {\n display: none;\n}\n.btn .badge {\n position: relative;\n top: -1px;\n}\n.btn-xs .badge,\n.btn-group-xs > .btn .badge {\n top: 0;\n padding: 1px 5px;\n}\na.badge:hover,\na.badge:focus {\n color: #ffffff;\n text-decoration: none;\n cursor: pointer;\n}\n.list-group-item.active > .badge,\n.nav-pills > .active > a > .badge {\n color: #337ab7;\n background-color: #ffffff;\n}\n.list-group-item > .badge {\n float: right;\n}\n.list-group-item > .badge + .badge {\n margin-right: 5px;\n}\n.nav-pills > li > a > .badge {\n margin-left: 3px;\n}\n.jumbotron {\n padding: 30px 15px;\n margin-bottom: 30px;\n color: inherit;\n background-color: #eeeeee;\n}\n.jumbotron h1,\n.jumbotron .h1 {\n color: inherit;\n}\n.jumbotron p {\n margin-bottom: 15px;\n font-size: 21px;\n font-weight: 200;\n}\n.jumbotron > hr {\n border-top-color: #d5d5d5;\n}\n.container .jumbotron,\n.container-fluid .jumbotron {\n border-radius: 6px;\n}\n.jumbotron .container {\n max-width: 100%;\n}\n@media screen and (min-width: 768px) {\n .jumbotron {\n padding: 48px 0;\n }\n .container .jumbotron,\n .container-fluid .jumbotron {\n padding-left: 60px;\n padding-right: 60px;\n }\n .jumbotron h1,\n .jumbotron .h1 {\n font-size: 63px;\n }\n}\n.thumbnail {\n display: block;\n padding: 4px;\n margin-bottom: 20px;\n line-height: 1.42857143;\n background-color: #ffffff;\n border: 1px solid #dddddd;\n border-radius: 4px;\n -webkit-transition: border 0.2s ease-in-out;\n -o-transition: border 0.2s ease-in-out;\n transition: border 0.2s ease-in-out;\n}\n.thumbnail > img,\n.thumbnail a > img {\n margin-left: auto;\n margin-right: auto;\n}\na.thumbnail:hover,\na.thumbnail:focus,\na.thumbnail.active {\n border-color: #337ab7;\n}\n.thumbnail .caption {\n padding: 9px;\n color: #333333;\n}\n.alert {\n padding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.alert h4 {\n margin-top: 0;\n color: inherit;\n}\n.alert .alert-link {\n font-weight: bold;\n}\n.alert > p,\n.alert > ul {\n margin-bottom: 0;\n}\n.alert > p + p {\n margin-top: 5px;\n}\n.alert-dismissable,\n.alert-dismissible {\n padding-right: 35px;\n}\n.alert-dismissable .close,\n.alert-dismissible .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n}\n.alert-success {\n background-color: #dff0d8;\n border-color: #d6e9c6;\n color: #3c763d;\n}\n.alert-success hr {\n border-top-color: #c9e2b3;\n}\n.alert-success .alert-link {\n color: #2b542c;\n}\n.alert-info {\n background-color: #d9edf7;\n border-color: #bce8f1;\n color: #31708f;\n}\n.alert-info hr {\n border-top-color: #a6e1ec;\n}\n.alert-info .alert-link {\n color: #245269;\n}\n.alert-warning {\n background-color: #fcf8e3;\n border-color: #faebcc;\n color: #8a6d3b;\n}\n.alert-warning hr {\n border-top-color: #f7e1b5;\n}\n.alert-warning .alert-link {\n color: #66512c;\n}\n.alert-danger {\n background-color: #f2dede;\n border-color: #ebccd1;\n color: #a94442;\n}\n.alert-danger hr {\n border-top-color: #e4b9c0;\n}\n.alert-danger .alert-link {\n color: #843534;\n}\n@-webkit-keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n@keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n.progress {\n overflow: hidden;\n height: 20px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.progress-bar {\n float: left;\n width: 0%;\n height: 100%;\n font-size: 12px;\n line-height: 20px;\n color: #ffffff;\n text-align: center;\n background-color: #337ab7;\n -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n -webkit-transition: width 0.6s ease;\n -o-transition: width 0.6s ease;\n transition: width 0.6s ease;\n}\n.progress-striped .progress-bar,\n.progress-bar-striped {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-size: 40px 40px;\n}\n.progress.active .progress-bar,\n.progress-bar.active {\n -webkit-animation: progress-bar-stripes 2s linear infinite;\n -o-animation: progress-bar-stripes 2s linear infinite;\n animation: progress-bar-stripes 2s linear infinite;\n}\n.progress-bar-success {\n background-color: #5cb85c;\n}\n.progress-striped .progress-bar-success {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-info {\n background-color: #5bc0de;\n}\n.progress-striped .progress-bar-info {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-warning {\n background-color: #f0ad4e;\n}\n.progress-striped .progress-bar-warning {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-danger {\n background-color: #d9534f;\n}\n.progress-striped .progress-bar-danger {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.media {\n margin-top: 15px;\n}\n.media:first-child {\n margin-top: 0;\n}\n.media,\n.media-body {\n zoom: 1;\n overflow: hidden;\n}\n.media-body {\n width: 10000px;\n}\n.media-object {\n display: block;\n}\n.media-right,\n.media > .pull-right {\n padding-left: 10px;\n}\n.media-left,\n.media > .pull-left {\n padding-right: 10px;\n}\n.media-left,\n.media-right,\n.media-body {\n display: table-cell;\n vertical-align: top;\n}\n.media-middle {\n vertical-align: middle;\n}\n.media-bottom {\n vertical-align: bottom;\n}\n.media-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.media-list {\n padding-left: 0;\n list-style: none;\n}\n.list-group {\n margin-bottom: 20px;\n padding-left: 0;\n}\n.list-group-item {\n position: relative;\n display: block;\n padding: 10px 15px;\n margin-bottom: -1px;\n background-color: #ffffff;\n border: 1px solid #dddddd;\n}\n.list-group-item:first-child {\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n}\n.list-group-item:last-child {\n margin-bottom: 0;\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n}\na.list-group-item {\n color: #555555;\n}\na.list-group-item .list-group-item-heading {\n color: #333333;\n}\na.list-group-item:hover,\na.list-group-item:focus {\n text-decoration: none;\n color: #555555;\n background-color: #f5f5f5;\n}\n.list-group-item.disabled,\n.list-group-item.disabled:hover,\n.list-group-item.disabled:focus {\n background-color: #eeeeee;\n color: #777777;\n cursor: not-allowed;\n}\n.list-group-item.disabled .list-group-item-heading,\n.list-group-item.disabled:hover .list-group-item-heading,\n.list-group-item.disabled:focus .list-group-item-heading {\n color: inherit;\n}\n.list-group-item.disabled .list-group-item-text,\n.list-group-item.disabled:hover .list-group-item-text,\n.list-group-item.disabled:focus .list-group-item-text {\n color: #777777;\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n z-index: 2;\n color: #ffffff;\n background-color: #337ab7;\n border-color: #337ab7;\n}\n.list-group-item.active .list-group-item-heading,\n.list-group-item.active:hover .list-group-item-heading,\n.list-group-item.active:focus .list-group-item-heading,\n.list-group-item.active .list-group-item-heading > small,\n.list-group-item.active:hover .list-group-item-heading > small,\n.list-group-item.active:focus .list-group-item-heading > small,\n.list-group-item.active .list-group-item-heading > .small,\n.list-group-item.active:hover .list-group-item-heading > .small,\n.list-group-item.active:focus .list-group-item-heading > .small {\n color: inherit;\n}\n.list-group-item.active .list-group-item-text,\n.list-group-item.active:hover .list-group-item-text,\n.list-group-item.active:focus .list-group-item-text {\n color: #c7ddef;\n}\n.list-group-item-success {\n color: #3c763d;\n background-color: #dff0d8;\n}\na.list-group-item-success {\n color: #3c763d;\n}\na.list-group-item-success .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-success:hover,\na.list-group-item-success:focus {\n color: #3c763d;\n background-color: #d0e9c6;\n}\na.list-group-item-success.active,\na.list-group-item-success.active:hover,\na.list-group-item-success.active:focus {\n color: #fff;\n background-color: #3c763d;\n border-color: #3c763d;\n}\n.list-group-item-info {\n color: #31708f;\n background-color: #d9edf7;\n}\na.list-group-item-info {\n color: #31708f;\n}\na.list-group-item-info .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-info:hover,\na.list-group-item-info:focus {\n color: #31708f;\n background-color: #c4e3f3;\n}\na.list-group-item-info.active,\na.list-group-item-info.active:hover,\na.list-group-item-info.active:focus {\n color: #fff;\n background-color: #31708f;\n border-color: #31708f;\n}\n.list-group-item-warning {\n color: #8a6d3b;\n background-color: #fcf8e3;\n}\na.list-group-item-warning {\n color: #8a6d3b;\n}\na.list-group-item-warning .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-warning:hover,\na.list-group-item-warning:focus {\n color: #8a6d3b;\n background-color: #faf2cc;\n}\na.list-group-item-warning.active,\na.list-group-item-warning.active:hover,\na.list-group-item-warning.active:focus {\n color: #fff;\n background-color: #8a6d3b;\n border-color: #8a6d3b;\n}\n.list-group-item-danger {\n color: #a94442;\n background-color: #f2dede;\n}\na.list-group-item-danger {\n color: #a94442;\n}\na.list-group-item-danger .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-danger:hover,\na.list-group-item-danger:focus {\n color: #a94442;\n background-color: #ebcccc;\n}\na.list-group-item-danger.active,\na.list-group-item-danger.active:hover,\na.list-group-item-danger.active:focus {\n color: #fff;\n background-color: #a94442;\n border-color: #a94442;\n}\n.list-group-item-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.list-group-item-text {\n margin-bottom: 0;\n line-height: 1.3;\n}\n.panel {\n margin-bottom: 20px;\n background-color: #ffffff;\n border: 1px solid transparent;\n border-radius: 4px;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.panel-body {\n padding: 15px;\n}\n.panel-heading {\n padding: 10px 15px;\n border-bottom: 1px solid transparent;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel-heading > .dropdown .dropdown-toggle {\n color: inherit;\n}\n.panel-title {\n margin-top: 0;\n margin-bottom: 0;\n font-size: 16px;\n color: inherit;\n}\n.panel-title > a,\n.panel-title > small,\n.panel-title > .small,\n.panel-title > small > a,\n.panel-title > .small > a {\n color: inherit;\n}\n.panel-footer {\n padding: 10px 15px;\n background-color: #f5f5f5;\n border-top: 1px solid #dddddd;\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .list-group,\n.panel > .panel-collapse > .list-group {\n margin-bottom: 0;\n}\n.panel > .list-group .list-group-item,\n.panel > .panel-collapse > .list-group .list-group-item {\n border-width: 1px 0;\n border-radius: 0;\n}\n.panel > .list-group:first-child .list-group-item:first-child,\n.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {\n border-top: 0;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel > .list-group:last-child .list-group-item:last-child,\n.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {\n border-bottom: 0;\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel-heading + .list-group .list-group-item:first-child {\n border-top-width: 0;\n}\n.list-group + .panel-footer {\n border-top-width: 0;\n}\n.panel > .table,\n.panel > .table-responsive > .table,\n.panel > .panel-collapse > .table {\n margin-bottom: 0;\n}\n.panel > .table caption,\n.panel > .table-responsive > .table caption,\n.panel > .panel-collapse > .table caption {\n padding-left: 15px;\n padding-right: 15px;\n}\n.panel > .table:first-child,\n.panel > .table-responsive:first-child > .table:first-child {\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {\n border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {\n border-top-right-radius: 3px;\n}\n.panel > .table:last-child,\n.panel > .table-responsive:last-child > .table:last-child {\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {\n border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {\n border-bottom-right-radius: 3px;\n}\n.panel > .panel-body + .table,\n.panel > .panel-body + .table-responsive,\n.panel > .table + .panel-body,\n.panel > .table-responsive + .panel-body {\n border-top: 1px solid #dddddd;\n}\n.panel > .table > tbody:first-child > tr:first-child th,\n.panel > .table > tbody:first-child > tr:first-child td {\n border-top: 0;\n}\n.panel > .table-bordered,\n.panel > .table-responsive > .table-bordered {\n border: 0;\n}\n.panel > .table-bordered > thead > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,\n.panel > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-bordered > thead > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,\n.panel > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-bordered > tfoot > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n border-left: 0;\n}\n.panel > .table-bordered > thead > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,\n.panel > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-bordered > thead > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,\n.panel > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-bordered > tfoot > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n border-right: 0;\n}\n.panel > .table-bordered > thead > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,\n.panel > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-bordered > thead > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,\n.panel > .table-bordered > tbody > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {\n border-bottom: 0;\n}\n.panel > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-bordered > tfoot > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {\n border-bottom: 0;\n}\n.panel > .table-responsive {\n border: 0;\n margin-bottom: 0;\n}\n.panel-group {\n margin-bottom: 20px;\n}\n.panel-group .panel {\n margin-bottom: 0;\n border-radius: 4px;\n}\n.panel-group .panel + .panel {\n margin-top: 5px;\n}\n.panel-group .panel-heading {\n border-bottom: 0;\n}\n.panel-group .panel-heading + .panel-collapse > .panel-body,\n.panel-group .panel-heading + .panel-collapse > .list-group {\n border-top: 1px solid #dddddd;\n}\n.panel-group .panel-footer {\n border-top: 0;\n}\n.panel-group .panel-footer + .panel-collapse .panel-body {\n border-bottom: 1px solid #dddddd;\n}\n.panel-default {\n border-color: #dddddd;\n}\n.panel-default > .panel-heading {\n color: #333333;\n background-color: #f5f5f5;\n border-color: #dddddd;\n}\n.panel-default > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #dddddd;\n}\n.panel-default > .panel-heading .badge {\n color: #f5f5f5;\n background-color: #333333;\n}\n.panel-default > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #dddddd;\n}\n.panel-primary {\n border-color: #337ab7;\n}\n.panel-primary > .panel-heading {\n color: #ffffff;\n background-color: #337ab7;\n border-color: #337ab7;\n}\n.panel-primary > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #337ab7;\n}\n.panel-primary > .panel-heading .badge {\n color: #337ab7;\n background-color: #ffffff;\n}\n.panel-primary > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #337ab7;\n}\n.panel-success {\n border-color: #d6e9c6;\n}\n.panel-success > .panel-heading {\n color: #3c763d;\n background-color: #dff0d8;\n border-color: #d6e9c6;\n}\n.panel-success > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #d6e9c6;\n}\n.panel-success > .panel-heading .badge {\n color: #dff0d8;\n background-color: #3c763d;\n}\n.panel-success > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #d6e9c6;\n}\n.panel-info {\n border-color: #bce8f1;\n}\n.panel-info > .panel-heading {\n color: #31708f;\n background-color: #d9edf7;\n border-color: #bce8f1;\n}\n.panel-info > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #bce8f1;\n}\n.panel-info > .panel-heading .badge {\n color: #d9edf7;\n background-color: #31708f;\n}\n.panel-info > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #bce8f1;\n}\n.panel-warning {\n border-color: #faebcc;\n}\n.panel-warning > .panel-heading {\n color: #8a6d3b;\n background-color: #fcf8e3;\n border-color: #faebcc;\n}\n.panel-warning > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #faebcc;\n}\n.panel-warning > .panel-heading .badge {\n color: #fcf8e3;\n background-color: #8a6d3b;\n}\n.panel-warning > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #faebcc;\n}\n.panel-danger {\n border-color: #ebccd1;\n}\n.panel-danger > .panel-heading {\n color: #a94442;\n background-color: #f2dede;\n border-color: #ebccd1;\n}\n.panel-danger > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #ebccd1;\n}\n.panel-danger > .panel-heading .badge {\n color: #f2dede;\n background-color: #a94442;\n}\n.panel-danger > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #ebccd1;\n}\n.embed-responsive {\n position: relative;\n display: block;\n height: 0;\n padding: 0;\n overflow: hidden;\n}\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n border: 0;\n}\n.embed-responsive-16by9 {\n padding-bottom: 56.25%;\n}\n.embed-responsive-4by3 {\n padding-bottom: 75%;\n}\n.well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.well blockquote {\n border-color: #ddd;\n border-color: rgba(0, 0, 0, 0.15);\n}\n.well-lg {\n padding: 24px;\n border-radius: 6px;\n}\n.well-sm {\n padding: 9px;\n border-radius: 3px;\n}\n.close {\n float: right;\n font-size: 21px;\n font-weight: bold;\n line-height: 1;\n color: #000000;\n text-shadow: 0 1px 0 #ffffff;\n opacity: 0.2;\n filter: alpha(opacity=20);\n}\n.close:hover,\n.close:focus {\n color: #000000;\n text-decoration: none;\n cursor: pointer;\n opacity: 0.5;\n filter: alpha(opacity=50);\n}\nbutton.close {\n padding: 0;\n cursor: pointer;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n}\n.modal-open {\n overflow: hidden;\n}\n.modal {\n display: none;\n overflow: hidden;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1050;\n -webkit-overflow-scrolling: touch;\n outline: 0;\n}\n.modal.fade .modal-dialog {\n -webkit-transform: translate(0, -25%);\n -ms-transform: translate(0, -25%);\n -o-transform: translate(0, -25%);\n transform: translate(0, -25%);\n -webkit-transition: -webkit-transform 0.3s ease-out;\n -moz-transition: -moz-transform 0.3s ease-out;\n -o-transition: -o-transform 0.3s ease-out;\n transition: transform 0.3s ease-out;\n}\n.modal.in .modal-dialog {\n -webkit-transform: translate(0, 0);\n -ms-transform: translate(0, 0);\n -o-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.modal-open .modal {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.modal-dialog {\n position: relative;\n width: auto;\n margin: 10px;\n}\n.modal-content {\n position: relative;\n background-color: #ffffff;\n border: 1px solid #999999;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n background-clip: padding-box;\n outline: 0;\n}\n.modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1040;\n background-color: #000000;\n}\n.modal-backdrop.fade {\n opacity: 0;\n filter: alpha(opacity=0);\n}\n.modal-backdrop.in {\n opacity: 0.5;\n filter: alpha(opacity=50);\n}\n.modal-header {\n padding: 15px;\n border-bottom: 1px solid #e5e5e5;\n min-height: 16.42857143px;\n}\n.modal-header .close {\n margin-top: -2px;\n}\n.modal-title {\n margin: 0;\n line-height: 1.42857143;\n}\n.modal-body {\n position: relative;\n padding: 15px;\n}\n.modal-footer {\n padding: 15px;\n text-align: right;\n border-top: 1px solid #e5e5e5;\n}\n.modal-footer .btn + .btn {\n margin-left: 5px;\n margin-bottom: 0;\n}\n.modal-footer .btn-group .btn + .btn {\n margin-left: -1px;\n}\n.modal-footer .btn-block + .btn-block {\n margin-left: 0;\n}\n.modal-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n@media (min-width: 768px) {\n .modal-dialog {\n width: 600px;\n margin: 30px auto;\n }\n .modal-content {\n -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n }\n .modal-sm {\n width: 300px;\n }\n}\n@media (min-width: 992px) {\n .modal-lg {\n width: 900px;\n }\n}\n.tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 1.4;\n opacity: 0;\n filter: alpha(opacity=0);\n}\n.tooltip.in {\n opacity: 0.9;\n filter: alpha(opacity=90);\n}\n.tooltip.top {\n margin-top: -3px;\n padding: 5px 0;\n}\n.tooltip.right {\n margin-left: 3px;\n padding: 0 5px;\n}\n.tooltip.bottom {\n margin-top: 3px;\n padding: 5px 0;\n}\n.tooltip.left {\n margin-left: -3px;\n padding: 0 5px;\n}\n.tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #ffffff;\n text-align: center;\n text-decoration: none;\n background-color: #000000;\n border-radius: 4px;\n}\n.tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000000;\n}\n.tooltip.top-left .tooltip-arrow {\n bottom: 0;\n right: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000000;\n}\n.tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000000;\n}\n.tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000000;\n}\n.tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000000;\n}\n.tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000000;\n}\n.tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000000;\n}\n.tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000000;\n}\n.popover {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1060;\n display: none;\n max-width: 276px;\n padding: 1px;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n font-weight: normal;\n line-height: 1.42857143;\n text-align: left;\n background-color: #ffffff;\n background-clip: padding-box;\n border: 1px solid #cccccc;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n white-space: normal;\n}\n.popover.top {\n margin-top: -10px;\n}\n.popover.right {\n margin-left: 10px;\n}\n.popover.bottom {\n margin-top: 10px;\n}\n.popover.left {\n margin-left: -10px;\n}\n.popover-title {\n margin: 0;\n padding: 8px 14px;\n font-size: 14px;\n background-color: #f7f7f7;\n border-bottom: 1px solid #ebebeb;\n border-radius: 5px 5px 0 0;\n}\n.popover-content {\n padding: 9px 14px;\n}\n.popover > .arrow,\n.popover > .arrow:after {\n position: absolute;\n display: block;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.popover > .arrow {\n border-width: 11px;\n}\n.popover > .arrow:after {\n border-width: 10px;\n content: \"\";\n}\n.popover.top > .arrow {\n left: 50%;\n margin-left: -11px;\n border-bottom-width: 0;\n border-top-color: #999999;\n border-top-color: rgba(0, 0, 0, 0.25);\n bottom: -11px;\n}\n.popover.top > .arrow:after {\n content: \" \";\n bottom: 1px;\n margin-left: -10px;\n border-bottom-width: 0;\n border-top-color: #ffffff;\n}\n.popover.right > .arrow {\n top: 50%;\n left: -11px;\n margin-top: -11px;\n border-left-width: 0;\n border-right-color: #999999;\n border-right-color: rgba(0, 0, 0, 0.25);\n}\n.popover.right > .arrow:after {\n content: \" \";\n left: 1px;\n bottom: -10px;\n border-left-width: 0;\n border-right-color: #ffffff;\n}\n.popover.bottom > .arrow {\n left: 50%;\n margin-left: -11px;\n border-top-width: 0;\n border-bottom-color: #999999;\n border-bottom-color: rgba(0, 0, 0, 0.25);\n top: -11px;\n}\n.popover.bottom > .arrow:after {\n content: \" \";\n top: 1px;\n margin-left: -10px;\n border-top-width: 0;\n border-bottom-color: #ffffff;\n}\n.popover.left > .arrow {\n top: 50%;\n right: -11px;\n margin-top: -11px;\n border-right-width: 0;\n border-left-color: #999999;\n border-left-color: rgba(0, 0, 0, 0.25);\n}\n.popover.left > .arrow:after {\n content: \" \";\n right: 1px;\n border-right-width: 0;\n border-left-color: #ffffff;\n bottom: -10px;\n}\n.carousel {\n position: relative;\n}\n.carousel-inner {\n position: relative;\n overflow: hidden;\n width: 100%;\n}\n.carousel-inner > .item {\n display: none;\n position: relative;\n -webkit-transition: 0.6s ease-in-out left;\n -o-transition: 0.6s ease-in-out left;\n transition: 0.6s ease-in-out left;\n}\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n line-height: 1;\n}\n@media all and (transform-3d), (-webkit-transform-3d) {\n .carousel-inner > .item {\n -webkit-transition: -webkit-transform 0.6s ease-in-out;\n -moz-transition: -moz-transform 0.6s ease-in-out;\n -o-transition: -o-transform 0.6s ease-in-out;\n transition: transform 0.6s ease-in-out;\n -webkit-backface-visibility: hidden;\n -moz-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-perspective: 1000;\n -moz-perspective: 1000;\n perspective: 1000;\n }\n .carousel-inner > .item.next,\n .carousel-inner > .item.active.right {\n -webkit-transform: translate3d(100%, 0, 0);\n transform: translate3d(100%, 0, 0);\n left: 0;\n }\n .carousel-inner > .item.prev,\n .carousel-inner > .item.active.left {\n -webkit-transform: translate3d(-100%, 0, 0);\n transform: translate3d(-100%, 0, 0);\n left: 0;\n }\n .carousel-inner > .item.next.left,\n .carousel-inner > .item.prev.right,\n .carousel-inner > .item.active {\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n left: 0;\n }\n}\n.carousel-inner > .active,\n.carousel-inner > .next,\n.carousel-inner > .prev {\n display: block;\n}\n.carousel-inner > .active {\n left: 0;\n}\n.carousel-inner > .next,\n.carousel-inner > .prev {\n position: absolute;\n top: 0;\n width: 100%;\n}\n.carousel-inner > .next {\n left: 100%;\n}\n.carousel-inner > .prev {\n left: -100%;\n}\n.carousel-inner > .next.left,\n.carousel-inner > .prev.right {\n left: 0;\n}\n.carousel-inner > .active.left {\n left: -100%;\n}\n.carousel-inner > .active.right {\n left: 100%;\n}\n.carousel-control {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 15%;\n opacity: 0.5;\n filter: alpha(opacity=50);\n font-size: 20px;\n color: #ffffff;\n text-align: center;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n}\n.carousel-control.left {\n background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);\n}\n.carousel-control.right {\n left: auto;\n right: 0;\n background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);\n}\n.carousel-control:hover,\n.carousel-control:focus {\n outline: 0;\n color: #ffffff;\n text-decoration: none;\n opacity: 0.9;\n filter: alpha(opacity=90);\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-left,\n.carousel-control .glyphicon-chevron-right {\n position: absolute;\n top: 50%;\n z-index: 5;\n display: inline-block;\n}\n.carousel-control .icon-prev,\n.carousel-control .glyphicon-chevron-left {\n left: 50%;\n margin-left: -10px;\n}\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-right {\n right: 50%;\n margin-right: -10px;\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next {\n width: 20px;\n height: 20px;\n margin-top: -10px;\n line-height: 1;\n font-family: serif;\n}\n.carousel-control .icon-prev:before {\n content: '\\2039';\n}\n.carousel-control .icon-next:before {\n content: '\\203a';\n}\n.carousel-indicators {\n position: absolute;\n bottom: 10px;\n left: 50%;\n z-index: 15;\n width: 60%;\n margin-left: -30%;\n padding-left: 0;\n list-style: none;\n text-align: center;\n}\n.carousel-indicators li {\n display: inline-block;\n width: 10px;\n height: 10px;\n margin: 1px;\n text-indent: -999px;\n border: 1px solid #ffffff;\n border-radius: 10px;\n cursor: pointer;\n background-color: #000 \\9;\n background-color: rgba(0, 0, 0, 0);\n}\n.carousel-indicators .active {\n margin: 0;\n width: 12px;\n height: 12px;\n background-color: #ffffff;\n}\n.carousel-caption {\n position: absolute;\n left: 15%;\n right: 15%;\n bottom: 20px;\n z-index: 10;\n padding-top: 20px;\n padding-bottom: 20px;\n color: #ffffff;\n text-align: center;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n}\n.carousel-caption .btn {\n text-shadow: none;\n}\n@media screen and (min-width: 768px) {\n .carousel-control .glyphicon-chevron-left,\n .carousel-control .glyphicon-chevron-right,\n .carousel-control .icon-prev,\n .carousel-control .icon-next {\n width: 30px;\n height: 30px;\n margin-top: -15px;\n font-size: 30px;\n }\n .carousel-control .glyphicon-chevron-left,\n .carousel-control .icon-prev {\n margin-left: -15px;\n }\n .carousel-control .glyphicon-chevron-right,\n .carousel-control .icon-next {\n margin-right: -15px;\n }\n .carousel-caption {\n left: 20%;\n right: 20%;\n padding-bottom: 30px;\n }\n .carousel-indicators {\n bottom: 20px;\n }\n}\n.clearfix:before,\n.clearfix:after,\n.dl-horizontal dd:before,\n.dl-horizontal dd:after,\n.container:before,\n.container:after,\n.container-fluid:before,\n.container-fluid:after,\n.row:before,\n.row:after,\n.form-horizontal .form-group:before,\n.form-horizontal .form-group:after,\n.btn-toolbar:before,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:before,\n.btn-group-vertical > .btn-group:after,\n.nav:before,\n.nav:after,\n.navbar:before,\n.navbar:after,\n.navbar-header:before,\n.navbar-header:after,\n.navbar-collapse:before,\n.navbar-collapse:after,\n.pager:before,\n.pager:after,\n.panel-body:before,\n.panel-body:after,\n.modal-footer:before,\n.modal-footer:after {\n content: \" \";\n display: table;\n}\n.clearfix:after,\n.dl-horizontal dd:after,\n.container:after,\n.container-fluid:after,\n.row:after,\n.form-horizontal .form-group:after,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:after,\n.nav:after,\n.navbar:after,\n.navbar-header:after,\n.navbar-collapse:after,\n.pager:after,\n.panel-body:after,\n.modal-footer:after {\n clear: both;\n}\n.center-block {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n.pull-right {\n float: right !important;\n}\n.pull-left {\n float: left !important;\n}\n.hide {\n display: none !important;\n}\n.show {\n display: block !important;\n}\n.invisible {\n visibility: hidden;\n}\n.text-hide {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n.hidden {\n display: none !important;\n}\n.affix {\n position: fixed;\n}\n@-ms-viewport {\n width: device-width;\n}\n.visible-xs,\n.visible-sm,\n.visible-md,\n.visible-lg {\n display: none !important;\n}\n.visible-xs-block,\n.visible-xs-inline,\n.visible-xs-inline-block,\n.visible-sm-block,\n.visible-sm-inline,\n.visible-sm-inline-block,\n.visible-md-block,\n.visible-md-inline,\n.visible-md-inline-block,\n.visible-lg-block,\n.visible-lg-inline,\n.visible-lg-inline-block {\n display: none !important;\n}\n@media (max-width: 767px) {\n .visible-xs {\n display: block !important;\n }\n table.visible-xs {\n display: table;\n }\n tr.visible-xs {\n display: table-row !important;\n }\n th.visible-xs,\n td.visible-xs {\n display: table-cell !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-block {\n display: block !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-inline {\n display: inline !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm {\n display: block !important;\n }\n table.visible-sm {\n display: table;\n }\n tr.visible-sm {\n display: table-row !important;\n }\n th.visible-sm,\n td.visible-sm {\n display: table-cell !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-block {\n display: block !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-inline {\n display: inline !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md {\n display: block !important;\n }\n table.visible-md {\n display: table;\n }\n tr.visible-md {\n display: table-row !important;\n }\n th.visible-md,\n td.visible-md {\n display: table-cell !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-block {\n display: block !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-inline {\n display: inline !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg {\n display: block !important;\n }\n table.visible-lg {\n display: table;\n }\n tr.visible-lg {\n display: table-row !important;\n }\n th.visible-lg,\n td.visible-lg {\n display: table-cell !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-block {\n display: block !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-inline {\n display: inline !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-inline-block {\n display: inline-block !important;\n }\n}\n@media (max-width: 767px) {\n .hidden-xs {\n display: none !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .hidden-sm {\n display: none !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .hidden-md {\n display: none !important;\n }\n}\n@media (min-width: 1200px) {\n .hidden-lg {\n display: none !important;\n }\n}\n.visible-print {\n display: none !important;\n}\n@media print {\n .visible-print {\n display: block !important;\n }\n table.visible-print {\n display: table;\n }\n tr.visible-print {\n display: table-row !important;\n }\n th.visible-print,\n td.visible-print {\n display: table-cell !important;\n }\n}\n.visible-print-block {\n display: none !important;\n}\n@media print {\n .visible-print-block {\n display: block !important;\n }\n}\n.visible-print-inline {\n display: none !important;\n}\n@media print {\n .visible-print-inline {\n display: inline !important;\n }\n}\n.visible-print-inline-block {\n display: none !important;\n}\n@media print {\n .visible-print-inline-block {\n display: inline-block !important;\n }\n}\n@media print {\n .hidden-print {\n display: none !important;\n }\n}\n/*# sourceMappingURL=bootstrap.css.map */","/*! normalize.css v3.0.2 | MIT License | git.io/normalize */\n\n//\n// 1. Set default font family to sans-serif.\n// 2. Prevent iOS text size adjust after orientation change, without disabling\n// user zoom.\n//\n\nhtml {\n font-family: sans-serif; // 1\n -ms-text-size-adjust: 100%; // 2\n -webkit-text-size-adjust: 100%; // 2\n}\n\n//\n// Remove default margin.\n//\n\nbody {\n margin: 0;\n}\n\n// HTML5 display definitions\n// ==========================================================================\n\n//\n// Correct `block` display not defined for any HTML5 element in IE 8/9.\n// Correct `block` display not defined for `details` or `summary` in IE 10/11\n// and Firefox.\n// Correct `block` display not defined for `main` in IE 11.\n//\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\n\n//\n// 1. Correct `inline-block` display not defined in IE 8/9.\n// 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n//\n\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block; // 1\n vertical-align: baseline; // 2\n}\n\n//\n// Prevent modern browsers from displaying `audio` without controls.\n// Remove excess height in iOS 5 devices.\n//\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n//\n// Address `[hidden]` styling not present in IE 8/9/10.\n// Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.\n//\n\n[hidden],\ntemplate {\n display: none;\n}\n\n// Links\n// ==========================================================================\n\n//\n// Remove the gray background color from active links in IE 10.\n//\n\na {\n background-color: transparent;\n}\n\n//\n// Improve readability when focused and also mouse hovered in all browsers.\n//\n\na:active,\na:hover {\n outline: 0;\n}\n\n// Text-level semantics\n// ==========================================================================\n\n//\n// Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n//\n\nabbr[title] {\n border-bottom: 1px dotted;\n}\n\n//\n// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n//\n\nb,\nstrong {\n font-weight: bold;\n}\n\n//\n// Address styling not present in Safari and Chrome.\n//\n\ndfn {\n font-style: italic;\n}\n\n//\n// Address variable `h1` font-size and margin within `section` and `article`\n// contexts in Firefox 4+, Safari, and Chrome.\n//\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\nmark {\n background: #ff0;\n color: #000;\n}\n\n//\n// Address inconsistent and variable font size in all browsers.\n//\n\nsmall {\n font-size: 80%;\n}\n\n//\n// Prevent `sub` and `sup` affecting `line-height` in all browsers.\n//\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n// Embedded content\n// ==========================================================================\n\n//\n// Remove border when inside `a` element in IE 8/9/10.\n//\n\nimg {\n border: 0;\n}\n\n//\n// Correct overflow not hidden in IE 9/10/11.\n//\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n// Grouping content\n// ==========================================================================\n\n//\n// Address margin not present in IE 8/9 and Safari.\n//\n\nfigure {\n margin: 1em 40px;\n}\n\n//\n// Address differences between Firefox and other browsers.\n//\n\nhr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n}\n\n//\n// Contain overflow in all browsers.\n//\n\npre {\n overflow: auto;\n}\n\n//\n// Address odd `em`-unit font size rendering in all browsers.\n//\n\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\n// Forms\n// ==========================================================================\n\n//\n// Known limitation: by default, Chrome and Safari on OS X allow very limited\n// styling of `select`, unless a `border` property is set.\n//\n\n//\n// 1. Correct color not being inherited.\n// Known issue: affects color of disabled elements.\n// 2. Correct font properties not being inherited.\n// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n//\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit; // 1\n font: inherit; // 2\n margin: 0; // 3\n}\n\n//\n// Address `overflow` set to `hidden` in IE 8/9/10/11.\n//\n\nbutton {\n overflow: visible;\n}\n\n//\n// Address inconsistent `text-transform` inheritance for `button` and `select`.\n// All other form control elements do not inherit `text-transform` values.\n// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n// Correct `select` style inheritance in Firefox.\n//\n\nbutton,\nselect {\n text-transform: none;\n}\n\n//\n// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n// and `video` controls.\n// 2. Correct inability to style clickable `input` types in iOS.\n// 3. Improve usability and consistency of cursor style between image-type\n// `input` and others.\n//\n\nbutton,\nhtml input[type=\"button\"], // 1\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; // 2\n cursor: pointer; // 3\n}\n\n//\n// Re-set default cursor for disabled elements.\n//\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n//\n// Remove inner padding and border in Firefox 4+.\n//\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n//\n// Address Firefox 4+ setting `line-height` on `input` using `!important` in\n// the UA stylesheet.\n//\n\ninput {\n line-height: normal;\n}\n\n//\n// It's recommended that you don't attempt to style these elements.\n// Firefox's implementation doesn't respect box-sizing, padding, or width.\n//\n// 1. Address box sizing set to `content-box` in IE 8/9/10.\n// 2. Remove excess padding in IE 8/9/10.\n//\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; // 1\n padding: 0; // 2\n}\n\n//\n// Fix the cursor style for Chrome's increment/decrement buttons. For certain\n// `font-size` values of the `input`, it causes the cursor style of the\n// decrement button to change from `default` to `text`.\n//\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n//\n// 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n// 2. Address `box-sizing` set to `border-box` in Safari and Chrome\n// (include `-moz` to future-proof).\n//\n\ninput[type=\"search\"] {\n -webkit-appearance: textfield; // 1\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box; // 2\n box-sizing: content-box;\n}\n\n//\n// Remove inner padding and search cancel button in Safari and Chrome on OS X.\n// Safari (but not Chrome) clips the cancel button when the search input has\n// padding (and `textfield` appearance).\n//\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// Define consistent border, margin, and padding.\n//\n\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\n\n//\n// 1. Correct `color` not being inherited in IE 8/9/10/11.\n// 2. Remove padding so people aren't caught out if they zero out fieldsets.\n//\n\nlegend {\n border: 0; // 1\n padding: 0; // 2\n}\n\n//\n// Remove default vertical scrollbar in IE 8/9/10/11.\n//\n\ntextarea {\n overflow: auto;\n}\n\n//\n// Don't inherit the `font-weight` (applied by a rule above).\n// NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n//\n\noptgroup {\n font-weight: bold;\n}\n\n// Tables\n// ==========================================================================\n\n//\n// Remove most spacing between table cells.\n//\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n\n// ==========================================================================\n// Print styles.\n// Inlined to avoid the additional HTTP request: h5bp.com/r\n// ==========================================================================\n\n@media print {\n *,\n *:before,\n *:after {\n background: transparent !important;\n color: #000 !important; // Black prints faster: h5bp.com/s\n box-shadow: none !important;\n text-shadow: none !important;\n }\n\n a,\n a:visited {\n text-decoration: underline;\n }\n\n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n\n // Don't show links that are fragment identifiers,\n // or use the `javascript:` pseudo protocol\n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n\n thead {\n display: table-header-group; // h5bp.com/t\n }\n\n tr,\n img {\n page-break-inside: avoid;\n }\n\n img {\n max-width: 100% !important;\n }\n\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n\n h2,\n h3 {\n page-break-after: avoid;\n }\n\n // Bootstrap specific changes start\n //\n // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245\n // Once fixed, we can just straight up remove this.\n select {\n background: #fff !important;\n }\n\n // Bootstrap components\n .navbar {\n display: none;\n }\n .btn,\n .dropup > .btn {\n > .caret {\n border-top-color: #000 !important;\n }\n }\n .label {\n border: 1px solid #000;\n }\n\n .table {\n border-collapse: collapse !important;\n\n td,\n th {\n background-color: #fff !important;\n }\n }\n .table-bordered {\n th,\n td {\n border: 1px solid #ddd !important;\n }\n }\n\n // Bootstrap specific changes end\n}\n","//\n// Glyphicons for Bootstrap\n//\n// Since icons are fonts, they can be placed anywhere text is placed and are\n// thus automatically sized to match the surrounding child. To use, create an\n// inline element with the appropriate classes, like so:\n//\n// Star\n\n// Import the fonts\n@font-face {\n font-family: 'Glyphicons Halflings';\n src: url('@{icon-font-path}@{icon-font-name}.eot');\n src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'),\n url('@{icon-font-path}@{icon-font-name}.woff2') format('woff2'),\n url('@{icon-font-path}@{icon-font-name}.woff') format('woff'),\n url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'),\n url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');\n}\n\n// Catchall baseclass\n.glyphicon {\n position: relative;\n top: 1px;\n display: inline-block;\n font-family: 'Glyphicons Halflings';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n// Individual icons\n.glyphicon-asterisk { &:before { content: \"\\2a\"; } }\n.glyphicon-plus { &:before { content: \"\\2b\"; } }\n.glyphicon-euro,\n.glyphicon-eur { &:before { content: \"\\20ac\"; } }\n.glyphicon-minus { &:before { content: \"\\2212\"; } }\n.glyphicon-cloud { &:before { content: \"\\2601\"; } }\n.glyphicon-envelope { &:before { content: \"\\2709\"; } }\n.glyphicon-pencil { &:before { content: \"\\270f\"; } }\n.glyphicon-glass { &:before { content: \"\\e001\"; } }\n.glyphicon-music { &:before { content: \"\\e002\"; } }\n.glyphicon-search { &:before { content: \"\\e003\"; } }\n.glyphicon-heart { &:before { content: \"\\e005\"; } }\n.glyphicon-star { &:before { content: \"\\e006\"; } }\n.glyphicon-star-empty { &:before { content: \"\\e007\"; } }\n.glyphicon-user { &:before { content: \"\\e008\"; } }\n.glyphicon-film { &:before { content: \"\\e009\"; } }\n.glyphicon-th-large { &:before { content: \"\\e010\"; } }\n.glyphicon-th { &:before { content: \"\\e011\"; } }\n.glyphicon-th-list { &:before { content: \"\\e012\"; } }\n.glyphicon-ok { &:before { content: \"\\e013\"; } }\n.glyphicon-remove { &:before { content: \"\\e014\"; } }\n.glyphicon-zoom-in { &:before { content: \"\\e015\"; } }\n.glyphicon-zoom-out { &:before { content: \"\\e016\"; } }\n.glyphicon-off { &:before { content: \"\\e017\"; } }\n.glyphicon-signal { &:before { content: \"\\e018\"; } }\n.glyphicon-cog { &:before { content: \"\\e019\"; } }\n.glyphicon-trash { &:before { content: \"\\e020\"; } }\n.glyphicon-home { &:before { content: \"\\e021\"; } }\n.glyphicon-file { &:before { content: \"\\e022\"; } }\n.glyphicon-time { &:before { content: \"\\e023\"; } }\n.glyphicon-road { &:before { content: \"\\e024\"; } }\n.glyphicon-download-alt { &:before { content: \"\\e025\"; } }\n.glyphicon-download { &:before { content: \"\\e026\"; } }\n.glyphicon-upload { &:before { content: \"\\e027\"; } }\n.glyphicon-inbox { &:before { content: \"\\e028\"; } }\n.glyphicon-play-circle { &:before { content: \"\\e029\"; } }\n.glyphicon-repeat { &:before { content: \"\\e030\"; } }\n.glyphicon-refresh { &:before { content: \"\\e031\"; } }\n.glyphicon-list-alt { &:before { content: \"\\e032\"; } }\n.glyphicon-lock { &:before { content: \"\\e033\"; } }\n.glyphicon-flag { &:before { content: \"\\e034\"; } }\n.glyphicon-headphones { &:before { content: \"\\e035\"; } }\n.glyphicon-volume-off { &:before { content: \"\\e036\"; } }\n.glyphicon-volume-down { &:before { content: \"\\e037\"; } }\n.glyphicon-volume-up { &:before { content: \"\\e038\"; } }\n.glyphicon-qrcode { &:before { content: \"\\e039\"; } }\n.glyphicon-barcode { &:before { content: \"\\e040\"; } }\n.glyphicon-tag { &:before { content: \"\\e041\"; } }\n.glyphicon-tags { &:before { content: \"\\e042\"; } }\n.glyphicon-book { &:before { content: \"\\e043\"; } }\n.glyphicon-bookmark { &:before { content: \"\\e044\"; } }\n.glyphicon-print { &:before { content: \"\\e045\"; } }\n.glyphicon-camera { &:before { content: \"\\e046\"; } }\n.glyphicon-font { &:before { content: \"\\e047\"; } }\n.glyphicon-bold { &:before { content: \"\\e048\"; } }\n.glyphicon-italic { &:before { content: \"\\e049\"; } }\n.glyphicon-text-height { &:before { content: \"\\e050\"; } }\n.glyphicon-text-width { &:before { content: \"\\e051\"; } }\n.glyphicon-align-left { &:before { content: \"\\e052\"; } }\n.glyphicon-align-center { &:before { content: \"\\e053\"; } }\n.glyphicon-align-right { &:before { content: \"\\e054\"; } }\n.glyphicon-align-justify { &:before { content: \"\\e055\"; } }\n.glyphicon-list { &:before { content: \"\\e056\"; } }\n.glyphicon-indent-left { &:before { content: \"\\e057\"; } }\n.glyphicon-indent-right { &:before { content: \"\\e058\"; } }\n.glyphicon-facetime-video { &:before { content: \"\\e059\"; } }\n.glyphicon-picture { &:before { content: \"\\e060\"; } }\n.glyphicon-map-marker { &:before { content: \"\\e062\"; } }\n.glyphicon-adjust { &:before { content: \"\\e063\"; } }\n.glyphicon-tint { &:before { content: \"\\e064\"; } }\n.glyphicon-edit { &:before { content: \"\\e065\"; } }\n.glyphicon-share { &:before { content: \"\\e066\"; } }\n.glyphicon-check { &:before { content: \"\\e067\"; } }\n.glyphicon-move { &:before { content: \"\\e068\"; } }\n.glyphicon-step-backward { &:before { content: \"\\e069\"; } }\n.glyphicon-fast-backward { &:before { content: \"\\e070\"; } }\n.glyphicon-backward { &:before { content: \"\\e071\"; } }\n.glyphicon-play { &:before { content: \"\\e072\"; } }\n.glyphicon-pause { &:before { content: \"\\e073\"; } }\n.glyphicon-stop { &:before { content: \"\\e074\"; } }\n.glyphicon-forward { &:before { content: \"\\e075\"; } }\n.glyphicon-fast-forward { &:before { content: \"\\e076\"; } }\n.glyphicon-step-forward { &:before { content: \"\\e077\"; } }\n.glyphicon-eject { &:before { content: \"\\e078\"; } }\n.glyphicon-chevron-left { &:before { content: \"\\e079\"; } }\n.glyphicon-chevron-right { &:before { content: \"\\e080\"; } }\n.glyphicon-plus-sign { &:before { content: \"\\e081\"; } }\n.glyphicon-minus-sign { &:before { content: \"\\e082\"; } }\n.glyphicon-remove-sign { &:before { content: \"\\e083\"; } }\n.glyphicon-ok-sign { &:before { content: \"\\e084\"; } }\n.glyphicon-question-sign { &:before { content: \"\\e085\"; } }\n.glyphicon-info-sign { &:before { content: \"\\e086\"; } }\n.glyphicon-screenshot { &:before { content: \"\\e087\"; } }\n.glyphicon-remove-circle { &:before { content: \"\\e088\"; } }\n.glyphicon-ok-circle { &:before { content: \"\\e089\"; } }\n.glyphicon-ban-circle { &:before { content: \"\\e090\"; } }\n.glyphicon-arrow-left { &:before { content: \"\\e091\"; } }\n.glyphicon-arrow-right { &:before { content: \"\\e092\"; } }\n.glyphicon-arrow-up { &:before { content: \"\\e093\"; } }\n.glyphicon-arrow-down { &:before { content: \"\\e094\"; } }\n.glyphicon-share-alt { &:before { content: \"\\e095\"; } }\n.glyphicon-resize-full { &:before { content: \"\\e096\"; } }\n.glyphicon-resize-small { &:before { content: \"\\e097\"; } }\n.glyphicon-exclamation-sign { &:before { content: \"\\e101\"; } }\n.glyphicon-gift { &:before { content: \"\\e102\"; } }\n.glyphicon-leaf { &:before { content: \"\\e103\"; } }\n.glyphicon-fire { &:before { content: \"\\e104\"; } }\n.glyphicon-eye-open { &:before { content: \"\\e105\"; } }\n.glyphicon-eye-close { &:before { content: \"\\e106\"; } }\n.glyphicon-warning-sign { &:before { content: \"\\e107\"; } }\n.glyphicon-plane { &:before { content: \"\\e108\"; } }\n.glyphicon-calendar { &:before { content: \"\\e109\"; } }\n.glyphicon-random { &:before { content: \"\\e110\"; } }\n.glyphicon-comment { &:before { content: \"\\e111\"; } }\n.glyphicon-magnet { &:before { content: \"\\e112\"; } }\n.glyphicon-chevron-up { &:before { content: \"\\e113\"; } }\n.glyphicon-chevron-down { &:before { content: \"\\e114\"; } }\n.glyphicon-retweet { &:before { content: \"\\e115\"; } }\n.glyphicon-shopping-cart { &:before { content: \"\\e116\"; } }\n.glyphicon-folder-close { &:before { content: \"\\e117\"; } }\n.glyphicon-folder-open { &:before { content: \"\\e118\"; } }\n.glyphicon-resize-vertical { &:before { content: \"\\e119\"; } }\n.glyphicon-resize-horizontal { &:before { content: \"\\e120\"; } }\n.glyphicon-hdd { &:before { content: \"\\e121\"; } }\n.glyphicon-bullhorn { &:before { content: \"\\e122\"; } }\n.glyphicon-bell { &:before { content: \"\\e123\"; } }\n.glyphicon-certificate { &:before { content: \"\\e124\"; } }\n.glyphicon-thumbs-up { &:before { content: \"\\e125\"; } }\n.glyphicon-thumbs-down { &:before { content: \"\\e126\"; } }\n.glyphicon-hand-right { &:before { content: \"\\e127\"; } }\n.glyphicon-hand-left { &:before { content: \"\\e128\"; } }\n.glyphicon-hand-up { &:before { content: \"\\e129\"; } }\n.glyphicon-hand-down { &:before { content: \"\\e130\"; } }\n.glyphicon-circle-arrow-right { &:before { content: \"\\e131\"; } }\n.glyphicon-circle-arrow-left { &:before { content: \"\\e132\"; } }\n.glyphicon-circle-arrow-up { &:before { content: \"\\e133\"; } }\n.glyphicon-circle-arrow-down { &:before { content: \"\\e134\"; } }\n.glyphicon-globe { &:before { content: \"\\e135\"; } }\n.glyphicon-wrench { &:before { content: \"\\e136\"; } }\n.glyphicon-tasks { &:before { content: \"\\e137\"; } }\n.glyphicon-filter { &:before { content: \"\\e138\"; } }\n.glyphicon-briefcase { &:before { content: \"\\e139\"; } }\n.glyphicon-fullscreen { &:before { content: \"\\e140\"; } }\n.glyphicon-dashboard { &:before { content: \"\\e141\"; } }\n.glyphicon-paperclip { &:before { content: \"\\e142\"; } }\n.glyphicon-heart-empty { &:before { content: \"\\e143\"; } }\n.glyphicon-link { &:before { content: \"\\e144\"; } }\n.glyphicon-phone { &:before { content: \"\\e145\"; } }\n.glyphicon-pushpin { &:before { content: \"\\e146\"; } }\n.glyphicon-usd { &:before { content: \"\\e148\"; } }\n.glyphicon-gbp { &:before { content: \"\\e149\"; } }\n.glyphicon-sort { &:before { content: \"\\e150\"; } }\n.glyphicon-sort-by-alphabet { &:before { content: \"\\e151\"; } }\n.glyphicon-sort-by-alphabet-alt { &:before { content: \"\\e152\"; } }\n.glyphicon-sort-by-order { &:before { content: \"\\e153\"; } }\n.glyphicon-sort-by-order-alt { &:before { content: \"\\e154\"; } }\n.glyphicon-sort-by-attributes { &:before { content: \"\\e155\"; } }\n.glyphicon-sort-by-attributes-alt { &:before { content: \"\\e156\"; } }\n.glyphicon-unchecked { &:before { content: \"\\e157\"; } }\n.glyphicon-expand { &:before { content: \"\\e158\"; } }\n.glyphicon-collapse-down { &:before { content: \"\\e159\"; } }\n.glyphicon-collapse-up { &:before { content: \"\\e160\"; } }\n.glyphicon-log-in { &:before { content: \"\\e161\"; } }\n.glyphicon-flash { &:before { content: \"\\e162\"; } }\n.glyphicon-log-out { &:before { content: \"\\e163\"; } }\n.glyphicon-new-window { &:before { content: \"\\e164\"; } }\n.glyphicon-record { &:before { content: \"\\e165\"; } }\n.glyphicon-save { &:before { content: \"\\e166\"; } }\n.glyphicon-open { &:before { content: \"\\e167\"; } }\n.glyphicon-saved { &:before { content: \"\\e168\"; } }\n.glyphicon-import { &:before { content: \"\\e169\"; } }\n.glyphicon-export { &:before { content: \"\\e170\"; } }\n.glyphicon-send { &:before { content: \"\\e171\"; } }\n.glyphicon-floppy-disk { &:before { content: \"\\e172\"; } }\n.glyphicon-floppy-saved { &:before { content: \"\\e173\"; } }\n.glyphicon-floppy-remove { &:before { content: \"\\e174\"; } }\n.glyphicon-floppy-save { &:before { content: \"\\e175\"; } }\n.glyphicon-floppy-open { &:before { content: \"\\e176\"; } }\n.glyphicon-credit-card { &:before { content: \"\\e177\"; } }\n.glyphicon-transfer { &:before { content: \"\\e178\"; } }\n.glyphicon-cutlery { &:before { content: \"\\e179\"; } }\n.glyphicon-header { &:before { content: \"\\e180\"; } }\n.glyphicon-compressed { &:before { content: \"\\e181\"; } }\n.glyphicon-earphone { &:before { content: \"\\e182\"; } }\n.glyphicon-phone-alt { &:before { content: \"\\e183\"; } }\n.glyphicon-tower { &:before { content: \"\\e184\"; } }\n.glyphicon-stats { &:before { content: \"\\e185\"; } }\n.glyphicon-sd-video { &:before { content: \"\\e186\"; } }\n.glyphicon-hd-video { &:before { content: \"\\e187\"; } }\n.glyphicon-subtitles { &:before { content: \"\\e188\"; } }\n.glyphicon-sound-stereo { &:before { content: \"\\e189\"; } }\n.glyphicon-sound-dolby { &:before { content: \"\\e190\"; } }\n.glyphicon-sound-5-1 { &:before { content: \"\\e191\"; } }\n.glyphicon-sound-6-1 { &:before { content: \"\\e192\"; } }\n.glyphicon-sound-7-1 { &:before { content: \"\\e193\"; } }\n.glyphicon-copyright-mark { &:before { content: \"\\e194\"; } }\n.glyphicon-registration-mark { &:before { content: \"\\e195\"; } }\n.glyphicon-cloud-download { &:before { content: \"\\e197\"; } }\n.glyphicon-cloud-upload { &:before { content: \"\\e198\"; } }\n.glyphicon-tree-conifer { &:before { content: \"\\e199\"; } }\n.glyphicon-tree-deciduous { &:before { content: \"\\e200\"; } }\n.glyphicon-cd { &:before { content: \"\\e201\"; } }\n.glyphicon-save-file { &:before { content: \"\\e202\"; } }\n.glyphicon-open-file { &:before { content: \"\\e203\"; } }\n.glyphicon-level-up { &:before { content: \"\\e204\"; } }\n.glyphicon-copy { &:before { content: \"\\e205\"; } }\n.glyphicon-paste { &:before { content: \"\\e206\"; } }\n// The following 2 Glyphicons are omitted for the time being because\n// they currently use Unicode codepoints that are outside the\n// Basic Multilingual Plane (BMP). Older buggy versions of WebKit can't handle\n// non-BMP codepoints in CSS string escapes, and thus can't display these two icons.\n// Notably, the bug affects some older versions of the Android Browser.\n// More info: https://github.com/twbs/bootstrap/issues/10106\n// .glyphicon-door { &:before { content: \"\\1f6aa\"; } }\n// .glyphicon-key { &:before { content: \"\\1f511\"; } }\n.glyphicon-alert { &:before { content: \"\\e209\"; } }\n.glyphicon-equalizer { &:before { content: \"\\e210\"; } }\n.glyphicon-king { &:before { content: \"\\e211\"; } }\n.glyphicon-queen { &:before { content: \"\\e212\"; } }\n.glyphicon-pawn { &:before { content: \"\\e213\"; } }\n.glyphicon-bishop { &:before { content: \"\\e214\"; } }\n.glyphicon-knight { &:before { content: \"\\e215\"; } }\n.glyphicon-baby-formula { &:before { content: \"\\e216\"; } }\n.glyphicon-tent { &:before { content: \"\\26fa\"; } }\n.glyphicon-blackboard { &:before { content: \"\\e218\"; } }\n.glyphicon-bed { &:before { content: \"\\e219\"; } }\n.glyphicon-apple { &:before { content: \"\\f8ff\"; } }\n.glyphicon-erase { &:before { content: \"\\e221\"; } }\n.glyphicon-hourglass { &:before { content: \"\\231b\"; } }\n.glyphicon-lamp { &:before { content: \"\\e223\"; } }\n.glyphicon-duplicate { &:before { content: \"\\e224\"; } }\n.glyphicon-piggy-bank { &:before { content: \"\\e225\"; } }\n.glyphicon-scissors { &:before { content: \"\\e226\"; } }\n.glyphicon-bitcoin { &:before { content: \"\\e227\"; } }\n.glyphicon-btc { &:before { content: \"\\e227\"; } }\n.glyphicon-xbt { &:before { content: \"\\e227\"; } }\n.glyphicon-yen { &:before { content: \"\\00a5\"; } }\n.glyphicon-jpy { &:before { content: \"\\00a5\"; } }\n.glyphicon-ruble { &:before { content: \"\\20bd\"; } }\n.glyphicon-rub { &:before { content: \"\\20bd\"; } }\n.glyphicon-scale { &:before { content: \"\\e230\"; } }\n.glyphicon-ice-lolly { &:before { content: \"\\e231\"; } }\n.glyphicon-ice-lolly-tasted { &:before { content: \"\\e232\"; } }\n.glyphicon-education { &:before { content: \"\\e233\"; } }\n.glyphicon-option-horizontal { &:before { content: \"\\e234\"; } }\n.glyphicon-option-vertical { &:before { content: \"\\e235\"; } }\n.glyphicon-menu-hamburger { &:before { content: \"\\e236\"; } }\n.glyphicon-modal-window { &:before { content: \"\\e237\"; } }\n.glyphicon-oil { &:before { content: \"\\e238\"; } }\n.glyphicon-grain { &:before { content: \"\\e239\"; } }\n.glyphicon-sunglasses { &:before { content: \"\\e240\"; } }\n.glyphicon-text-size { &:before { content: \"\\e241\"; } }\n.glyphicon-text-color { &:before { content: \"\\e242\"; } }\n.glyphicon-text-background { &:before { content: \"\\e243\"; } }\n.glyphicon-object-align-top { &:before { content: \"\\e244\"; } }\n.glyphicon-object-align-bottom { &:before { content: \"\\e245\"; } }\n.glyphicon-object-align-horizontal{ &:before { content: \"\\e246\"; } }\n.glyphicon-object-align-left { &:before { content: \"\\e247\"; } }\n.glyphicon-object-align-vertical { &:before { content: \"\\e248\"; } }\n.glyphicon-object-align-right { &:before { content: \"\\e249\"; } }\n.glyphicon-triangle-right { &:before { content: \"\\e250\"; } }\n.glyphicon-triangle-left { &:before { content: \"\\e251\"; } }\n.glyphicon-triangle-bottom { &:before { content: \"\\e252\"; } }\n.glyphicon-triangle-top { &:before { content: \"\\e253\"; } }\n.glyphicon-console { &:before { content: \"\\e254\"; } }\n.glyphicon-superscript { &:before { content: \"\\e255\"; } }\n.glyphicon-subscript { &:before { content: \"\\e256\"; } }\n.glyphicon-menu-left { &:before { content: \"\\e257\"; } }\n.glyphicon-menu-right { &:before { content: \"\\e258\"; } }\n.glyphicon-menu-down { &:before { content: \"\\e259\"; } }\n.glyphicon-menu-up { &:before { content: \"\\e260\"; } }\n","//\n// Scaffolding\n// --------------------------------------------------\n\n\n// Reset the box-sizing\n//\n// Heads up! This reset may cause conflicts with some third-party widgets.\n// For recommendations on resolving such conflicts, see\n// http://getbootstrap.com/getting-started/#third-box-sizing\n* {\n .box-sizing(border-box);\n}\n*:before,\n*:after {\n .box-sizing(border-box);\n}\n\n\n// Body reset\n\nhtml {\n font-size: 10px;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n\nbody {\n font-family: @font-family-base;\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @text-color;\n background-color: @body-bg;\n}\n\n// Reset fonts for relevant elements\ninput,\nbutton,\nselect,\ntextarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n\n// Links\n\na {\n color: @link-color;\n text-decoration: none;\n\n &:hover,\n &:focus {\n color: @link-hover-color;\n text-decoration: @link-hover-decoration;\n }\n\n &:focus {\n .tab-focus();\n }\n}\n\n\n// Figures\n//\n// We reset this here because previously Normalize had no `figure` margins. This\n// ensures we don't break anyone's use of the element.\n\nfigure {\n margin: 0;\n}\n\n\n// Images\n\nimg {\n vertical-align: middle;\n}\n\n// Responsive images (ensure images don't scale beyond their parents)\n.img-responsive {\n .img-responsive();\n}\n\n// Rounded corners\n.img-rounded {\n border-radius: @border-radius-large;\n}\n\n// Image thumbnails\n//\n// Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.\n.img-thumbnail {\n padding: @thumbnail-padding;\n line-height: @line-height-base;\n background-color: @thumbnail-bg;\n border: 1px solid @thumbnail-border;\n border-radius: @thumbnail-border-radius;\n .transition(all .2s ease-in-out);\n\n // Keep them at most 100% wide\n .img-responsive(inline-block);\n}\n\n// Perfect circle\n.img-circle {\n border-radius: 50%; // set radius in percents\n}\n\n\n// Horizontal rules\n\nhr {\n margin-top: @line-height-computed;\n margin-bottom: @line-height-computed;\n border: 0;\n border-top: 1px solid @hr-border;\n}\n\n\n// Only display content to screen readers\n//\n// See: http://a11yproject.com/posts/how-to-hide-content/\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0,0,0,0);\n border: 0;\n}\n\n// Use in conjunction with .sr-only to only display content when it's focused.\n// Useful for \"Skip to main content\" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1\n// Credit: HTML5 Boilerplate\n\n.sr-only-focusable {\n &:active,\n &:focus {\n position: static;\n width: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n clip: auto;\n }\n}\n\n\n// iOS \"clickable elements\" fix for role=\"button\"\n//\n// Fixes \"clickability\" issue (and more generally, the firing of events such as focus as well)\n// for traditionally non-focusable elements with role=\"button\"\n// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile\n// Upstream patch for normalize.css submitted: https://github.com/necolas/normalize.css/pull/379 - remove this fix once that is merged\n\n[role=\"button\"] {\n cursor: pointer;\n}","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They will be removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility){\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n","// WebKit-style focus\n\n.tab-focus() {\n // Default\n outline: thin dotted;\n // WebKit\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\n","// Image Mixins\n// - Responsive image\n// - Retina image\n\n\n// Responsive image\n//\n// Keep images from scaling beyond the width of their parents.\n.img-responsive(@display: block) {\n display: @display;\n max-width: 100%; // Part 1: Set a maximum relative to the parent\n height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching\n}\n\n\n// Retina image\n//\n// Short retina mixin for setting background-image and -size. Note that the\n// spelling of `min--moz-device-pixel-ratio` is intentional.\n.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {\n background-image: url(\"@{file-1x}\");\n\n @media\n only screen and (-webkit-min-device-pixel-ratio: 2),\n only screen and ( min--moz-device-pixel-ratio: 2),\n only screen and ( -o-min-device-pixel-ratio: 2/1),\n only screen and ( min-device-pixel-ratio: 2),\n only screen and ( min-resolution: 192dpi),\n only screen and ( min-resolution: 2dppx) {\n background-image: url(\"@{file-2x}\");\n background-size: @width-1x @height-1x;\n }\n}\n","//\n// Typography\n// --------------------------------------------------\n\n\n// Headings\n// -------------------------\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n font-family: @headings-font-family;\n font-weight: @headings-font-weight;\n line-height: @headings-line-height;\n color: @headings-color;\n\n small,\n .small {\n font-weight: normal;\n line-height: 1;\n color: @headings-small-color;\n }\n}\n\nh1, .h1,\nh2, .h2,\nh3, .h3 {\n margin-top: @line-height-computed;\n margin-bottom: (@line-height-computed / 2);\n\n small,\n .small {\n font-size: 65%;\n }\n}\nh4, .h4,\nh5, .h5,\nh6, .h6 {\n margin-top: (@line-height-computed / 2);\n margin-bottom: (@line-height-computed / 2);\n\n small,\n .small {\n font-size: 75%;\n }\n}\n\nh1, .h1 { font-size: @font-size-h1; }\nh2, .h2 { font-size: @font-size-h2; }\nh3, .h3 { font-size: @font-size-h3; }\nh4, .h4 { font-size: @font-size-h4; }\nh5, .h5 { font-size: @font-size-h5; }\nh6, .h6 { font-size: @font-size-h6; }\n\n\n// Body text\n// -------------------------\n\np {\n margin: 0 0 (@line-height-computed / 2);\n}\n\n.lead {\n margin-bottom: @line-height-computed;\n font-size: floor((@font-size-base * 1.15));\n font-weight: 300;\n line-height: 1.4;\n\n @media (min-width: @screen-sm-min) {\n font-size: (@font-size-base * 1.5);\n }\n}\n\n\n// Emphasis & misc\n// -------------------------\n\n// Ex: (12px small font / 14px base font) * 100% = about 85%\nsmall,\n.small {\n font-size: floor((100% * @font-size-small / @font-size-base));\n}\n\nmark,\n.mark {\n background-color: @state-warning-bg;\n padding: .2em;\n}\n\n// Alignment\n.text-left { text-align: left; }\n.text-right { text-align: right; }\n.text-center { text-align: center; }\n.text-justify { text-align: justify; }\n.text-nowrap { white-space: nowrap; }\n\n// Transformation\n.text-lowercase { text-transform: lowercase; }\n.text-uppercase { text-transform: uppercase; }\n.text-capitalize { text-transform: capitalize; }\n\n// Contextual colors\n.text-muted {\n color: @text-muted;\n}\n.text-primary {\n .text-emphasis-variant(@brand-primary);\n}\n.text-success {\n .text-emphasis-variant(@state-success-text);\n}\n.text-info {\n .text-emphasis-variant(@state-info-text);\n}\n.text-warning {\n .text-emphasis-variant(@state-warning-text);\n}\n.text-danger {\n .text-emphasis-variant(@state-danger-text);\n}\n\n// Contextual backgrounds\n// For now we'll leave these alongside the text classes until v4 when we can\n// safely shift things around (per SemVer rules).\n.bg-primary {\n // Given the contrast here, this is the only class to have its color inverted\n // automatically.\n color: #fff;\n .bg-variant(@brand-primary);\n}\n.bg-success {\n .bg-variant(@state-success-bg);\n}\n.bg-info {\n .bg-variant(@state-info-bg);\n}\n.bg-warning {\n .bg-variant(@state-warning-bg);\n}\n.bg-danger {\n .bg-variant(@state-danger-bg);\n}\n\n\n// Page header\n// -------------------------\n\n.page-header {\n padding-bottom: ((@line-height-computed / 2) - 1);\n margin: (@line-height-computed * 2) 0 @line-height-computed;\n border-bottom: 1px solid @page-header-border-color;\n}\n\n\n// Lists\n// -------------------------\n\n// Unordered and Ordered lists\nul,\nol {\n margin-top: 0;\n margin-bottom: (@line-height-computed / 2);\n ul,\n ol {\n margin-bottom: 0;\n }\n}\n\n// List options\n\n// Unstyled keeps list items block level, just removes default browser padding and list-style\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n\n// Inline turns list items into inline-block\n.list-inline {\n .list-unstyled();\n margin-left: -5px;\n\n > li {\n display: inline-block;\n padding-left: 5px;\n padding-right: 5px;\n }\n}\n\n// Description Lists\ndl {\n margin-top: 0; // Remove browser default\n margin-bottom: @line-height-computed;\n}\ndt,\ndd {\n line-height: @line-height-base;\n}\ndt {\n font-weight: bold;\n}\ndd {\n margin-left: 0; // Undo browser default\n}\n\n// Horizontal description lists\n//\n// Defaults to being stacked without any of the below styles applied, until the\n// grid breakpoint is reached (default of ~768px).\n\n.dl-horizontal {\n dd {\n &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present\n }\n\n @media (min-width: @grid-float-breakpoint) {\n dt {\n float: left;\n width: (@dl-horizontal-offset - 20);\n clear: left;\n text-align: right;\n .text-overflow();\n }\n dd {\n margin-left: @dl-horizontal-offset;\n }\n }\n}\n\n\n// Misc\n// -------------------------\n\n// Abbreviations and acronyms\nabbr[title],\n// Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257\nabbr[data-original-title] {\n cursor: help;\n border-bottom: 1px dotted @abbr-border-color;\n}\n.initialism {\n font-size: 90%;\n .text-uppercase();\n}\n\n// Blockquotes\nblockquote {\n padding: (@line-height-computed / 2) @line-height-computed;\n margin: 0 0 @line-height-computed;\n font-size: @blockquote-font-size;\n border-left: 5px solid @blockquote-border-color;\n\n p,\n ul,\n ol {\n &:last-child {\n margin-bottom: 0;\n }\n }\n\n // Note: Deprecated small and .small as of v3.1.0\n // Context: https://github.com/twbs/bootstrap/issues/11660\n footer,\n small,\n .small {\n display: block;\n font-size: 80%; // back to default font-size\n line-height: @line-height-base;\n color: @blockquote-small-color;\n\n &:before {\n content: '\\2014 \\00A0'; // em dash, nbsp\n }\n }\n}\n\n// Opposite alignment of blockquote\n//\n// Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.\n.blockquote-reverse,\nblockquote.pull-right {\n padding-right: 15px;\n padding-left: 0;\n border-right: 5px solid @blockquote-border-color;\n border-left: 0;\n text-align: right;\n\n // Account for citation\n footer,\n small,\n .small {\n &:before { content: ''; }\n &:after {\n content: '\\00A0 \\2014'; // nbsp, em dash\n }\n }\n}\n\n// Addresses\naddress {\n margin-bottom: @line-height-computed;\n font-style: normal;\n line-height: @line-height-base;\n}\n","// Typography\n\n.text-emphasis-variant(@color) {\n color: @color;\n a&:hover {\n color: darken(@color, 10%);\n }\n}\n","// Contextual backgrounds\n\n.bg-variant(@color) {\n background-color: @color;\n a&:hover {\n background-color: darken(@color, 10%);\n }\n}\n","// Text overflow\n// Requires inline-block or block for proper styling\n\n.text-overflow() {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n","//\n// Code (inline and block)\n// --------------------------------------------------\n\n\n// Inline and block code styles\ncode,\nkbd,\npre,\nsamp {\n font-family: @font-family-monospace;\n}\n\n// Inline code\ncode {\n padding: 2px 4px;\n font-size: 90%;\n color: @code-color;\n background-color: @code-bg;\n border-radius: @border-radius-base;\n}\n\n// User input typically entered via keyboard\nkbd {\n padding: 2px 4px;\n font-size: 90%;\n color: @kbd-color;\n background-color: @kbd-bg;\n border-radius: @border-radius-small;\n box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);\n\n kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n box-shadow: none;\n }\n}\n\n// Blocks of code\npre {\n display: block;\n padding: ((@line-height-computed - 1) / 2);\n margin: 0 0 (@line-height-computed / 2);\n font-size: (@font-size-base - 1); // 14px to 13px\n line-height: @line-height-base;\n word-break: break-all;\n word-wrap: break-word;\n color: @pre-color;\n background-color: @pre-bg;\n border: 1px solid @pre-border-color;\n border-radius: @border-radius-base;\n\n // Account for some code outputs that place code tags in pre tags\n code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n white-space: pre-wrap;\n background-color: transparent;\n border-radius: 0;\n }\n}\n\n// Enable scrollable blocks of code\n.pre-scrollable {\n max-height: @pre-scrollable-max-height;\n overflow-y: scroll;\n}\n","//\n// Grid system\n// --------------------------------------------------\n\n\n// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n.container {\n .container-fixed();\n\n @media (min-width: @screen-sm-min) {\n width: @container-sm;\n }\n @media (min-width: @screen-md-min) {\n width: @container-md;\n }\n @media (min-width: @screen-lg-min) {\n width: @container-lg;\n }\n}\n\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but without any defined\n// width for fluid, full width layouts.\n\n.container-fluid {\n .container-fixed();\n}\n\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n.row {\n .make-row();\n}\n\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n.make-grid-columns();\n\n\n// Extra small grid\n//\n// Columns, offsets, pushes, and pulls for extra small devices like\n// smartphones.\n\n.make-grid(xs);\n\n\n// Small grid\n//\n// Columns, offsets, pushes, and pulls for the small device range, from phones\n// to tablets.\n\n@media (min-width: @screen-sm-min) {\n .make-grid(sm);\n}\n\n\n// Medium grid\n//\n// Columns, offsets, pushes, and pulls for the desktop device range.\n\n@media (min-width: @screen-md-min) {\n .make-grid(md);\n}\n\n\n// Large grid\n//\n// Columns, offsets, pushes, and pulls for the large desktop device range.\n\n@media (min-width: @screen-lg-min) {\n .make-grid(lg);\n}\n","// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n// Centered container element\n.container-fixed(@gutter: @grid-gutter-width) {\n margin-right: auto;\n margin-left: auto;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n &:extend(.clearfix all);\n}\n\n// Creates a wrapper for a series of columns\n.make-row(@gutter: @grid-gutter-width) {\n margin-left: (@gutter / -2);\n margin-right: (@gutter / -2);\n &:extend(.clearfix all);\n}\n\n// Generate the extra small columns\n.make-xs-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n float: left;\n width: percentage((@columns / @grid-columns));\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n}\n.make-xs-column-offset(@columns) {\n margin-left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-push(@columns) {\n left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-pull(@columns) {\n right: percentage((@columns / @grid-columns));\n}\n\n// Generate the small columns\n.make-sm-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-sm-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-offset(@columns) {\n @media (min-width: @screen-sm-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-push(@columns) {\n @media (min-width: @screen-sm-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-pull(@columns) {\n @media (min-width: @screen-sm-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n\n// Generate the medium columns\n.make-md-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-md-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-offset(@columns) {\n @media (min-width: @screen-md-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-push(@columns) {\n @media (min-width: @screen-md-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-pull(@columns) {\n @media (min-width: @screen-md-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n\n// Generate the large columns\n.make-lg-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-lg-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-offset(@columns) {\n @media (min-width: @screen-lg-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-push(@columns) {\n @media (min-width: @screen-lg-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-pull(@columns) {\n @media (min-width: @screen-lg-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `@grid-columns`.\n\n.make-grid-columns() {\n // Common styles for all sizes of grid columns, widths 1-12\n .col(@index) { // initial\n @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n .col((@index + 1), @item);\n }\n .col(@index, @list) when (@index =< @grid-columns) { // general; \"=<\" isn't a typo\n @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n .col((@index + 1), ~\"@{list}, @{item}\");\n }\n .col(@index, @list) when (@index > @grid-columns) { // terminal\n @{list} {\n position: relative;\n // Prevent columns from collapsing when empty\n min-height: 1px;\n // Inner gutter via padding\n padding-left: (@grid-gutter-width / 2);\n padding-right: (@grid-gutter-width / 2);\n }\n }\n .col(1); // kickstart it\n}\n\n.float-grid-columns(@class) {\n .col(@index) { // initial\n @item: ~\".col-@{class}-@{index}\";\n .col((@index + 1), @item);\n }\n .col(@index, @list) when (@index =< @grid-columns) { // general\n @item: ~\".col-@{class}-@{index}\";\n .col((@index + 1), ~\"@{list}, @{item}\");\n }\n .col(@index, @list) when (@index > @grid-columns) { // terminal\n @{list} {\n float: left;\n }\n }\n .col(1); // kickstart it\n}\n\n.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {\n .col-@{class}-@{index} {\n width: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) {\n .col-@{class}-push-@{index} {\n left: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {\n .col-@{class}-push-0 {\n left: auto;\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {\n .col-@{class}-pull-@{index} {\n right: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {\n .col-@{class}-pull-0 {\n right: auto;\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = offset) {\n .col-@{class}-offset-@{index} {\n margin-left: percentage((@index / @grid-columns));\n }\n}\n\n// Basic looping in LESS\n.loop-grid-columns(@index, @class, @type) when (@index >= 0) {\n .calc-grid-column(@index, @class, @type);\n // next iteration\n .loop-grid-columns((@index - 1), @class, @type);\n}\n\n// Create grid for specific class\n.make-grid(@class) {\n .float-grid-columns(@class);\n .loop-grid-columns(@grid-columns, @class, width);\n .loop-grid-columns(@grid-columns, @class, pull);\n .loop-grid-columns(@grid-columns, @class, push);\n .loop-grid-columns(@grid-columns, @class, offset);\n}\n","//\n// Tables\n// --------------------------------------------------\n\n\ntable {\n background-color: @table-bg;\n}\ncaption {\n padding-top: @table-cell-padding;\n padding-bottom: @table-cell-padding;\n color: @text-muted;\n text-align: left;\n}\nth {\n text-align: left;\n}\n\n\n// Baseline styles\n\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: @line-height-computed;\n // Cells\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n padding: @table-cell-padding;\n line-height: @line-height-base;\n vertical-align: top;\n border-top: 1px solid @table-border-color;\n }\n }\n }\n // Bottom align for column headings\n > thead > tr > th {\n vertical-align: bottom;\n border-bottom: 2px solid @table-border-color;\n }\n // Remove top border from thead by default\n > caption + thead,\n > colgroup + thead,\n > thead:first-child {\n > tr:first-child {\n > th,\n > td {\n border-top: 0;\n }\n }\n }\n // Account for multiple tbody instances\n > tbody + tbody {\n border-top: 2px solid @table-border-color;\n }\n\n // Nesting\n .table {\n background-color: @body-bg;\n }\n}\n\n\n// Condensed table w/ half padding\n\n.table-condensed {\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n padding: @table-condensed-cell-padding;\n }\n }\n }\n}\n\n\n// Bordered version\n//\n// Add borders all around the table and between all the columns.\n\n.table-bordered {\n border: 1px solid @table-border-color;\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n border: 1px solid @table-border-color;\n }\n }\n }\n > thead > tr {\n > th,\n > td {\n border-bottom-width: 2px;\n }\n }\n}\n\n\n// Zebra-striping\n//\n// Default zebra-stripe styles (alternating gray and transparent backgrounds)\n\n.table-striped {\n > tbody > tr:nth-of-type(odd) {\n background-color: @table-bg-accent;\n }\n}\n\n\n// Hover effect\n//\n// Placed here since it has to come after the potential zebra striping\n\n.table-hover {\n > tbody > tr:hover {\n background-color: @table-bg-hover;\n }\n}\n\n\n// Table cell sizing\n//\n// Reset default table behavior\n\ntable col[class*=\"col-\"] {\n position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n float: none;\n display: table-column;\n}\ntable {\n td,\n th {\n &[class*=\"col-\"] {\n position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n float: none;\n display: table-cell;\n }\n }\n}\n\n\n// Table backgrounds\n//\n// Exact selectors below required to override `.table-striped` and prevent\n// inheritance to nested tables.\n\n// Generate the contextual variants\n.table-row-variant(active; @table-bg-active);\n.table-row-variant(success; @state-success-bg);\n.table-row-variant(info; @state-info-bg);\n.table-row-variant(warning; @state-warning-bg);\n.table-row-variant(danger; @state-danger-bg);\n\n\n// Responsive tables\n//\n// Wrap your tables in `.table-responsive` and we'll make them mobile friendly\n// by enabling horizontal scrolling. Only applies <768px. Everything above that\n// will display normally.\n\n.table-responsive {\n overflow-x: auto;\n min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)\n\n @media screen and (max-width: @screen-xs-max) {\n width: 100%;\n margin-bottom: (@line-height-computed * 0.75);\n overflow-y: hidden;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n border: 1px solid @table-border-color;\n\n // Tighten up spacing\n > .table {\n margin-bottom: 0;\n\n // Ensure the content doesn't wrap\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n white-space: nowrap;\n }\n }\n }\n }\n\n // Special overrides for the bordered tables\n > .table-bordered {\n border: 0;\n\n // Nuke the appropriate borders so that the parent can handle them\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th:first-child,\n > td:first-child {\n border-left: 0;\n }\n > th:last-child,\n > td:last-child {\n border-right: 0;\n }\n }\n }\n\n // Only nuke the last row's bottom-border in `tbody` and `tfoot` since\n // chances are there will be only one `tr` in a `thead` and that would\n // remove the border altogether.\n > tbody,\n > tfoot {\n > tr:last-child {\n > th,\n > td {\n border-bottom: 0;\n }\n }\n }\n\n }\n }\n}\n","// Tables\n\n.table-row-variant(@state; @background) {\n // Exact selectors below required to override `.table-striped` and prevent\n // inheritance to nested tables.\n .table > thead > tr,\n .table > tbody > tr,\n .table > tfoot > tr {\n > td.@{state},\n > th.@{state},\n &.@{state} > td,\n &.@{state} > th {\n background-color: @background;\n }\n }\n\n // Hover states for `.table-hover`\n // Note: this is not available for cells or rows within `thead` or `tfoot`.\n .table-hover > tbody > tr {\n > td.@{state}:hover,\n > th.@{state}:hover,\n &.@{state}:hover > td,\n &:hover > .@{state},\n &.@{state}:hover > th {\n background-color: darken(@background, 5%);\n }\n }\n}\n","//\n// Forms\n// --------------------------------------------------\n\n\n// Normalize non-controls\n//\n// Restyle and baseline non-control form elements.\n\nfieldset {\n padding: 0;\n margin: 0;\n border: 0;\n // Chrome and Firefox set a `min-width: min-content;` on fieldsets,\n // so we reset that to ensure it behaves more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359.\n min-width: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n padding: 0;\n margin-bottom: @line-height-computed;\n font-size: (@font-size-base * 1.5);\n line-height: inherit;\n color: @legend-color;\n border: 0;\n border-bottom: 1px solid @legend-border-color;\n}\n\nlabel {\n display: inline-block;\n max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n// Normalize form controls\n//\n// While most of our form styles require extra classes, some basic normalization\n// is required to ensure optimum display with or without those classes to better\n// address browser inconsistencies.\n\n// Override content-box in Normalize (* isn't specific enough)\ninput[type=\"search\"] {\n .box-sizing(border-box);\n}\n\n// Position radios and checkboxes better\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n margin: 4px 0 0;\n margin-top: 1px \\9; // IE8-9\n line-height: normal;\n}\n\n// Set the height of file controls to match text inputs\ninput[type=\"file\"] {\n display: block;\n}\n\n// Make range inputs behave like textual form controls\ninput[type=\"range\"] {\n display: block;\n width: 100%;\n}\n\n// Make multiple select elements height not fixed\nselect[multiple],\nselect[size] {\n height: auto;\n}\n\n// Focus for file, radio, and checkbox\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n .tab-focus();\n}\n\n// Adjust output element\noutput {\n display: block;\n padding-top: (@padding-base-vertical + 1);\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @input-color;\n}\n\n\n// Common form controls\n//\n// Shared size and type resets for form controls. Apply `.form-control` to any\n// of the following form controls:\n//\n// select\n// textarea\n// input[type=\"text\"]\n// input[type=\"password\"]\n// input[type=\"datetime\"]\n// input[type=\"datetime-local\"]\n// input[type=\"date\"]\n// input[type=\"month\"]\n// input[type=\"time\"]\n// input[type=\"week\"]\n// input[type=\"number\"]\n// input[type=\"email\"]\n// input[type=\"url\"]\n// input[type=\"search\"]\n// input[type=\"tel\"]\n// input[type=\"color\"]\n\n.form-control {\n display: block;\n width: 100%;\n height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)\n padding: @padding-base-vertical @padding-base-horizontal;\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @input-color;\n background-color: @input-bg;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid @input-border;\n border-radius: @input-border-radius; // Note: This has no effect on s in CSS.\n .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));\n .transition(~\"border-color ease-in-out .15s, box-shadow ease-in-out .15s\");\n\n // Customize the `:focus` state to imitate native WebKit styles.\n .form-control-focus();\n\n // Placeholder\n .placeholder();\n\n // Disabled and read-only inputs\n //\n // HTML5 says that controls under a fieldset > legend:first-child won't be\n // disabled if the fieldset is disabled. Due to implementation difficulty, we\n // don't honor that edge case; we style them as disabled anyway.\n &[disabled],\n &[readonly],\n fieldset[disabled] & {\n background-color: @input-bg-disabled;\n opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655\n }\n\n &[disabled],\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n }\n\n // Reset height for `textarea`s\n textarea& {\n height: auto;\n }\n}\n\n\n// Search inputs in iOS\n//\n// This overrides the extra rounded corners on search inputs in iOS so that our\n// `.form-control` class can properly style them. Note that this cannot simply\n// be added to `.form-control` as it's not specific enough. For details, see\n// https://github.com/twbs/bootstrap/issues/11586.\n\ninput[type=\"search\"] {\n -webkit-appearance: none;\n}\n\n\n// Special styles for iOS temporal inputs\n//\n// In Mobile Safari, setting `display: block` on temporal inputs causes the\n// text within the input to become vertically misaligned. As a workaround, we\n// set a pixel line-height that matches the given height of the input, but only\n// for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n input[type=\"date\"],\n input[type=\"time\"],\n input[type=\"datetime-local\"],\n input[type=\"month\"] {\n line-height: @input-height-base;\n\n &.input-sm,\n .input-group-sm & {\n line-height: @input-height-small;\n }\n\n &.input-lg,\n .input-group-lg & {\n line-height: @input-height-large;\n }\n }\n}\n\n\n// Form groups\n//\n// Designed to help with the organization and spacing of vertical forms. For\n// horizontal forms, use the predefined grid classes.\n\n.form-group {\n margin-bottom: @form-group-margin-bottom;\n}\n\n\n// Checkboxes and radios\n//\n// Indent the labels to position radios/checkboxes as hanging controls.\n\n.radio,\n.checkbox {\n position: relative;\n display: block;\n margin-top: 10px;\n margin-bottom: 10px;\n\n label {\n min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text\n padding-left: 20px;\n margin-bottom: 0;\n font-weight: normal;\n cursor: pointer;\n }\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n position: absolute;\n margin-left: -20px;\n margin-top: 4px \\9;\n}\n\n.radio + .radio,\n.checkbox + .checkbox {\n margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing\n}\n\n// Radios and checkboxes on same line\n.radio-inline,\n.checkbox-inline {\n position: relative;\n display: inline-block;\n padding-left: 20px;\n margin-bottom: 0;\n vertical-align: middle;\n font-weight: normal;\n cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n margin-top: 0;\n margin-left: 10px; // space out consecutive inline controls\n}\n\n// Apply same disabled cursor tweak as for inputs\n// Some special care is needed because
      '+DPGlobal.dates.daysMin[(dowCnt++)%7]+'
      '+prevMonth.getDate() + '
      '+ + DPGlobal.headTemplate+ + ''+ + '
      '+ + ''+ + '
      '+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + '
      '+ + '
      '+ + '
      '+ + ''+ + DPGlobal.headTemplate+ + DPGlobal.contTemplate+ + '
      '+ + '
      '+ + ''; + +}( window.jQuery ); \ No newline at end of file diff --git a/catalog/ext/datepicker/less/datepicker.less b/catalog/ext/datepicker/less/datepicker.less new file mode 100644 index 000000000..c3f34beac --- /dev/null +++ b/catalog/ext/datepicker/less/datepicker.less @@ -0,0 +1,122 @@ +/*! + * Datepicker for Bootstrap + * + * Copyright 2012 Stefan Petre + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ + +.datepicker { + top: 0; + left: 0; + padding: 4px; + margin-top: 1px; + .border-radius(4px); + &:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0,0,0,.2); + position: absolute; + top: -7px; + left: 6px; + } + &:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid @white; + position: absolute; + top: -6px; + left: 7px; + } + >div { + display: none; + } + table{ + width: 100%; + margin: 0; + } + td, + th{ + text-align: center; + width: 20px; + height: 20px; + .border-radius(4px); + } + td { + &.day:hover { + background: @grayLighter; + cursor: pointer; + } + &.day.disabled { + color: @grayLighter; + } + &.old, + &.new { + color: @grayLight; + } + &.active, + &.active:hover { + .buttonBackground(@btnPrimaryBackground, spin(@btnPrimaryBackground, 20)); + color: #fff; + text-shadow: 0 -1px 0 rgba(0,0,0,.25); + } + span { + display: block; + width: 47px; + height: 54px; + line-height: 54px; + float: left; + margin: 2px; + cursor: pointer; + .border-radius(4px); + &:hover { + background: @grayLighter; + } + &.active { + .buttonBackground(@btnPrimaryBackground, spin(@btnPrimaryBackground, 20)); + color: #fff; + text-shadow: 0 -1px 0 rgba(0,0,0,.25); + } + &.old { + color: @grayLight; + } + } + } + + th { + &.switch { + width: 145px; + } + &.next, + &.prev { + font-size: @baseFontSize * 1.5; + } + } + + thead tr:first-child th { + cursor: pointer; + &:hover{ + background: @grayLighter; + } + } + /*.dow { + border-top: 1px solid #ddd !important; + }*/ +} +.input-append, +.input-prepend { + &.date { + .add-on i { + display: block; + cursor: pointer; + width: 16px; + height: 16px; + } + } +} \ No newline at end of file diff --git a/catalog/ext/js/cookie.js b/catalog/ext/js/cookie.js new file mode 100644 index 000000000..8218817b9 --- /dev/null +++ b/catalog/ext/js/cookie.js @@ -0,0 +1,114 @@ +/*! + * jQuery Cookie Plugin v1.4.1 + * https://github.com/carhartl/jquery-cookie + * + * Copyright 2006, 2014 Klaus Hartl + * Released under the MIT license + */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD (Register as an anonymous module) + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + + var pluses = /\+/g; + + function encode(s) { + return config.raw ? s : encodeURIComponent(s); + } + + function decode(s) { + return config.raw ? s : decodeURIComponent(s); + } + + function stringifyCookieValue(value) { + return encode(config.json ? JSON.stringify(value) : String(value)); + } + + function parseCookieValue(s) { + if (s.indexOf('"') === 0) { + // This is a quoted cookie as according to RFC2068, unescape... + s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + + try { + // Replace server-side written pluses with spaces. + // If we can't decode the cookie, ignore it, it's unusable. + // If we can't parse the cookie, ignore it, it's unusable. + s = decodeURIComponent(s.replace(pluses, ' ')); + return config.json ? JSON.parse(s) : s; + } catch(e) {} + } + + function read(s, converter) { + var value = config.raw ? s : parseCookieValue(s); + return $.isFunction(converter) ? converter(value) : value; + } + + var config = $.cookie = function (key, value, options) { + + // Write + + if (arguments.length > 1 && !$.isFunction(value)) { + options = $.extend({}, config.defaults, options); + + if (typeof options.expires === 'number') { + var days = options.expires, t = options.expires = new Date(); + t.setMilliseconds(t.getMilliseconds() + days * 864e+5); + } + + return (document.cookie = [ + encode(key), '=', stringifyCookieValue(value), + options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE + options.path ? '; path=' + options.path : '', + options.domain ? '; domain=' + options.domain : '', + options.secure ? '; secure' : '' + ].join('')); + } + + // Read + + var result = key ? undefined : {}, + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. Also prevents odd result when + // calling $.cookie(). + cookies = document.cookie ? document.cookie.split('; ') : [], + i = 0, + l = cookies.length; + + for (; i < l; i++) { + var parts = cookies[i].split('='), + name = decode(parts.shift()), + cookie = parts.join('='); + + if (key === name) { + // If second argument (value) is a function it's a converter... + result = read(cookie, value); + break; + } + + // Prevent storing a cookie that we couldn't decode. + if (!key && (cookie = read(cookie)) !== undefined) { + result[name] = cookie; + } + } + + return result; + }; + + config.defaults = {}; + + $.removeCookie = function (key, options) { + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); + return !$.cookie(key); + }; + +})); diff --git a/catalog/ext/js/excanvas.min.js b/catalog/ext/js/excanvas.min.js new file mode 100644 index 000000000..fcf876c74 --- /dev/null +++ b/catalog/ext/js/excanvas.min.js @@ -0,0 +1 @@ +if(!document.createElement("canvas").getContext){(function(){var ab=Math;var n=ab.round;var l=ab.sin;var A=ab.cos;var H=ab.abs;var N=ab.sqrt;var d=10;var f=d/2;var z=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];function y(){return this.context_||(this.context_=new D(this))}var t=Array.prototype.slice;function g(j,m,p){var i=t.call(arguments,2);return function(){return j.apply(m,i.concat(t.call(arguments)))}}function af(i){return String(i).replace(/&/g,"&").replace(/"/g,""")}function Y(m,j,i){if(!m.namespaces[j]){m.namespaces.add(j,i,"#default#VML")}}function R(j){Y(j,"g_vml_","urn:schemas-microsoft-com:vml");Y(j,"g_o_","urn:schemas-microsoft-com:office:office");if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}var C={};function F(j){if(j in C){return C[j]}var ag,Z=1;j=String(j);if(j.charAt(0)=="#"){ag=j}else{if(/^rgb/.test(j)){var p=M(j);var ag="#",ah;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){ah=Math.floor(c(p[m])*255)}else{ah=+p[m]}ag+=k[r(ah,0,255)]}Z=+p[3]}else{if(/^hsl/.test(j)){var p=M(j);ag=I(p);Z=p[3]}else{ag=b[j]||j}}}return C[j]={color:ag,alpha:Z}}var o={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||o.style,variant:m.fontVariant||o.variant,weight:m.fontWeight||o.weight,size:m.fontSize||o.size,family:m.fontFamily||o.family}}function u(m,j){var i={};for(var ah in m){i[ah]=m[ah]}var ag=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ag*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ag/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=Z/0.75}else{i.size=ag}}}}}i.size*=0.981;return i}function ac(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}var s={butt:"flat",round:"round"};function S(i){return s[i]||"square"}function D(i){this.m_=B();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var m="width:"+i.clientWidth+"px;height:"+i.clientHeight+"px;overflow:hidden;position:absolute";var j=i.ownerDocument.createElement("div");j.style.cssText=m;i.appendChild(j);var p=j.cloneNode(false);p.style.backgroundColor="red";p.style.filter="alpha(opacity=0)";i.appendChild(p);this.element_=j;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var q=D.prototype;q.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};q.beginPath=function(){this.currentPath_=[]};q.moveTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.lineTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.bezierCurveTo=function(m,j,ak,aj,ai,ag){var i=V(this,ai,ag);var ah=V(this,m,j);var Z=V(this,ak,aj);K(this,ah,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}q.quadraticCurveTo=function(ai,m,j,i){var ah=V(this,ai,m);var ag=V(this,j,i);var aj={x:this.currentX_+2/3*(ah.x-this.currentX_),y:this.currentY_+2/3*(ah.y-this.currentY_)};var Z={x:aj.x+(ag.x-this.currentX_)/3,y:aj.y+(ag.y-this.currentY_)/3};K(this,aj,Z,ag)};q.arc=function(al,aj,ak,ag,j,m){ak*=d;var ap=m?"at":"wa";var am=al+A(ag)*ak-f;var ao=aj+l(ag)*ak-f;var i=al+A(j)*ak-f;var an=aj+l(j)*ak-f;if(am==i&&!m){am+=0.125}var Z=V(this,al,aj);var ai=V(this,am,ao);var ah=V(this,i,an);this.currentPath_.push({type:ap,x:Z.x,y:Z.y,radius:ak,xStart:ai.x,yStart:ai.y,xEnd:ah.x,yEnd:ah.y})};q.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};q.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};q.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};q.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};q.createRadialGradient=function(p,ag,m,j,Z,i){var ah=new U("gradientradial");ah.x0_=p;ah.y0_=ag;ah.r0_=m;ah.x1_=j;ah.y1_=Z;ah.r1_=i;return ah};q.drawImage=function(aq,m){var aj,ah,al,ay,ao,am,at,aA;var ak=aq.runtimeStyle.width;var ap=aq.runtimeStyle.height;aq.runtimeStyle.width="auto";aq.runtimeStyle.height="auto";var ai=aq.width;var aw=aq.height;aq.runtimeStyle.width=ak;aq.runtimeStyle.height=ap;if(arguments.length==3){aj=arguments[1];ah=arguments[2];ao=am=0;at=al=ai;aA=ay=aw}else{if(arguments.length==5){aj=arguments[1];ah=arguments[2];al=arguments[3];ay=arguments[4];ao=am=0;at=ai;aA=aw}else{if(arguments.length==9){ao=arguments[1];am=arguments[2];at=arguments[3];aA=arguments[4];aj=arguments[5];ah=arguments[6];al=arguments[7];ay=arguments[8]}else{throw Error("Invalid number of arguments")}}}var az=V(this,aj,ah);var p=at/2;var j=aA/2;var ax=[];var i=10;var ag=10;ax.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",ax.join(""))};q.stroke=function(ao){var Z=10;var ap=10;var ag=5000;var ai={x:null,y:null};var an={x:null,y:null};for(var aj=0;ajan.x){an.x=m.x}if(ai.y==null||m.yan.y){an.y=m.y}}}am.push(' ">');if(!ao){w(this,am)}else{G(this,am,ai,an)}am.push("");this.element_.insertAdjacentHTML("beforeEnd",am.join(""))}};function w(m,ag){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ag.push("')}function G(aq,ai,aK,ar){var aj=aq.fillStyle;var aB=aq.arcScaleX_;var aA=aq.arcScaleY_;var j=ar.x-aK.x;var p=ar.y-aK.y;if(aj instanceof U){var an=0;var aF={x:0,y:0};var ax=0;var am=1;if(aj.type_=="gradient"){var al=aj.x0_/aB;var m=aj.y0_/aA;var ak=aj.x1_/aB;var aM=aj.y1_/aA;var aJ=V(aq,al,m);var aI=V(aq,ak,aM);var ag=aI.x-aJ.x;var Z=aI.y-aJ.y;an=Math.atan2(ag,Z)*180/Math.PI;if(an<0){an+=360}if(an<0.000001){an=0}}else{var aJ=V(aq,aj.x0_,aj.y0_);aF={x:(aJ.x-aK.x)/j,y:(aJ.y-aK.y)/p};j/=aB*d;p/=aA*d;var aD=ab.max(j,p);ax=2*aj.r0_/aD;am=2*aj.r1_/aD-ax}var av=aj.colors_;av.sort(function(aN,i){return aN.offset-i.offset});var ap=av.length;var au=av[0].color;var at=av[ap-1].color;var az=av[0].alpha*aq.globalAlpha;var ay=av[ap-1].alpha*aq.globalAlpha;var aE=[];for(var aH=0;aH')}else{if(aj instanceof T){if(j&&p){var ah=-aK.x;var aC=-aK.y;ai.push("')}}else{var aL=F(aq.fillStyle);var aw=aL.color;var aG=aL.alpha*aq.globalAlpha;ai.push('')}}}q.fill=function(){this.stroke(true)};q.closePath=function(){this.currentPath_.push({type:"close"})};function V(j,Z,p){var i=j.m_;return{x:d*(Z*i[0][0]+p*i[1][0]+i[2][0])-f,y:d*(Z*i[0][1]+p*i[1][1]+i[2][1])-f}}q.save=function(){var i={};v(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(B(),this.m_)};q.restore=function(){if(this.aStack_.length){v(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function h(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function aa(j,i,p){if(!h(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}q.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];aa(this,J(i,this.m_),false)};q.rotate=function(j){var p=A(j);var m=l(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];aa(this,J(i,this.m_),false)};q.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];aa(this,J(i,this.m_),true)};q.transform=function(Z,p,ah,ag,j,i){var m=[[Z,p,0],[ah,ag,0],[j,i,1]];aa(this,J(m,this.m_),true)};q.setTransform=function(ag,Z,ai,ah,p,j){var i=[[ag,Z,0],[ai,ah,0],[p,j,1]];aa(this,i,true)};q.drawText_=function(am,ak,aj,ap,ai){var ao=this.m_,at=1000,j=0,ar=at,ah={x:0,y:0},ag=[];var i=u(E(this.font),this.element_);var p=ac(i);var au=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=au.direction=="ltr"?"right":"left";break;case"start":Z=au.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":ah.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":ah.y=-i.size/2.25;break}switch(Z){case"right":j=at;ar=0.05;break;case"center":j=ar=at/2;break}var aq=V(this,ak+ah.x,aj+ah.y);ag.push('');if(ai){w(this,ag)}else{G(this,ag,{x:-j,y:0},{x:ar,y:i.size})}var an=ao[0][0].toFixed(3)+","+ao[1][0].toFixed(3)+","+ao[0][1].toFixed(3)+","+ao[1][1].toFixed(3)+",0,0";var al=n(aq.x/d)+","+n(aq.y/d);ag.push('','','');this.element_.insertAdjacentHTML("beforeEnd",ag.join(""))};q.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};q.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};q.measureText=function(m){if(!this.textMeasureEl_){var i='';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};q.clip=function(){};q.arcTo=function(){};q.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var X=P.prototype=new Error;X.INDEX_SIZE_ERR=1;X.DOMSTRING_SIZE_ERR=2;X.HIERARCHY_REQUEST_ERR=3;X.WRONG_DOCUMENT_ERR=4;X.INVALID_CHARACTER_ERR=5;X.NO_DATA_ALLOWED_ERR=6;X.NO_MODIFICATION_ALLOWED_ERR=7;X.NOT_FOUND_ERR=8;X.NOT_SUPPORTED_ERR=9;X.INUSE_ATTRIBUTE_ERR=10;X.INVALID_STATE_ERR=11;X.SYNTAX_ERR=12;X.INVALID_MODIFICATION_ERR=13;X.NAMESPACE_ERR=14;X.INVALID_ACCESS_ERR=15;X.VALIDATION_ERR=16;X.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P})()}; \ No newline at end of file diff --git a/catalog/ext/js/html5shiv.js b/catalog/ext/js/html5shiv.js new file mode 100644 index 000000000..448cebd79 --- /dev/null +++ b/catalog/ext/js/html5shiv.js @@ -0,0 +1,8 @@ +/* + HTML5 Shiv v3.7.0 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +(function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); +a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; +c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| +"undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f); +if(g)return a.createDocumentFragment();for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d #mq-test-1 { width: 42px; }',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); + +/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ +(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this); diff --git a/catalog/ext/modules/content/account/braintree/cards.php b/catalog/ext/modules/content/account/braintree/cards.php index 077fbd88a..5ea9dc346 100644 --- a/catalog/ext/modules/content/account/braintree/cards.php +++ b/catalog/ext/modules/content/account/braintree/cards.php @@ -5,62 +5,63 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + chdir('../../../../../'); require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('braintree_cc.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { if ( !class_exists('braintree_cc') ) { - include(DIR_WS_LANGUAGES . $language . '/modules/payment/braintree_cc.php'); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/braintree_cc.php'); include(DIR_WS_MODULES . 'payment/braintree_cc.php'); } $braintree_cc = new braintree_cc(); if ( !$braintree_cc->enabled ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } } else { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/modules/content/account/cm_account_braintree_cards.php'); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/account/cm_account_braintree_cards.php'); require('includes/modules/content/account/cm_account_braintree_cards.php'); $braintree_cards = new cm_account_braintree_cards(); if ( !$braintree_cards->isEnabled() ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - if ( isset($HTTP_GET_VARS['action']) ) { - if ( ($HTTP_GET_VARS['action'] == 'delete') && isset($HTTP_GET_VARS['id']) && is_numeric($HTTP_GET_VARS['id']) && isset($HTTP_GET_VARS['formid']) && ($HTTP_GET_VARS['formid'] == md5($sessiontoken))) { - $token_query = tep_db_query("select id, braintree_token from customers_braintree_tokens where id = '" . (int)$HTTP_GET_VARS['id'] . "' and customers_id = '" . (int)$customer_id . "'"); - - if ( tep_db_num_rows($token_query) ) { - $token = tep_db_fetch_array($token_query); + if ( isset($_GET['action']) ) { + if ( ($_GET['action'] == 'delete') && isset($_GET['id']) && is_numeric($_GET['id']) && isset($_GET['formid']) && ($_GET['formid'] == md5($_SESSION['sessiontoken']))) { + $Qtoken = $OSCOM_Db->get('customers_braintree_tokens', ['id', 'braintree_token'], ['id' => $_GET['id'], 'customers_id' => $_SESSION['customer_id']]); - $braintree_cc->deleteCard($token['braintree_token'], $token['id']); + if ($Qtoken->fetch() !== false) { + $braintree_cc->deleteCard($Qtoken->value('braintree_token'), $Qtoken->valueInt('id')); $messageStack->add_session('cards', MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_SUCCESS_DELETED, 'success'); } } - tep_redirect(tep_href_link('ext/modules/content/account/braintree/cards.php', '', 'SSL')); + OSCOM::redirect('ext/modules/content/account/braintree/cards.php', '', 'SSL'); } - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_NAVBAR_TITLE_2, tep_href_link('ext/modules/content/account/braintree/cards.php', '', 'SSL')); + $breadcrumb->add(MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_NAVBAR_TITLE_2, OSCOM::link('ext/modules/content/account/braintree/cards.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?>

      @@ -79,19 +80,19 @@
      get('customers_braintree_tokens', ['id', 'card_type', 'number_filtered', 'expiry_date'], ['customers_id' => $_SESSION['customer_id']], 'date_added'); - if ( tep_db_num_rows($tokens_query) > 0 ) { - while ( $tokens = tep_db_fetch_array($tokens_query) ) { + if ($Qtokens->fetch() !== false) { + do { ?>
      - -

        ****

      + valueInt('id') . '&formid=' . md5($_SESSION['sessiontoken']), 'SSL')); ?> +

      valueProtected('card_type'); ?>  ****valueProtected('number_filtered') . '  ' . tep_output_string_protected(substr($Qtokens->value('expiry_date'), 0, 2) . '/' . substr($Qtokens->value('expiry_date'), 2)); ?>

      fetch()); } else { ?> @@ -106,11 +107,11 @@
      - +
      diff --git a/catalog/ext/modules/content/account/sage_pay/cards.php b/catalog/ext/modules/content/account/sage_pay/cards.php index 2bd733ff4..a4e848440 100644 --- a/catalog/ext/modules/content/account/sage_pay/cards.php +++ b/catalog/ext/modules/content/account/sage_pay/cards.php @@ -5,62 +5,63 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + chdir('../../../../../'); require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('sage_pay_direct.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { if ( !class_exists('sage_pay_direct') ) { - include(DIR_WS_LANGUAGES . $language . '/modules/payment/sage_pay_direct.php'); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/sage_pay_direct.php'); include(DIR_WS_MODULES . 'payment/sage_pay_direct.php'); } $sage_pay_direct = new sage_pay_direct(); if ( !$sage_pay_direct->enabled ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } } else { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/modules/content/account/cm_account_sage_pay_cards.php'); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/account/cm_account_sage_pay_cards.php'); require('includes/modules/content/account/cm_account_sage_pay_cards.php'); $sage_pay_cards = new cm_account_sage_pay_cards(); if ( !$sage_pay_cards->isEnabled() ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - if ( isset($HTTP_GET_VARS['action']) ) { - if ( ($HTTP_GET_VARS['action'] == 'delete') && isset($HTTP_GET_VARS['id']) && is_numeric($HTTP_GET_VARS['id']) && isset($HTTP_GET_VARS['formid']) && ($HTTP_GET_VARS['formid'] == md5($sessiontoken))) { - $token_query = tep_db_query("select id, sagepay_token from customers_sagepay_tokens where id = '" . (int)$HTTP_GET_VARS['id'] . "' and customers_id = '" . (int)$customer_id . "'"); - - if ( tep_db_num_rows($token_query) ) { - $token = tep_db_fetch_array($token_query); + if ( isset($_GET['action']) ) { + if ( ($_GET['action'] == 'delete') && isset($_GET['id']) && is_numeric($_GET['id']) && isset($_GET['formid']) && ($_GET['formid'] == md5($_SESSION['sessiontoken']))) { + $Qtoken = $OSCOM_Db->get('customers_sagepay_tokens', ['id', 'sagepay_token'], ['id' => $_GET['id'], 'customers_id' => $_SESSION['customer_id']]); - $sage_pay_direct->deleteCard($token['sagepay_token'], $token['id']); + if ($Qtoken->fetch() !== false) { + $sage_pay_direct->deleteCard($Qtoken->value('sagepay_token'), $Qtoken->valueInt('id')); $messageStack->add_session('cards', MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_SUCCESS_DELETED, 'success'); } } - tep_redirect(tep_href_link('ext/modules/content/account/sage_pay/cards.php', '', 'SSL')); + OSCOM::redirect('ext/modules/content/account/sage_pay/cards.php', '', 'SSL'); } - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_NAVBAR_TITLE_2, tep_href_link('ext/modules/content/account/sage_pay/cards.php', '', 'SSL')); + $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_NAVBAR_TITLE_2, OSCOM::link('ext/modules/content/account/sage_pay/cards.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); ?>

      @@ -79,19 +80,19 @@
      get('customers_sagepay_tokens', ['id', 'card_type', 'number_filtered', 'expiry_date'], ['customers_id' => $_SESSION['customer_id']], 'date_added'); - if ( tep_db_num_rows($tokens_query) > 0 ) { - while ( $tokens = tep_db_fetch_array($tokens_query) ) { + if ($Qtokens->fetch() !== false) { + do { ?>
      - -

        ****

      + valueInt('id') . '&formid=' . md5($_SESSION['sessiontoken']), 'SSL')); ?> +

      valueProtected('card_type'); ?>  ****valueProtected('number_filtered') . '  ' . tep_output_string_protected(substr($Qtokens->value('expiry_date'), 0, 2) . '/' . substr($Qtokens->value('expiry_date'), 2)); ?>

      fetch()); } else { ?> @@ -106,11 +107,11 @@
      - +
      diff --git a/catalog/ext/modules/content/account/set_password.php b/catalog/ext/modules/content/account/set_password.php index 16e877ffe..05e927232 100644 --- a/catalog/ext/modules/content/account/set_password.php +++ b/catalog/ext/modules/content/account/set_password.php @@ -5,35 +5,37 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + chdir('../../../../'); require('includes/application_top.php'); - if (!tep_session_is_registered('customer_id')) { - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + OSCOM::redirect('login.php', '', 'SSL'); } if ( MODULE_CONTENT_ACCOUNT_SET_PASSWORD_ALLOW_PASSWORD != 'True' ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } - $check_customer_query = tep_db_query("select customers_password from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); - $check_customer = tep_db_fetch_array($check_customer_query); + $Qcustomer = $OSCOM_Db-get('customers', 'customers_password', ['customers_id' => $_SESSION['customer_id']]); - if ( !empty($check_customer['customers_password']) ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + if (!empty($Qcustomer->value('customers_password'))) { + OSCOM::redirect('account.php', '', 'SSL'); } // needs to be included earlier to set the success message in the messageStack - require(DIR_WS_LANGUAGES . $language . '/modules/content/account/cm_account_set_password.php'); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/account/cm_account_set_password.php'); - if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { - $password_new = tep_db_prepare_input($HTTP_POST_VARS['password_new']); - $password_confirmation = tep_db_prepare_input($HTTP_POST_VARS['password_confirmation']); + if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { + $password_new = HTML::sanitize($_POST['password_new']); + $password_confirmation = HTML::sanitize($_POST['password_confirmation']); $error = false; @@ -48,24 +50,24 @@ } if ($error == false) { - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password_new) . "' where customers_id = '" . (int)$customer_id . "'"); - - tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int)$customer_id . "'"); + $OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password_new)], ['customers_id' => $_SESSION['customer_id']]); + $OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()'], ['customers_info_id' => $_SESSION['customer_id']]); $messageStack->add_session('account', MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SUCCESS_PASSWORD_SET, 'success'); - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + OSCOM::redirect('account.php', '', 'SSL'); } } - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SET_PASSWORD_NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SET_PASSWORD_NAVBAR_TITLE_2, tep_href_link('ext/modules/content/account/set_password.php', '', 'SSL')); + $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SET_PASSWORD_NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); + $breadcrumb->add(MODULE_CONTENT_ACCOUNT_SET_PASSWORD_NAVBAR_TITLE_2, OSCOM::link('ext/modules/content/account/set_password.php', '', 'SSL')); - require(DIR_WS_INCLUDES . 'template_top.php'); - require('includes/form_check.js.php'); + require('includes/template_top.php'); ?> -

      + size('account_password') > 0) { @@ -73,37 +75,43 @@ } ?> - + true, 'action' => 'process']); ?>
      -
      - -

      -
      +

      - - - - - - - - - -
      ' . ENTRY_PASSWORD_NEW_TEXT . '': ''); ?>
      ' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '': ''); ?>
      -
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      -
      - +
      - +
      +
      +
      +
      diff --git a/catalog/ext/modules/content/account/stripe/cards.php b/catalog/ext/modules/content/account/stripe/cards.php deleted file mode 100644 index 891294cbb..000000000 --- a/catalog/ext/modules/content/account/stripe/cards.php +++ /dev/null @@ -1,118 +0,0 @@ -set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); - } - - if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('stripe.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { - if ( !class_exists('stripe') ) { - include(DIR_WS_LANGUAGES . $language . '/modules/payment/stripe.php'); - include(DIR_WS_MODULES . 'payment/stripe.php'); - } - - $stripe = new stripe(); - - if ( !$stripe->enabled ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - } - } else { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - } - - require(DIR_WS_LANGUAGES . $language . '/modules/content/account/cm_account_stripe_cards.php'); - require('includes/modules/content/account/cm_account_stripe_cards.php'); - $stripe_cards = new cm_account_stripe_cards(); - - if ( !$stripe_cards->isEnabled() ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - } - - if ( isset($HTTP_GET_VARS['action']) ) { - if ( ($HTTP_GET_VARS['action'] == 'delete') && isset($HTTP_GET_VARS['id']) && is_numeric($HTTP_GET_VARS['id']) && isset($HTTP_GET_VARS['formid']) && ($HTTP_GET_VARS['formid'] == md5($sessiontoken))) { - $token_query = tep_db_query("select id, stripe_token from customers_stripe_tokens where id = '" . (int)$HTTP_GET_VARS['id'] . "' and customers_id = '" . (int)$customer_id . "'"); - - if ( tep_db_num_rows($token_query) ) { - $token = tep_db_fetch_array($token_query); - - list($customer, $card) = explode(':|:', $token['stripe_token'], 2); - - $stripe->deleteCard($card, $customer, $token['id']); - - $messageStack->add_session('cards', MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_SUCCESS_DELETED, 'success'); - } - } - - tep_redirect(tep_href_link('ext/modules/content/account/stripe/cards.php', '', 'SSL')); - } - - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); - $breadcrumb->add(MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_NAVBAR_TITLE_2, tep_href_link('ext/modules/content/account/stripe/cards.php', '', 'SSL')); - - require(DIR_WS_INCLUDES . 'template_top.php'); -?> - -

      - -size('cards') > 0) { - echo $messageStack->output('cards'); - } -?> - -
      - - -

      - -
      - - 0 ) { - while ( $tokens = tep_db_fetch_array($tokens_query) ) { -?> - -
      - -

        ****

      -
      - - - -
      - -
      - - - -
      - -
      - -
      -
      - - diff --git a/catalog/ext/modules/payment/authorizenet/authorize.net.crt b/catalog/ext/modules/payment/authorizenet/authorize.net.crt deleted file mode 100644 index b59fbb082..000000000 --- a/catalog/ext/modules/payment/authorizenet/authorize.net.crt +++ /dev/null @@ -1,253 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEYTCCA0mgAwIBAgIESyDOMjANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 -Lm5ldC9ycGEgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW -KGMpIDIwMDkgRW50cnVzdCwgSW5jLjEuMCwGA1UEAxMlRW50cnVzdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSAtIEwxQzAeFw0xMDAzMzExNzA0MDBaFw0xMjAzMzAx -NzMzNTdaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQG -A1UEBxMNTW91bnRhaW4gVmlldzEgMB4GA1UEChMXQ3liZXJzb3VyY2UgQ29ycG9y -YXRpb24xHTAbBgNVBAsTFFBsYXRpbnVtU1NMIFdpbGRjYXJkMRgwFgYDVQQDFA8q -LmF1dGhvcml6ZS5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOSIsv0X -OFMm2cV74o2jSF7zkNGeLHkPsI10xsFXTG1xqjzq4eImAReA3eIp1oHvLmji4kea -rmTbxoURYdsRsWkx61b2vDrKJwjGU+hPvTYna0M4I9fpDgmp7e/Q5TJBWqI7BX9N -2ccL95/2rV0g021JJhkqYMDFERTYRqkLFLfNAgMBAAGjggEdMIIBGTALBgNVHQ8E -BAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwMwYDVR0fBCwwKjAooCagJIYiaHR0 -cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFjLmNybDAzBggrBgEFBQcBAQQnMCUw -IwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MEAGA1UdIAQ5MDcw -NQYJKoZIhvZ9B0sCMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuZW50cnVzdC5u -ZXQvcnBhMB8GA1UdIwQYMBaAFB7xq4kG+EkPATN37hR67hl8kyhNMB0GA1UdDgQW -BBQ/gzreJ5piCG2MLGy5XOBCVB9iTTAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBBQUA -A4IBAQCK6J1LZ3kGde6kzS4aGnPq5WUnJTdwB/ASIB15OOdK20Mdi7D0zF0Aevew -+f73shY3f7eozVmh8aCb7uDRojrBgLGdtj0vcRiqUm+e1LKf9p0XPdFMLGzh2E2W -+eLhBTMEYOgGPQDY/sf2MEKHRIgobccFI3LUUXylncY6+UKtUWJQ114duoZH0+o+ -RIlSRgGsGNYkWJ9+jeI6acvG15ahIzIfUx8m0vQp0Nri9/3p/HOezQjNdN0knTlR -pRbXZJ65zOig2wjt4an0OfYnOcqpJ/2yslCv0/jKwumHeygVt68l3J4rH7nUwUzs -B+JUkDiJgBD/+BFADuJkTJLMcn6t ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIE8jCCA9qgAwIBAgIEOGPp/DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML -RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp -bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 -IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw0wOTEyMTAyMDQzNTRaFw0xOTEy -MTAyMTEzNTRaMIGxMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNRW50cnVzdCwgSW5j -LjE5MDcGA1UECxMwd3d3LmVudHJ1c3QubmV0L3JwYSBpcyBpbmNvcnBvcmF0ZWQg -YnkgcmVmZXJlbmNlMR8wHQYDVQQLExYoYykgMjAwOSBFbnRydXN0LCBJbmMuMS4w -LAYDVQQDEyVFbnRydXN0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gTDFDMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl6MtPJ7eBdoTwhGNnY7jf8dL -flqfs/9iq3PIKGu6EGSChxPNVxj/KM7A5g4GkVApg9Hywyrb2NtOBMwA64u2lty8 -qvpSdwTB2xnkrpz9PIsD7028GgNl+cGxP3KG8jiqGa4QiHgo2nXDPQKCApy5wWV3 -diRMmPdtMTj72/7bNwJ2oRiXpszeIAlJNiRpQvbkN2LxWW2pPO00nKOO29w61/cK -b+8u2NWTWnrtCElo4kHjWpDBhlX8UUOd4LLEZ7TLMjEl8FSfS9Fv29Td/K9ebHiQ -ld7KOki5eTybGdZ1BaD5iNfB6KUJ5BoV3IcjqrJ1jGMlh9j4PabCzGb/pWZoVQID -AQABo4IBCzCCAQcwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wMwYI -KwYBBQUHAQEEJzAlMCMGCCsGAQUFBzABhhdodHRwOi8vb2NzcC5lbnRydXN0Lm5l -dDAyBgNVHR8EKzApMCegJaAjhiFodHRwOi8vY3JsLmVudHJ1c3QubmV0LzIwNDhj -YS5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93 -d3cuZW50cnVzdC5uZXQvcnBhMB0GA1UdDgQWBBQe8auJBvhJDwEzd+4Ueu4ZfJMo -TTAfBgNVHSMEGDAWgBRV5IHREYC+2Im5CKMx+aEkCRa5cDANBgkqhkiG9w0BAQUF -AAOCAQEAB/ZfgoR/gEDHkDRGQiQDzi+ruoOeJXMN7awFacaH7aNc8lfBsUl2mk3y -P93kDv4LPrmY2TKVHTL0Ae6cyMjlP+BTdmL83attPZSQ8sCzPJgnNl4olyL8G0DT -Kw2ttVdt3w/jS+9zAhBl+hvQrDHV4w/oujIwg+5K0L/fIpB6vuw6G8RJBB3xroB3 -PEII26c7KKaAAQPmOaPr34BZG/MsvtxyRHmgbAelbU1EjkJoypR8Lja6hZ7NqsRe -PFS+/i/qaZ0cHimbltjI/lGQ8SSmkAaz8Cmi/3gud1xFIdlEADHzvjJP9QoyDfz8 -uhZ2VrLWSJLyi6Y+t6xcaeoLP2ZFuQ== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEnzCCBAigAwIBAgIERp6RGjANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wOTAz -MjMxNTE4MjdaFw0xOTAzMjMxNTQ4MjdaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5l -dDFAMD4GA1UECxQ3d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkg -cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5u -ZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -rU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL -Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3ed -Vc3kw37XamSrhRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4 -LeksyZB2ZnuU4q941mVTXTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5 -CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N -328mz8MYIWJmQ3DW1cAH4QIDAQABo4IBJzCCASMwDgYDVR0PAQH/BAQDAgEGMA8G -A1UdEwEB/wQFMAMBAf8wMwYIKwYBBQUHAQEEJzAlMCMGCCsGAQUFBzABhhdodHRw -Oi8vb2NzcC5lbnRydXN0Lm5ldDAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8vY3Js -LmVudHJ1c3QubmV0L3NlcnZlcjEuY3JsMDsGA1UdIAQ0MDIwMAYEVR0gADAoMCYG -CCsGAQUFBwIBFhpodHRwOi8vd3d3LmVudHJ1c3QubmV0L0NQUzAdBgNVHQ4EFgQU -VeSB0RGAvtiJuQijMfmhJAkWuXAwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX -8+1i0BowGQYJKoZIhvZ9B0EABAwwChsEVjcuMQMCAIEwDQYJKoZIhvcNAQEFBQAD -gYEAj2WiMI4mq4rsNRaY6QPwjRdfvExsAvZ0UuDCxh/O8qYRDKixDk2Ei3E277M1 -RfPB+JbFi1WkzGuDFiAy2r77r5u3n+F+hJ+ePFCnP1zCvouGuAiS7vhCKw0T43aF -SApKv9ClOwqwVLht4wj5NI0LjosSzBcaM4eVyJ4K3FBTF3s= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 -MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE -ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j -b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg -U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ -I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 -wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC -AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb -oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 -BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p -dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk -MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp -b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 -MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi -E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa -MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI -hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN -95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd -2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDSTCCArKgAwIBAgIQfmO9EP9/fYY45sRzhqgfGzANBgkqhkiG9w0BAQUFADBM -MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkg -THRkLjEWMBQGA1UEAxMNVGhhd3RlIFNHQyBDQTAeFw0wOTA0MDkwMDAwMDBaFw0x -MTA0MTEyMzU5NTlaMIGPMQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRhaDEWMBQG -A1UEBxMNQW1lcmljYW4gRm9yazEcMBoGA1UEChMTQXV0aG9yaXplLk5ldCBDb3Jw -LjEcMBoGA1UECxMTQVVUSE9SSVpFLk5FVCBDT1JQLjEdMBsGA1UEAxMUc2VjdXJl -LmF1dGhvcml6ZS5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAN0dh86L -70MHbun7wTNGV0pNXsnebt3z9mCpndLUiBp5J/b57hQO5/HvevkhkDyCrky/Dn7y -4SEJh6RHYuP4ZBk30DS8iH5dWCRHqSQgpMKhUl/+D7KHbVqgPzOpOR44TiSa1P5m -Fv0qicvRR3iwSK/6ESywNvEJk1iiYPnpnnlvAgMBAAGjgecwgeQwDAYDVR0TAQH/ -BAIwADA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLnRoYXd0ZS5jb20vVGhh -d3RlU0dDQ0EuY3JsMCgGA1UdJQQhMB8GCCsGAQUFBwMBBggrBgEFBQcDAgYJYIZI -AYb4QgQBMHIGCCsGAQUFBwEBBGYwZDAiBggrBgEFBQcwAYYWaHR0cDovL29jc3Au -dGhhd3RlLmNvbTA+BggrBgEFBQcwAoYyaHR0cDovL3d3dy50aGF3dGUuY29tL3Jl -cG9zaXRvcnkvVGhhd3RlX1NHQ19DQS5jcnQwDQYJKoZIhvcNAQEFBQADgYEARa0l -PaGn4TOw3KOMVu8eiSdho4Nmal6u9AWE3rWHDakO2/a1AkZTM2/Wpt6KI3fp6WWK -LSsa9wLoVYSJ6pI7bmiJTvyx42yPP0PZXQSz05PHgTEGyW2jAn4N1hFvbTj28mZT -jv2jd12xgrmX34nulLdydNaM8J7CauhMvqwwvZ0= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIDIzCCAoygAwIBAgIEMAAAAjANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsTLkNsYXNzIDMgUHVi -bGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNTEzMDAw -MDAwWhcNMTQwNTEyMjM1OTU5WjBMMQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhh -d3RlIENvbnN1bHRpbmcgKFB0eSkgTHRkLjEWMBQGA1UEAxMNVGhhd3RlIFNHQyBD -QTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1NNn0I0Vf67NMf59HZGhPwtx -PKzMyGT7Y/wySweUvW+Aui/hBJPAM/wJMyPpC3QrccQDxtLN4i/1CWPN/0ilAL/g -5/OIty0y3pg25gqtAHvEZEo7hHUD8nCSfQ5i9SGraTaEMXWQ+L/HbIgbBpV8yeWo -3nWhLHpo39XKHIdYYBkCAwEAAaOB/jCB+zASBgNVHRMBAf8ECDAGAQH/AgEAMAsG -A1UdDwQEAwIBBjARBglghkgBhvhCAQEEBAMCAQYwKAYDVR0RBCEwH6QdMBsxGTAX -BgNVBAMTEFByaXZhdGVMYWJlbDMtMTUwMQYDVR0fBCowKDAmoCSgIoYgaHR0cDov -L2NybC52ZXJpc2lnbi5jb20vcGNhMy5jcmwwMgYIKwYBBQUHAQEEJjAkMCIGCCsG -AQUFBzABhhZodHRwOi8vb2NzcC50aGF3dGUuY29tMDQGA1UdJQQtMCsGCCsGAQUF -BwMBBggrBgEFBQcDAgYJYIZIAYb4QgQBBgpghkgBhvhFAQgBMA0GCSqGSIb3DQEB -BQUAA4GBAFWsY+reod3SkF+fC852vhNRj5PZBSvIG3dLrWlQoe7e3P3bB+noOZTc -q3J5Lwa/q4FwxKjt6lM07e8eU9kGx1Yr0Vz00YqOtCuxN5BICEIlxT6Ky3/rbwTR -bcV0oveifHtgPHfNDs5IAn8BL7abN+AqKjbc1YXWrOU/VG+WHgWv ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG -A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz -cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 -MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV -BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN -ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE -BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is -I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G -CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do -lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc -AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFCjCCA/KgAwIBAgIERWua3DANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 -Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW -KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA5MTIxMDIwNTU0M1oXDTE5MTIxMDIx -MjU0M1owgbExCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw -NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvcnBhIGlzIGluY29ycG9yYXRlZCBieSBy -ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA5IEVudHJ1c3QsIEluYy4xLjAsBgNV -BAMTJUVudHJ1c3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUUwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2WwRUd90OJGbcKqHbgMxdx1/9UhZY -2l+UBqm4trljDEcgguzHlU6LuHdSaj21h6nW4cx05abIwNRWT40u1gg+DExDPvBB -k15G7znn2WUqDHZQJ71bDTMzB+D3oqmc4REzrWb80ix6qqNzFr6ThXUP1zeM+iO3 -ZPjjTG7tswW94jbbfN52RNqCcna2bv+UodCG9xDNSlqLsHWMZlKATkhMSYOmQNd3 -gRNNXnJ+SEYiqg/iPmWUOOFycf5KcQm6NX9ViT2B1bgoARB3NloQhdK9YIQrSWGU -DN5MQGoqxHlghCSCMmlKmEviVhC6A0VRINPP2o5UG0W2erqXmlrYxtFfAgMBAAGj -ggEnMIIBIzAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAzBggrBgEF -BQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MDMG -A1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvcm9vdGNhMS5j -cmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cu -ZW50cnVzdC5uZXQvQ1BTMB0GA1UdDgQWBBRbQYqyxEPBvb/IVEFVneCWrf+5oTAf -BgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAZBgkqhkiG9n0HQQAEDDAK -GwRWNy4xAwIAgTANBgkqhkiG9w0BAQUFAAOCAQEAsjvSnsG8O0i23NhaGGZTw701 -DUhCLDUB2BCi4uONLLqmAxHta7FJy1/N7GCzutQC62FPTn7435BfTtOQAhxS2hIA -L5tx2gQSFMGQgy4o0hBAEYsmLeuZVVRvYI7Fgx3Aoz/VihQ5ahsN79NadznPabS9 -aW9PeNOhhqObt9f7qi3w+iah+WcsiEulNNWD+0zxW3AiZhubWU9NzpjbQaT+GqPr -OOb58TkCnUa2ycKePoK2H5/KSqixBl8QNDv92nusM07tprdL85H1nAsRktwTasjV -8TttlmsB5CNMscHg0hIhnynUrZU9pvfnMsV1twtX2KT5wOzsMjMMTa7oCNXsqg== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIEmzCCBASgAwIBAgIEQoctTDANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC -VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u -ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc -KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u -ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNzAx -MDUxOTIwMzlaFw0xNzAxMDUxOTUwMzlaMIGwMQswCQYDVQQGEwJVUzEWMBQGA1UE -ChMNRW50cnVzdCwgSW5jLjE5MDcGA1UECxMwd3d3LmVudHJ1c3QubmV0L0NQUyBp -cyBpbmNvcnBvcmF0ZWQgYnkgcmVmZXJlbmNlMR8wHQYDVQQLExYoYykgMjAwNiBF -bnRydXN0LCBJbmMuMS0wKwYDVQQDEyRFbnRydXN0IFJvb3QgQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2lbZD -QvrGbSpvSN+UTDlXBe7DeRFBaDbt7P6aAY+hOCj89xBGZi5NHhqxGk7G0cCViLDJ -/zGLMwPbt4N7PiCEXu2yViin+OC5QHE3xctHDpcqaMAilWIV20fZ9dAr/4JLya0+ -3kzbkIBQPwmKhADsMAo9GM37/SpZmiOVFyxFnh9uQ3ltDFyY/kinxSNHXF79buce -tPZoRdGGg1uiio2x4ymA/iVxiK2+vI+sUpZLqlGN5BMxGehOTZ/brLNq1bw5VHHK -enp/kN19HYDZgbtZJsIR/uaT4veA5GX7NDcOKYBwTa84hi6ef1evnheu6xzLKCFf -thzY56IEIvnT2tjLAgMBAAGjggEnMIIBIzAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T -AQH/BAUwAwEB/zAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9v -Y3NwLmVudHJ1c3QubmV0MDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50 -cnVzdC5uZXQvc2VydmVyMS5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYB -BQUHAgEWGmh0dHA6Ly93d3cuZW50cnVzdC5uZXQvQ1BTMB0GA1UdDgQWBBRokORn -pKZTgMeGZqTx90tD+4S9bTAfBgNVHSMEGDAWgBTwF2ITVT2z/woAa/tQhJfz7WLQ -GjAZBgkqhkiG9n0HQQAEDDAKGwRWNy4xAwIAgTANBgkqhkiG9w0BAQUFAAOBgQAM -sIR8LRP+mj2/GAWVPSBIoxaBhxVQFaSIjZ9g1Dpv6y1uOoakqdLBnYl6CBykLbNH -jg9kSm9mA4M/TzSUNqopbYuNAiIrjM13pXCVhpHRtr9SvjNqa5n5b+ESvgTLM7/1 -EhpORLpbFk0wufO0dM5u8mhWWN3Yof1UBfQjkYXJ+Q== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFdDCCBFygAwIBAgIETCA3bTANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5l -bnRydXN0Lm5ldC9ycGEgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEf -MB0GA1UECxMWKGMpIDIwMDkgRW50cnVzdCwgSW5jLjEuMCwGA1UEAxMlRW50 -cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxRTAeFw0xMTAzMjMx -NjQ4MzhaFw0xMzAzMjIyMzE4MDFaMIH4MQswCQYDVQQGEwJVUzETMBEGA1UE -CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzETMBEGCysG -AQQBgjc8AgEDEwJVUzEZMBcGCysGAQQBgjc8AgECEwhEZWxhd2FyZTEgMB4G -A1UEChMXQ3liZXJzb3VyY2UgQ29ycG9yYXRpb24xHTAbBgNVBA8TFFByaXZh -dGUgT3JnYW5pemF0aW9uMRwwGgYDVQQLExNBVVRIT1JJWkUuTkVUIENPUlAu -MS0wDgYDVQQFEwcyODM4OTIxMBsGA1UEAxMUc2VjdXJlLmF1dGhvcml6ZS5u -ZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvrwbLk7kDJnja -13i9lcXhYlHIwCTKHegPRuAkGDO6hNH0yNVv10kQSWjKhZ6KnoEA2p0F92FN -HwFTUfm0QGlaXW9kPc8nUi94hgY05iYwh96FHNdibqeO2r73GGol/RJkUO69 -ekqP1f+ABi7qWguL29cadX1DmOVQSkIeWc0xn9IVgS8dxnDzKwJ+41M5gLfM -YAJQ/FOwjOpt0j/Kg+38iHZ71FM7ehceYFggn+7y0ZcAcDUx4l6sKBuqFXq7 -viMqP2/Np0TpzmJMi2X8Wy0FDYoilHb9qBJWkl2AYxfjLTTSu27OMAJYyvEM -RmjOkLn7hQBPoSE6u3UKevtF2WPtAgMBAAGjggFJMIIBRTALBgNVHQ8EBAMC -BaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMDMGCCsGAQUFBwEB -BCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50cnVzdC5uZXQwMwYD -VR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5ldC9sZXZlbDFl -LmNybDBBBgNVHSAEOjA4MDYGCmCGSAGG+mwKAQIwKDAmBggrBgEFBQcCARYa -aHR0cDovL3d3dy5lbnRydXN0Lm5ldC9ycGEwHwYDVR0RBBgwFoIUc2VjdXJl -LmF1dGhvcml6ZS5uZXQwHwYDVR0jBBgwFoAUW0GKssRDwb2/yFRBVZ3glq3/ -uaEwHQYDVR0OBBYEFGZazQ8qcWqAiT+oFpV/D7WTbcGlMAkGA1UdEwQCMAAw -DQYJKoZIhvcNAQEFBQADggEBAEG1lvV2JQXDXRmEXkDp5qpF6uj1eNfffViE -QR6XCLPWIuaEcgnieTfFzRPEYbxzUY9jCqM62U37hUTDdMKjZas7fwaZ8RjE -wQASNPrIsHFsXEb0Nbz58g3cY00teCH3qQ9N9uW3TC+OXiSz9aSBxYkHD/63 -2D1rzaZLVHXUoReMMbjwf69zLDN7qsy6VDksHMVjqQugZF0ZCLFPPH5jfdAx -sOtocx7eyUovzO387ve8UMTdw6Anr9Ai7iVaYf4MpMqcuaHVet3QeE97Koy1 -mT3q9FmUGbXM+nCqSs/TQ4jSqOo4zqDnkK/cOgbzjsuJJZ/rCPSxaKvz3b/n -wMWH7kM= ------END CERTIFICATE----- \ No newline at end of file diff --git a/catalog/ext/modules/payment/chronopay/callback.php b/catalog/ext/modules/payment/chronopay/callback.php deleted file mode 100755 index 839098b07..000000000 --- a/catalog/ext/modules/payment/chronopay/callback.php +++ /dev/null @@ -1,50 +0,0 @@ - 0) { - $order = tep_db_fetch_array($order_query); - - if ($order['order_status'] == MODULE_PAYMENT_CHRONOPAY_PREPARE_ORDER_STATUS_ID) { - $total_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$HTTP_POST_VARS['cs2'] . "' and class = 'ot_total' limit 1"); - $total = tep_db_fetch_array($total_query); - - $comment_status = $HTTP_POST_VARS['transaction_type'] . ' (' . $HTTP_POST_VARS['transaction_id'] . '; ' . $currencies->format($HTTP_POST_VARS['total'], false, $HTTP_POST_VARS['currency']) . ')'; - - $order_status_id = (MODULE_PAYMENT_CHRONOPAY_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_CHRONOPAY_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID); - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$HTTP_POST_VARS['cs2'] . "'"); - - $sql_data_array = array('orders_id' => $HTTP_POST_VARS['cs2'], - 'orders_status_id' => $order_status_id, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => 'ChronoPay Verified [' . $comment_status . ']'); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } - } - } - } - - require('includes/application_bottom.php'); -?> diff --git a/catalog/ext/modules/payment/inpay/inpay_functions.php b/catalog/ext/modules/payment/inpay/inpay_functions.php deleted file mode 100755 index 31efc6e2f..000000000 --- a/catalog/ext/modules/payment/inpay/inpay_functions.php +++ /dev/null @@ -1,93 +0,0 @@ - $v) { - if (is_int($k) && $prefix != null) { - $k = urlencode($prefix . $k); - } - if ((!empty($key)) || ($key === 0)) $k = $key.'['.urlencode($k).']'; - if (is_array($v) || is_object($v)) { - array_push($ret, http_build_query($v, '', $sep, $k)); - } else { - array_push($ret, $k.'='.urlencode($v)); - } - } - if (empty($sep)) $sep = ini_get('arg_separator.output'); - return implode($sep, $ret); - }// http_build_query -}//if - -function get_invoice_status($pars) { - // - // prepare parameters - // - $calc_md5 = calc_inpay_invoice_status_md5key($pars); - $q = http_build_query(array("merchant_id"=>MODULE_PAYMENT_INPAY_MERCHANT_ID, "invoice_ref"=>$pars['invoice_reference'], "checksum"=>$calc_md5), "", "&"); - // - // communicate to inpay server - // - $fsocket = false; - $curl = false; - $result = false; - $fp = false; - $server = 'secure.inpay.com'; - if (MODULE_PAYMENT_INPAY_GATEWAY_SERVER != 'Production') { - $server = 'test-secure.inpay.com'; - } - - if ((PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://'.$server, 443, $errno, $errstr, 30))) { - $fsocket = true; - } elseif (function_exists('curl_exec')) { - $curl = true; - } - if ($fsocket == true) { - $header = 'POST /api/get_invoice_status HTTP/1.1'."\r\n". - 'Host: '.$server."\r\n". - 'Content-Type: application/x-www-form-urlencoded'."\r\n". - 'Content-Length: '.strlen($q)."\r\n". - 'Connection: close'."\r\n\r\n"; - @fputs($fp, $header.$q); - $str = ''; - while (!@feof($fp)) { - $res = @fgets($fp, 1024); - $str .= (string)$res; - } - @fclose($fp); - $result=$str; - $result = preg_split('/^\r?$/m', $result, 2); - $result = trim($result[1]); - } elseif ($curl == true) { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'https://'.$server.'/api/get_invoice_status'); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $q); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_HEADER, false); - curl_setopt($ch, CURLOPT_TIMEOUT, 30); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - $result = curl_exec($ch); - curl_close($ch); - } - return (string)$result; -} - -function calc_inpay_invoice_status_md5key($pars) { - $q = http_build_query(array("invoice_ref"=>$pars['invoice_reference'], "merchant_id"=>MODULE_PAYMENT_INPAY_MERCHANT_ID, - "secret_key"=>MODULE_PAYMENT_INPAY_SECRET_KEY), "", "&"); - $md5v = md5($q); - return $md5v; -} -?> diff --git a/catalog/ext/modules/payment/inpay/pb_handler.php b/catalog/ext/modules/payment/inpay/pb_handler.php deleted file mode 100755 index 726938047..000000000 --- a/catalog/ext/modules/payment/inpay/pb_handler.php +++ /dev/null @@ -1,387 +0,0 @@ -$HTTP_POST_VARS['order_id'], - "invoice_reference"=>$HTTP_POST_VARS['invoice_reference'], - "invoice_amount"=>$HTTP_POST_VARS['invoice_amount'], - "invoice_currency"=>$HTTP_POST_VARS['invoice_currency'], - "invoice_created_at"=>$HTTP_POST_VARS['invoice_created_at'], - "invoice_status"=>$HTTP_POST_VARS['invoice_status'], - "secret_key"=>$sk), "", "&"); - $md5v = md5($q); - if ($md5v != $HTTP_POST_VARS["checksum"]) - { - $ok = false; - $result = "bad checksum"; - } -} -if ($ok) -{ - $my_order_query = tep_db_query("select orders_status, currency, currency_value from ".TABLE_ORDERS." where orders_id = '".$HTTP_POST_VARS['order_id']."'"); // TODO: fix PB to add all params"' and customers_id = '" . (int)$HTTP_POST_VARS['custom'] . "'"); - if (tep_db_num_rows($my_order_query) <= 0) - { - $ok = false; - $result = "order not found"; - } -} -if ($ok) -{ - $my_order = tep_db_fetch_array($my_order_query); - $order = $my_order; - $total_query = tep_db_query("select value from ".TABLE_ORDERS_TOTAL." where orders_id = '".$HTTP_POST_VARS['order_id']."' and class = 'ot_total' limit 1"); - $total = tep_db_fetch_array($total_query); - if (number_format($HTTP_POST_VARS['invoice_amount'], $currencies->get_decimal_places($order['currency'])) != number_format($total['value']*$order['currency_value'], $currencies->get_decimal_places($order['currency']))) - { - $ok = false; - $result = 'Inpay transaction value ('.tep_output_string_protected($HTTP_POST_VARS['invoice_amount']).') does not match order value ('.number_format($total['value']*$order['currency_value'], $currencies->get_decimal_places($order['currency'])).')'; - } -} -if ($ok) -{ - // - // check status - // - $order = $my_order; - $delivered_status = 3; - if (($order['orders_status'] == MODULE_PAYMENT_INPAY_COMP_ORDER_STATUS_ID) || ($order['orders_status'] == $delivered_status)) - { - $ok = false; - $result = 'Status already in level'.$order['orders_status']; - } -} -if ($ok) { - require_once ('inpay_functions.php'); - $invoice_status = get_invoice_status($HTTP_POST_VARS); - $ok = false; - if ((($invoice_status == "pending")||($invoice_status == "created"))&&(($HTTP_POST_VARS["invoice_status"] == "pending")||($HTTP_POST_VARS["invoice_status"] == "created"))) { - $ok = true; - } else if (($invoice_status == "approved") && ($HTTP_POST_VARS["invoice_status"] == "approved")) { - $ok = true; - } else if (($invoice_status == "sum_too_low") && ($HTTP_POST_VARS["invoice_status"] == "sum_too_low")) { - $ok = true; - } - if (!$ok) - { - $result = "Bad invoice status:".$invoice_status; - } -} - -// -// Validate request end -//************************************ -if ($result == 'VERIFIED') -{ - $order = $my_order; - $order_status_id = DEFAULT_ORDERS_STATUS_ID; - $invoice_approved = false; - switch($HTTP_POST_VARS["invoice_status"]) - { - case "created": - case "pending": - $msg = "customer has been asked to pay ".$HTTP_POST_VARS['invoice_amount']." ".$HTTP_POST_VARS['invoice_currency']." with reference: ".$HTTP_POST_VARS["invoice_reference"]. " via his online bank"; - $order_status_id = MODULE_PAYMENT_INPAY_CREATE_ORDER_STATUS_ID; - break; - case "approved": - $msg = "Inpay has confimed that the payment of ".$HTTP_POST_VARS['invoice_amount']." ".$HTTP_POST_VARS['invoice_currency']." has been received"; - $order_status_id = MODULE_PAYMENT_INPAY_COMP_ORDER_STATUS_ID; - $invoice_approved = true; - break; - case "sum_too_low": - $msg = "Partial payment received by inpay. Reference: ".$HTTP_POST_VARS["invoice_reference"]; - $order_status_id = MODULE_PAYMENT_INPAY_SUM_TOO_LOW_ORDER_STATUS_ID; - break; - } - $comment_status .= $msg." ;"; - $customer_notified = '0'; - // - // update order status - // - $sql_data_array = array ('orders_id'=>$HTTP_POST_VARS['order_id'], - 'orders_status_id'=>$order_status_id, - 'date_added'=>'now()', - 'customer_notified'=>$customer_notified, - 'comments'=>'Inpay '.ucfirst($HTTP_POST_VARS['invoice_status']).'['.$comment_status.']'); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - tep_db_query("update ".TABLE_ORDERS." set orders_status = '".$order_status_id."', last_modified = now() where orders_id = '".(int)$HTTP_POST_VARS['order_id']."'"); - if ($invoice_approved) - { - // for email - include(DIR_WS_LANGUAGES . $language . '/modules/payment/inpay.php'); - // let's re-create the required arrays - require (DIR_WS_CLASSES.'order.php'); - $order = new order($HTTP_POST_VARS['order_id']); - // START STATUS == COMPLETED LOOP - // initialized for the email confirmation - $products_ordered = ''; - $total_tax = 0; - - // let's update the stock - // ####################################################### - for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) - { // PRODUCT LOOP STARTS HERE - // Stock Update - Joao Correia - if ((MODULE_PAYMENT_INPAY_DECREASE_STOCK_ON_CREATION=='False') && (STOCK_LIMITED == 'true')) - { - if (DOWNLOAD_ENABLED == 'true') - { - $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename - FROM ".TABLE_PRODUCTS." p - LEFT JOIN ".TABLE_PRODUCTS_ATTRIBUTES." pa - ON p.products_id=pa.products_id - LEFT JOIN ".TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD." pad - ON pa.products_attributes_id=pad.products_attributes_id - WHERE p.products_id = '".tep_get_prid($order->products[$i]['id'])."'"; - // Will work with only one option for downloadable products - // otherwise, we have to build the query dynamically with a loop - $products_attributes = $order->products[$i]['attributes']; - if (is_array($products_attributes)) - { - $stock_query_raw .= " AND pa.options_id = '".$products_attributes[0]['option_id']."' AND pa.options_values_id = '".$products_attributes[0]['value_id']."'"; - } - $stock_query = tep_db_query($stock_query_raw); - } else - { - $stock_query = tep_db_query("select products_quantity from ".TABLE_PRODUCTS." where products_id = '".tep_get_prid($order->products[$i]['id'])."'"); - } - if (tep_db_num_rows($stock_query) > 0) - { - $stock_values = tep_db_fetch_array($stock_query); - // do not decrement quantities if products_attributes_filename exists - if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) - { - $stock_left = $stock_values['products_quantity']-$order->products[$i]['qty']; - } else - { - $stock_left = $stock_values['products_quantity']; - } - tep_db_query("update ".TABLE_PRODUCTS." set products_quantity = '".$stock_left."' where products_id = '".tep_get_prid($order->products[$i]['id'])."'"); - if (($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false')) - { - tep_db_query("update ".TABLE_PRODUCTS." set products_status = '0' where products_id = '".tep_get_prid($order->products[$i]['id'])."'"); - } - } - } // decrease stock end - - // Update products_ordered (for bestsellers list) - tep_db_query("update ".TABLE_PRODUCTS." set products_ordered = products_ordered + ".sprintf('%d', $order->products[$i]['qty'])." where products_id = '".tep_get_prid($order->products[$i]['id'])."'"); - - // Let's get all the info together for the email - $total_weight += ($order->products[$i]['qty']*$order->products[$i]['weight']); - $total_tax += tep_calculate_tax($total_products_price, $products_tax)*$order->products[$i]['qty']; - $total_cost += $total_products_price; - - // Let's get the attributes - $products_ordered_attributes = ''; - if (( isset ($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0)) - { - for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) - { - $products_ordered_attributes .= "\n\t".$order->products[$i]['attributes'][$j]['option'].' '.$order->products[$i]['attributes'][$j]['value']; - } - } - - // Let's format the products model - $products_model = ''; - if (! empty($order->products[$i]['model'])) - { - $products_model = ' ('.$order->products[$i]['model'].')'; - } - - // Let's put all the product info together into a string - $products_ordered .= $order->products[$i]['qty'].' x '.$order->products[$i]['name'].$products_model.' = '.$currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']).$products_ordered_attributes."\n"; - } // PRODUCT LOOP ENDS HERE - ####################################################### - - // lets start with the email confirmation - // BOF content type fix by AlexStudio - $content_type = ''; - $content_count = 0; - // BOF order comment fix - $comment_query = tep_db_query("select comments from ".TABLE_ORDERS_STATUS_HISTORY." where orders_id = '".$HTTP_POST_VARS['order_id']."'"); - $comment_array = tep_db_fetch_array($comment_query); - $comments = $comment_array['comments']; - // EOF order comment fix - - if (DOWNLOAD_ENABLED == 'true') - { - $content_query = tep_db_query("select * from ".TABLE_ORDERS_PRODUCTS_DOWNLOAD." where orders_id = '".(int)$HTTP_POST_VARS['order_id']."'"); - $content_count = tep_db_num_rows($content_query); - if ($content_count > 0) - { - $content_type = 'virtual'; - } - } - switch($content_type) - { - case 'virtual': - if ($content_count != sizeof($order->products))$content_type = 'mixed'; - break; - default: - $content_type = 'physical'; - break; - } - // EOF content type fix by AlexStudio - // $order variables have been changed from checkout_process to work with the variables from the function query () instead of cart () in the order class - $email_order = STORE_NAME."\n". - EMAIL_SEPARATOR."\n". - EMAIL_TEXT_ORDER_NUMBER.' '.$HTTP_POST_VARS['order_id']."\n". - EMAIL_TEXT_INVOICE_URL.' '.tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id='.$HTTP_POST_VARS['order_id'], 'SSL', false)."\n". - EMAIL_TEXT_DATE_ORDERED.' '.strftime(DATE_FORMAT_LONG)."\n\n"; - // BOF order comment fix by AlexStudio - if ($comments) - { - // do not add comments - // $email_order .= $comments."\n\n"; - } - // EOF order comment fix by AlexStudio - - $email_order .= EMAIL_TEXT_PRODUCTS."\n". - EMAIL_SEPARATOR."\n". - $products_ordered. - EMAIL_SEPARATOR."\n"; - - for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) - { - $email_order .= strip_tags($order->totals[$i]['title']).' '.strip_tags($order->totals[$i]['text'])."\n"; - } - // BOF content type fix by AlexStudio - if ($content_type != 'virtual') - { - // EOF content type fix by AlexStudio - $email_order .= "\n".EMAIL_TEXT_DELIVERY_ADDRESS."\n". - EMAIL_SEPARATOR."\n". - tep_address_format($order->delivery['format_id'], $order->delivery, 0, '', "\n")."\n"; - } - - $email_order .= "\n".EMAIL_TEXT_BILLING_ADDRESS."\n". - EMAIL_SEPARATOR."\n". - tep_address_format($order->billing['format_id'], $order->billing, 0, '', "\n")."\n\n"; - if (is_object($$payment)) - { - $email_order .= EMAIL_TEXT_PAYMENT_METHOD."\n". - EMAIL_SEPARATOR."\n"; - $payment_class = $$payment; - $email_order .= $payment_class->title."\n\n"; - if ($payment_class->email_footer) - { - $email_order .= $payment_class->email_footer."\n\n"; - } - } - tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - - // send emails to other people - if (SEND_EXTRA_ORDER_EMAILS_TO != '') - { - tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } // END oreder approved LOOP - - - -} else -{ - // - // Invalid result - // - // - // send warning email - // - if (tep_not_null(MODULE_PAYMENT_INPAY_DEBUG_EMAIL)) - { - $email_body = '$HTTP_POST_VARS:'."\n\n"; - - reset($HTTP_POST_VARS); - while ( list ($key, $value) = each($HTTP_POST_VARS)) - { - $email_body .= $key.'='.$value."\n"; - } - - $email_body .= "\n".'$HTTP_GET_VARS:'."\n\n"; - - reset($HTTP_GET_VARS); - while ( list ($key, $value) = each($HTTP_GET_VARS)) - { - $email_body .= $key.'='.$value."\n"; - } - - tep_mail('', MODULE_PAYMENT_INPAY_DEBUG_EMAIL, 'Inpay Invalid Process', $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - // - // add error message to history if order can be found - // - if ( isset ($HTTP_POST_VARS['order_id']) && is_numeric($HTTP_POST_VARS['order_id']) && ($HTTP_POST_VARS['order_id'] > 0)) - { - $check_query = tep_db_query("select orders_id from ".TABLE_ORDERS." where orders_id = '".$HTTP_POST_VARS['order_id']."'"); //TODO: fix custom "' and customers_id = '" . (int)$HTTP_POST_VARS['custom'] . "'"); - $order_status_id = $order['orders_status']; - if (($order_status_id==null)||($order['orders_status']=='')){ - $order_status_id = DEFAULT_ORDERS_STATUS_ID; - } - if (tep_db_num_rows($check_query) > 0) - { - $comment_status = $result; - //tep_db_query("update ".TABLE_ORDERS." set orders_status = '".((MODULE_PAYMENT_INPAY_ORDER_STATUS_ID > 0)?MODULE_PAYMENT_INPAY_ORDER_STATUS_ID:DEFAULT_ORDERS_STATUS_ID)."', last_modified = now() where orders_id = '".$HTTP_POST_VARS['order_id']."'"); - $sql_data_array = array ('orders_id'=>$HTTP_POST_VARS['order_id'], - 'orders_status_id'=>$order_status_id, - 'date_added'=>'now()', - 'customer_notified'=>'0', - 'comments'=>'Inpay Invalid ['.$comment_status.']'); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } -} - -require ('includes/application_bottom.php'); - -?> diff --git a/catalog/ext/modules/payment/ipayment/callback_cc.php b/catalog/ext/modules/payment/ipayment/callback_cc.php deleted file mode 100644 index 5ebee835e..000000000 --- a/catalog/ext/modules/payment/ipayment/callback_cc.php +++ /dev/null @@ -1,38 +0,0 @@ -check() || !$ipayment_cc->enabled) { - exit; - } - - if (in_array(tep_get_ip_address(), $ipayment_cc->gateway_addresses)) { - $checksum_pass = 0; // unknown - - if (tep_not_null(MODULE_PAYMENT_IPAYMENT_CC_SECRET_HASH_PASSWORD)) { -// verify ret_param_checksum - if ($HTTP_POST_VARS['ret_param_checksum'] == md5(MODULE_PAYMENT_IPAYMENT_CC_USER_ID . $HTTP_POST_VARS['trx_amount'] . $HTTP_POST_VARS['trx_currency'] . $HTTP_POST_VARS['ret_authcode'] . $HTTP_POST_VARS['ret_booknr'] . MODULE_PAYMENT_IPAYMENT_CC_SECRET_HASH_PASSWORD)) { - $checksum_pass = 1; // true - } else { - $checksum_pass = -1; // false - } - } - - $ipayment_cc->sendDebugEmail($checksum_pass); - } -?> diff --git a/catalog/ext/modules/payment/ipayment/callback_elv.php b/catalog/ext/modules/payment/ipayment/callback_elv.php deleted file mode 100644 index e7fec77ed..000000000 --- a/catalog/ext/modules/payment/ipayment/callback_elv.php +++ /dev/null @@ -1,38 +0,0 @@ -check() || !$ipayment_elv->enabled) { - exit; - } - - if (in_array(tep_get_ip_address(), $ipayment_elv->gateway_addresses)) { - $checksum_pass = 0; // unknown - - if (tep_not_null(MODULE_PAYMENT_IPAYMENT_ELV_SECRET_HASH_PASSWORD)) { -// verify ret_param_checksum - if ($HTTP_POST_VARS['ret_param_checksum'] == md5(MODULE_PAYMENT_IPAYMENT_ELV_USER_ID . $HTTP_POST_VARS['trx_amount'] . $HTTP_POST_VARS['trx_currency'] . $HTTP_POST_VARS['ret_authcode'] . $HTTP_POST_VARS['ret_booknr'] . MODULE_PAYMENT_IPAYMENT_ELV_SECRET_HASH_PASSWORD)) { - $checksum_pass = 1; // true - } else { - $checksum_pass = -1; // false - } - } - - $ipayment_elv->sendDebugEmail($checksum_pass); - } -?> diff --git a/catalog/ext/modules/payment/ipayment/callback_pp.php b/catalog/ext/modules/payment/ipayment/callback_pp.php deleted file mode 100644 index 23b4f30f3..000000000 --- a/catalog/ext/modules/payment/ipayment/callback_pp.php +++ /dev/null @@ -1,38 +0,0 @@ -check() || !$ipayment_pp->enabled) { - exit; - } - - if (in_array(tep_get_ip_address(), $ipayment_pp->gateway_addresses)) { - $checksum_pass = 0; // unknown - - if (tep_not_null(MODULE_PAYMENT_IPAYMENT_PP_SECRET_HASH_PASSWORD)) { -// verify ret_param_checksum - if ($HTTP_POST_VARS['ret_param_checksum'] == md5(MODULE_PAYMENT_IPAYMENT_PP_USER_ID . $HTTP_POST_VARS['trx_amount'] . $HTTP_POST_VARS['trx_currency'] . $HTTP_POST_VARS['ret_authcode'] . $HTTP_POST_VARS['ret_booknr'] . MODULE_PAYMENT_IPAYMENT_PP_SECRET_HASH_PASSWORD)) { - $checksum_pass = 1; // true - } else { - $checksum_pass = -1; // false - } - } - - $ipayment_pp->sendDebugEmail($checksum_pass); - } -?> diff --git a/catalog/ext/modules/payment/moneybookers/callback.php b/catalog/ext/modules/payment/moneybookers/callback.php deleted file mode 100755 index 09fccc59f..000000000 --- a/catalog/ext/modules/payment/moneybookers/callback.php +++ /dev/null @@ -1,83 +0,0 @@ - 0)) { - if ($HTTP_POST_VARS['md5sig'] == strtoupper(md5(MODULE_PAYMENT_MONEYBOOKERS_MERCHANT_ID . $HTTP_POST_VARS['transaction_id'] . strtoupper(md5(MODULE_PAYMENT_MONEYBOOKERS_SECRET_WORD)) . $HTTP_POST_VARS['mb_amount'] . $HTTP_POST_VARS['mb_currency'] . $HTTP_POST_VARS['status']))) { - $order_query = tep_db_query("select orders_status, currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . $HTTP_POST_VARS['transaction_id'] . "' and customers_id = '" . (int)$HTTP_POST_VARS['osc_custid'] . "'"); - if (tep_db_num_rows($order_query) > 0) { - $pass = true; - - $order = tep_db_fetch_array($order_query); - - $status = $HTTP_POST_VARS['status']; - switch ($HTTP_POST_VARS['status']) { - case '2': - $status = 'Processed'; - break; - case '0': - $status = 'Pending'; - break; - case '-1': - $status = 'Cancelled'; - break; - case '-2': - $status = 'Failed'; - break; - case '-3': - $status = 'Chargeback'; - break; - } - - $comment_status = $status . ' (' . $currencies->format($HTTP_POST_VARS['amount'], false, $HTTP_POST_VARS['currency']) . ')'; - - $sql_data_array = array('orders_id' => $HTTP_POST_VARS['transaction_id'], - 'orders_status_id' => (MODULE_PAYMENT_MONEYBOOKERS_TRANSACTIONS_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_MONEYBOOKERS_TRANSACTIONS_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID), - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => 'Moneybookers Verified [' . $comment_status . ']'); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } - } - - if (($pass == false) && tep_not_null(MODULE_PAYMENT_MONEYBOOKERS_DEBUG_EMAIL)) { - $email_body = 'IP Address: ' . tep_get_ip_address() . "\n\n" . - 'MD5: ' . strtoupper(md5(MODULE_PAYMENT_MONEYBOOKERS_MERCHANT_ID . (isset($HTTP_POST_VARS['transaction_id']) ? $HTTP_POST_VARS['transaction_id'] : '') . strtoupper(md5(MODULE_PAYMENT_MONEYBOOKERS_SECRET_WORD)) . (isset($HTTP_POST_VARS['mb_amount']) ? $HTTP_POST_VARS['mb_amount'] : '') . (isset($HTTP_POST_VARS['mb_currency']) ? $HTTP_POST_VARS['mb_currency'] : '') . (isset($HTTP_POST_VARS['status']) ? $HTTP_POST_VARS['status'] : ''))) . "\n\n" . - '$HTTP_POST_VARS:' . "\n\n"; - - reset($HTTP_POST_VARS); - while (list($key, $value) = each($HTTP_POST_VARS)) { - $email_body .= $key . '=' . $value . "\n"; - } - - $email_body .= "\n" . '$HTTP_GET_VARS:' . "\n\n"; - - reset($HTTP_GET_VARS); - while (list($key, $value) = each($HTTP_GET_VARS)) { - $email_body .= $key . '=' . $value . "\n"; - } - - tep_mail('', MODULE_PAYMENT_MONEYBOOKERS_DEBUG_EMAIL, 'Moneybookers Invalid Process', $email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - - require('includes/application_bottom.php'); -?> diff --git a/catalog/ext/modules/payment/moneybookers/checkout.php b/catalog/ext/modules/payment/moneybookers/checkout.php deleted file mode 100644 index 7fa4edc2a..000000000 --- a/catalog/ext/modules/payment/moneybookers/checkout.php +++ /dev/null @@ -1,104 +0,0 @@ -set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); - } - -// if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - -// avoid hack attempts during the checkout procedure by checking the internal cartID - if (isset($cart->cartID) && tep_session_is_registered('cartID')) { - if ($cart->cartID != $cartID) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - } - } - -// if no shipping method has been selected, redirect the customer to the shipping method selection page - if (!tep_session_is_registered('shipping')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - } - - if (!tep_session_is_registered('payment') || (substr($payment, 0, 12) != 'moneybookers')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); - } - -// load the selected payment module - require(DIR_WS_CLASSES . 'payment.php'); - $payment_modules = new payment($payment); - - require(DIR_WS_CLASSES . 'order.php'); - $order = new order; - - $payment_modules->update_status(); - - if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); - } - - if (is_array($payment_modules->modules)) { - $payment_modules->pre_confirmation_check(); - } - -// load the selected shipping module - require(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping($shipping); - - require(DIR_WS_CLASSES . 'order_total.php'); - $order_total_modules = new order_total; - $order_total_modules->process(); - -// Stock Check - $any_out_of_stock = false; - if (STOCK_CHECK == 'true') { - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { - $any_out_of_stock = true; - } - } - // Out of Stock - if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - } - - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION); - - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - $breadcrumb->add(NAVBAR_TITLE_2); - - $iframe_url = 'https://www.moneybookers.com/app/payment.pl?sid=' . $HTTP_POST_VARS['sid']; - - require(DIR_WS_INCLUDES . 'template_top.php'); -?> - - - - -
      - -
      - - diff --git a/catalog/ext/modules/payment/moneybookers/logos/4b.gif b/catalog/ext/modules/payment/moneybookers/logos/4b.gif deleted file mode 100644 index 7aba942b1..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/4b.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/All_CCs_225x45.gif b/catalog/ext/modules/payment/moneybookers/logos/All_CCs_225x45.gif deleted file mode 100644 index c461ab996..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/All_CCs_225x45.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/by_ewallet_90x45.gif b/catalog/ext/modules/payment/moneybookers/logos/by_ewallet_90x45.gif deleted file mode 100644 index 9f35d0aa8..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/by_ewallet_90x45.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/cartasi.gif b/catalog/ext/modules/payment/moneybookers/logos/cartasi.gif deleted file mode 100644 index 021785bc4..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/cartasi.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/cartebleue.gif b/catalog/ext/modules/payment/moneybookers/logos/cartebleue.gif deleted file mode 100644 index e3e5616ee..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/cartebleue.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/dankort.gif b/catalog/ext/modules/payment/moneybookers/logos/dankort.gif deleted file mode 100644 index de16f6b40..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/dankort.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/ec.gif b/catalog/ext/modules/payment/moneybookers/logos/ec.gif deleted file mode 100644 index f825a36f6..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/ec.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/enets.gif b/catalog/ext/modules/payment/moneybookers/logos/enets.gif deleted file mode 100644 index f5578eb47..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/enets.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/eps.gif b/catalog/ext/modules/payment/moneybookers/logos/eps.gif deleted file mode 100644 index bd6ba95bb..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/eps.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/euro6000.gif b/catalog/ext/modules/payment/moneybookers/logos/euro6000.gif deleted file mode 100644 index eea25a655..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/euro6000.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/giropay.gif b/catalog/ext/modules/payment/moneybookers/logos/giropay.gif deleted file mode 100644 index 642afcf90..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/giropay.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/ideal.gif b/catalog/ext/modules/payment/moneybookers/logos/ideal.gif deleted file mode 100644 index b3ba9f8ed..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/ideal.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/laser.gif b/catalog/ext/modules/payment/moneybookers/logos/laser.gif deleted file mode 100644 index 5a3b9925c..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/laser.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/maestro.gif b/catalog/ext/modules/payment/moneybookers/logos/maestro.gif deleted file mode 100644 index 3df6433e3..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/maestro.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/nordea.gif b/catalog/ext/modules/payment/moneybookers/logos/nordea.gif deleted file mode 100644 index 5510d07ec..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/nordea.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/p24.gif b/catalog/ext/modules/payment/moneybookers/logos/p24.gif deleted file mode 100644 index 510e6eda1..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/p24.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/poli.gif b/catalog/ext/modules/payment/moneybookers/logos/poli.gif deleted file mode 100644 index 17e542d22..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/poli.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/postepay.gif b/catalog/ext/modules/payment/moneybookers/logos/postepay.gif deleted file mode 100644 index eb17d6b6f..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/postepay.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/sofort.gif b/catalog/ext/modules/payment/moneybookers/logos/sofort.gif deleted file mode 100644 index d6fe1d5c3..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/sofort.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/moneybookers/logos/solo.gif b/catalog/ext/modules/payment/moneybookers/logos/solo.gif deleted file mode 100644 index 624e56c86..000000000 Binary files a/catalog/ext/modules/payment/moneybookers/logos/solo.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/paypal/express.php b/catalog/ext/modules/payment/paypal/express.php deleted file mode 100644 index fb07065a0..000000000 --- a/catalog/ext/modules/payment/paypal/express.php +++ /dev/null @@ -1,876 +0,0 @@ -check() || !$paypal_express->enabled) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - if ( !tep_session_is_registered('sendto') ) { - if ( tep_session_is_registered('customer_id') ) { - $sendto = $customer_default_address_id; - } else { - $country = tep_get_countries(STORE_COUNTRY, true); - - $sendto = array('firstname' => '', - 'lastname' => '', - 'company' => '', - 'street_address' => '', - 'suburb' => '', - 'postcode' => '', - 'city' => '', - 'zone_id' => STORE_ZONE, - 'zone_name' => tep_get_zone_name(STORE_COUNTRY, STORE_ZONE, ''), - 'country_id' => STORE_COUNTRY, - 'country_name' => $country['countries_name'], - 'country_iso_code_2' => $country['countries_iso_code_2'], - 'country_iso_code_3' => $country['countries_iso_code_3'], - 'address_format_id' => tep_get_address_format_id(STORE_COUNTRY)); - } - } - - if ( !tep_session_is_registered('billto') ) { - $billto = $sendto; - } - -// register a random ID in the session to check throughout the checkout procedure -// against alterations in the shopping cart contents - if (!tep_session_is_registered('cartID')) tep_session_register('cartID'); - $cartID = $cart->cartID; - - switch ($HTTP_GET_VARS['osC_Action']) { - case 'cancel': - tep_session_unregister('ppe_token'); - tep_session_unregister('ppe_secret'); - - if ( empty($sendto['firstname']) && empty($sendto['lastname']) && empty($sendto['street_address']) ) { - tep_session_unregister('sendto'); - } - - if ( empty($billto['firstname']) && empty($billto['lastname']) && empty($billto['street_address']) ) { - tep_session_unregister('billto'); - } - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - - break; - case 'callbackSet': - if (MODULE_PAYMENT_PAYPAL_EXPRESS_INSTANT_UPDATE == 'True') { - $counter = 0; - - if (isset($HTTP_POST_VARS['CURRENCYCODE']) && $currencies->is_set($HTTP_POST_VARS['CURRENCYCODE']) && ($currency != $HTTP_POST_VARS['CURRENCYCODE'])) { - $currency = $HTTP_POST_VARS['CURRENCYCODE']; - } - - while (true) { - if (isset($HTTP_POST_VARS['L_NUMBER' . $counter])) { - $cart->add_cart($HTTP_POST_VARS['L_NUMBER' . $counter], $HTTP_POST_VARS['L_QTY' . $counter]); - } else { - break; - } - - $counter++; - } - -// exit if there is nothing in the shopping cart - if ($cart->count_contents() < 1) { - exit; - } - - $sendto = array('firstname' => '', - 'lastname' => '', - 'company' => '', - 'street_address' => $HTTP_POST_VARS['SHIPTOSTREET'], - 'suburb' => '', - 'postcode' => $HTTP_POST_VARS['SHIPTOZIP'], - 'city' => $HTTP_POST_VARS['SHIPTOCITY'], - 'zone_id' => '', - 'zone_name' => $HTTP_POST_VARS['SHIPTOSTATE'], - 'country_id' => '', - 'country_name' => $HTTP_POST_VARS['SHIPTOCOUNTRY'], - 'country_iso_code_2' => '', - 'country_iso_code_3' => '', - 'address_format_id' => ''); - - $country_query = tep_db_query("select * from " . TABLE_COUNTRIES . " where countries_iso_code_2 = '" . tep_db_input($sendto['country_name']) . "' limit 1"); - if (tep_db_num_rows($country_query)) { - $country = tep_db_fetch_array($country_query); - - $sendto['country_id'] = $country['countries_id']; - $sendto['country_name'] = $country['countries_name']; - $sendto['country_iso_code_2'] = $country['countries_iso_code_2']; - $sendto['country_iso_code_3'] = $country['countries_iso_code_3']; - $sendto['address_format_id'] = $country['address_format_id']; - } - - if ($sendto['country_id'] > 0) { - $zone_query = tep_db_query("select * from " . TABLE_ZONES . " where zone_country_id = '" . (int)$sendto['country_id'] . "' and (zone_name = '" . tep_db_input($sendto['zone_name']) . "' or zone_code = '" . tep_db_input($sendto['zone_name']) . "') limit 1"); - if (tep_db_num_rows($zone_query)) { - $zone = tep_db_fetch_array($zone_query); - - $sendto['zone_id'] = $zone['zone_id']; - $sendto['zone_name'] = $zone['zone_name']; - } - } - - $billto = $sendto; - - $quotes_array = array(); - - include(DIR_WS_CLASSES . 'order.php'); - $order = new order; - - if ($cart->get_content_type() != 'virtual') { - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); - -// load all enabled shipping modules - include(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping; - - $free_shipping = false; - - if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { - $pass = false; - - switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { - case 'national': - if ($order->delivery['country_id'] == STORE_COUNTRY) { - $pass = true; - } - break; - - case 'international': - if ($order->delivery['country_id'] != STORE_COUNTRY) { - $pass = true; - } - break; - - case 'both': - $pass = true; - break; - } - - if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { - $free_shipping = true; - - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); - } - } - - if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { - if ($free_shipping == true) { - $quotes_array[] = array('id' => 'free_free', - 'name' => FREE_SHIPPING_TITLE, - 'label' => '', - 'cost' => '0', - 'tax' => '0'); - } else { -// get all available shipping quotes - $quotes = $shipping_modules->quote(); - - foreach ($quotes as $quote) { - if (!isset($quote['error'])) { - foreach ($quote['methods'] as $rate) { - $quotes_array[] = array('id' => $quote['id'] . '_' . $rate['id'], - 'name' => $quote['module'], - 'label' => $rate['title'], - 'cost' => $rate['cost'], - 'tax' => isset($quote['tax']) ? $quote['tax'] : '0'); - } - } - } - } - } - } else { - $quotes_array[] = array('id' => 'null', - 'name' => 'No Shipping', - 'label' => '', - 'cost' => '0', - 'tax' => '0'); - } - - include(DIR_WS_CLASSES . 'order_total.php'); - $order_total_modules = new order_total; - $order_totals = $order_total_modules->process(); - - $params = array('METHOD' => 'CallbackResponse', - 'CALLBACKVERSION' => $paypal_express->api_version); - - if ( !empty($quotes_array) ) { - $params['CURRENCYCODE'] = $currency; - $params['OFFERINSURANCEOPTION'] = 'false'; - - $counter = 0; - $cheapest_rate = null; - $cheapest_counter = $counter; - - foreach ($quotes_array as $quote) { - $shipping_rate = $paypal_express->format_raw($quote['cost'] + tep_calculate_tax($quote['cost'], $quote['tax'])); - - $params['L_SHIPPINGOPTIONNAME' . $counter] = $quote['name']; - $params['L_SHIPPINGOPTIONLABEL' . $counter] = $quote['label']; - $params['L_SHIPPINGOPTIONAMOUNT' . $counter] = $shipping_rate; - $params['L_SHIPPINGOPTIONISDEFAULT' . $counter] = 'false'; - - if ( DISPLAY_PRICE_WITH_TAX == 'false' ) { - $params['L_TAXAMT' . $counter] = $paypal_express->format_raw($order->info['tax']); - } - - if (is_null($cheapest_rate) || ($shipping_rate < $cheapest_rate)) { - $cheapest_rate = $shipping_rate; - $cheapest_counter = $counter; - } - - $counter++; - } - - $params['L_SHIPPINGOPTIONISDEFAULT' . $cheapest_counter] = 'true'; - } else { - $params['NO_SHIPPING_OPTION_DETAILS'] = '1'; - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - echo $post_string; - } - - tep_session_destroy(); - - exit; - - break; - case 'retrieve': -// if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - $response_array = $paypal_express->getExpressCheckoutDetails($HTTP_GET_VARS['token']); - - if (($response_array['ACK'] == 'Success') || ($response_array['ACK'] == 'SuccessWithWarning')) { - if ( !tep_session_is_registered('ppe_secret') || ($response_array['PAYMENTREQUEST_0_CUSTOM'] != $ppe_secret) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - if (!tep_session_is_registered('payment')) tep_session_register('payment'); - $payment = $paypal_express->code; - - if (!tep_session_is_registered('ppe_token')) tep_session_register('ppe_token'); - $ppe_token = $response_array['TOKEN']; - - if (!tep_session_is_registered('ppe_payerid')) tep_session_register('ppe_payerid'); - $ppe_payerid = $response_array['PAYERID']; - - if (!tep_session_is_registered('ppe_payerstatus')) tep_session_register('ppe_payerstatus'); - $ppe_payerstatus = $response_array['PAYERSTATUS']; - - if (!tep_session_is_registered('ppe_addressstatus')) tep_session_register('ppe_addressstatus'); - $ppe_addressstatus = $response_array['ADDRESSSTATUS']; - - $force_login = false; - -// check if e-mail address exists in database and login or create customer account - if (!tep_session_is_registered('customer_id')) { - $force_login = true; - - $email_address = tep_db_prepare_input($response_array['EMAIL']); - - $check_query = tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - -// Force the customer to log into their local account if payerstatus is unverified and a local password is set - if ( ($response_array['PAYERSTATUS'] == 'unverified') && !empty($check['customers_password']) ) { - $messageStack->add_session('login', MODULE_PAYMENT_PAYPAL_EXPRESS_WARNING_LOCAL_LOGIN_REQUIRED, 'warning'); - - $navigation->set_snapshot(); - - $login_url = tep_href_link(FILENAME_LOGIN, '', 'SSL'); - $login_email_address = tep_output_string($response_array['EMAIL']); - - $output = << - - - -EOD; - - echo $output; - exit; - } else { - $customer_id = $check['customers_id']; - $customers_firstname = $check['customers_firstname']; - $customer_default_address_id = $check['customers_default_address_id']; - } - } else { - $customers_firstname = tep_db_prepare_input($response_array['FIRSTNAME']); - $customers_lastname = tep_db_prepare_input($response_array['LASTNAME']); - - $sql_data_array = array('customers_firstname' => $customers_firstname, - 'customers_lastname' => $customers_lastname, - 'customers_email_address' => $email_address, - 'customers_telephone' => '', - 'customers_fax' => '', - 'customers_newsletter' => '0', - 'customers_password' => ''); - - if (isset($response_array['PHONENUM']) && tep_not_null($response_array['PHONENUM'])) { - $customers_telephone = tep_db_prepare_input($response_array['PHONENUM']); - - $sql_data_array['customers_telephone'] = $customers_telephone; - } - - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); - - $customer_id = tep_db_insert_id(); - - tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); - -// Only generate a password and send an email if the Set Password Content Module is not enabled - if ( !defined('MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS') || (MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS != 'True') ) { - $customer_password = tep_create_random_value(max(ENTRY_PASSWORD_MIN_LENGTH, 8)); - - tep_db_perform(TABLE_CUSTOMERS, array('customers_password' => tep_encrypt_password($customer_password)), 'update', 'customers_id = "' . (int)$customer_id . '"'); - -// build the message content - $name = $customers_firstname . ' ' . $customers_lastname; - $email_text = sprintf(EMAIL_GREET_NONE, $customers_firstname) . EMAIL_WELCOME . sprintf(MODULE_PAYMENT_PAYPAL_EXPRESS_EMAIL_PASSWORD, $email_address, $customer_password) . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; - tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - - if (SESSION_RECREATE == 'True') { - tep_session_recreate(); - } - - $customer_first_name = $customers_firstname; - tep_session_register('customer_id'); - tep_session_register('customer_first_name'); - -// reset session token - $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); - } - -// check if paypal shipping address exists in the address book - $ship_firstname = tep_db_prepare_input(substr($response_array['PAYMENTREQUEST_0_SHIPTONAME'], 0, strpos($response_array['PAYMENTREQUEST_0_SHIPTONAME'], ' '))); - $ship_lastname = tep_db_prepare_input(substr($response_array['PAYMENTREQUEST_0_SHIPTONAME'], strpos($response_array['PAYMENTREQUEST_0_SHIPTONAME'], ' ')+1)); - $ship_address = tep_db_prepare_input($response_array['PAYMENTREQUEST_0_SHIPTOSTREET']); - $ship_city = tep_db_prepare_input($response_array['PAYMENTREQUEST_0_SHIPTOCITY']); - $ship_zone = tep_db_prepare_input($response_array['PAYMENTREQUEST_0_SHIPTOSTATE']); - $ship_zone_id = 0; - $ship_postcode = tep_db_prepare_input($response_array['PAYMENTREQUEST_0_SHIPTOZIP']); - $ship_country = tep_db_prepare_input($response_array['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE']); - $ship_country_id = 0; - $ship_address_format_id = 1; - - $country_query = tep_db_query("select countries_id, address_format_id from " . TABLE_COUNTRIES . " where countries_iso_code_2 = '" . tep_db_input($ship_country) . "' limit 1"); - if (tep_db_num_rows($country_query)) { - $country = tep_db_fetch_array($country_query); - - $ship_country_id = $country['countries_id']; - $ship_address_format_id = $country['address_format_id']; - } - - if ($ship_country_id > 0) { - $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$ship_country_id . "' and (zone_name = '" . tep_db_input($ship_zone) . "' or zone_code = '" . tep_db_input($ship_zone) . "') limit 1"); - if (tep_db_num_rows($zone_query)) { - $zone = tep_db_fetch_array($zone_query); - - $ship_zone_id = $zone['zone_id']; - } - } - - $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - - $sendto = $check['address_book_id']; - } else { - $sql_data_array = array('customers_id' => $customer_id, - 'entry_firstname' => $ship_firstname, - 'entry_lastname' => $ship_lastname, - 'entry_street_address' => $ship_address, - 'entry_postcode' => $ship_postcode, - 'entry_city' => $ship_city, - 'entry_country_id' => $ship_country_id); - - if (ACCOUNT_STATE == 'true') { - if ($ship_zone_id > 0) { - $sql_data_array['entry_zone_id'] = $ship_zone_id; - $sql_data_array['entry_state'] = ''; - } else { - $sql_data_array['entry_zone_id'] = '0'; - $sql_data_array['entry_state'] = $ship_zone; - } - } - - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); - - $address_id = tep_db_insert_id(); - - $sendto = $address_id; - - if ($customer_default_address_id < 1) { - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); - $customer_default_address_id = $address_id; - } - } - - $billto = $sendto; - - if ( !tep_session_is_registered('sendto') ) { - tep_session_register('sendto'); - } - - if ( !tep_session_is_registered('billto') ) { - tep_session_register('billto'); - } - - if ($force_login == true) { - $customer_country_id = $ship_country_id; - $customer_zone_id = $ship_zone_id; - tep_session_register('customer_default_address_id'); - tep_session_register('customer_country_id'); - tep_session_register('customer_zone_id'); - } - - include(DIR_WS_CLASSES . 'order.php'); - $order = new order; - - if ($cart->get_content_type() != 'virtual') { - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); - -// load all enabled shipping modules - include(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping; - - $free_shipping = false; - - if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { - $pass = false; - - switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { - case 'national': - if ($order->delivery['country_id'] == STORE_COUNTRY) { - $pass = true; - } - break; - - case 'international': - if ($order->delivery['country_id'] != STORE_COUNTRY) { - $pass = true; - } - break; - - case 'both': - $pass = true; - break; - } - - if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { - $free_shipping = true; - - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); - } - } - - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - $shipping = false; - - if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { - if ($free_shipping == true) { - $shipping = 'free_free'; - } else { -// get all available shipping quotes - $quotes = $shipping_modules->quote(); - - $shipping_set = false; - -// if available, set the selected shipping rate from PayPals order review page - if (isset($response_array['SHIPPINGOPTIONNAME']) && isset($response_array['SHIPPINGOPTIONAMOUNT'])) { - foreach ($quotes as $quote) { - if (!isset($quote['error'])) { - foreach ($quote['methods'] as $rate) { - if ($response_array['SHIPPINGOPTIONNAME'] == trim($quote['module'] . ' ' . $rate['title'])) { - $shipping_rate = $paypal_express->format_raw($rate['cost'] + tep_calculate_tax($rate['cost'], $quote['tax'])); - - if ($response_array['SHIPPINGOPTIONAMOUNT'] == $shipping_rate) { - $shipping = $quote['id'] . '_' . $rate['id']; - $shipping_set = true; - break 2; - } - } - } - } - } - } - - if ($shipping_set == false) { -// select cheapest shipping method - $shipping = $shipping_modules->cheapest(); - $shipping = $shipping['id']; - } - } - } else { - if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) { - tep_session_unregister('shipping'); - - $messageStack->add_session('checkout_address', MODULE_PAYMENT_PAYPAL_EXPRESS_ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS, 'error'); - - tep_session_register('ppec_right_turn'); - $ppec_right_turn = true; - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); - } - } - - if (strpos($shipping, '_')) { - list($module, $method) = explode('_', $shipping); - - if ( is_object($$module) || ($shipping == 'free_free') ) { - if ($shipping == 'free_free') { - $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE; - $quote[0]['methods'][0]['cost'] = '0'; - } else { - $quote = $shipping_modules->quote($method, $module); - } - - if (isset($quote['error'])) { - tep_session_unregister('shipping'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - } else { - if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) { - $shipping = array('id' => $shipping, - 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' ' . $quote[0]['methods'][0]['title']), - 'cost' => $quote[0]['methods'][0]['cost']); - } - } - } - } - } else { - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - $shipping = false; - - $sendto = false; - } - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')); - } else { - $messageStack->add_session('header', stripslashes($response_array['L_LONGMESSAGE0']), 'error'); - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - break; - - default: -// if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') { - $paypal_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&'; - } else { - $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&'; - } - - include(DIR_WS_CLASSES . 'order.php'); - $order = new order; - - $params = array('PAYMENTREQUEST_0_CURRENCYCODE' => $order->info['currency'], - 'ALLOWNOTE' => 0); - -// A billing address is required for digital orders so we use the shipping address PayPal provides -// if ($order->content_type == 'virtual') { -// $params['NOSHIPPING'] = '1'; -// } - - $item_params = array(); - - $line_item_no = 0; - - foreach ($order->products as $product) { - if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { - $product_price = $paypal_express->format_raw($product['final_price'] + tep_calculate_tax($product['final_price'], $product['tax'])); - } else { - $product_price = $paypal_express->format_raw($product['final_price']); - } - - $item_params['L_PAYMENTREQUEST_0_NAME' . $line_item_no] = $product['name']; - $item_params['L_PAYMENTREQUEST_0_AMT' . $line_item_no] = $product_price; - $item_params['L_PAYMENTREQUEST_0_NUMBER' . $line_item_no] = $product['id']; - $item_params['L_PAYMENTREQUEST_0_QTY' . $line_item_no] = $product['qty']; - $item_params['L_PAYMENTREQUEST_0_ITEMURL' . $line_item_no] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['id'], 'NONSSL', false); - - if ( (DOWNLOAD_ENABLED == 'true') && isset($product['attributes']) ) { - $item_params['L_PAYMENTREQUEST_n_ITEMCATEGORY' . $line_item_no] = $paypal_express->getProductType($product['id'], $product['attributes']); - } else { - $item_params['L_PAYMENTREQUEST_n_ITEMCATEGORY' . $line_item_no] = 'Physical'; - } - - $line_item_no++; - } - - if (tep_not_null($order->delivery['street_address'])) { - $params['PAYMENTREQUEST_0_SHIPTONAME'] = $order->delivery['firstname'] . ' ' . $order->delivery['lastname']; - $params['PAYMENTREQUEST_0_SHIPTOSTREET'] = $order->delivery['street_address']; - $params['PAYMENTREQUEST_0_SHIPTOCITY'] = $order->delivery['city']; - $params['PAYMENTREQUEST_0_SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'] = $order->delivery['country']['iso_code_2']; - $params['PAYMENTREQUEST_0_SHIPTOZIP'] = $order->delivery['postcode']; - } - - $quotes_array = array(); - - if ($cart->get_content_type() != 'virtual') { - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); - -// load all enabled shipping modules - include(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping; - - $free_shipping = false; - - if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { - $pass = false; - - switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { - case 'national': - if ($order->delivery['country_id'] == STORE_COUNTRY) { - $pass = true; - } - break; - - case 'international': - if ($order->delivery['country_id'] != STORE_COUNTRY) { - $pass = true; - } - break; - - case 'both': - $pass = true; - break; - } - - if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { - $free_shipping = true; - - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); - } - } - - if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { - if ($free_shipping == true) { - $quotes_array[] = array('id' => 'free_free', - 'name' => FREE_SHIPPING_TITLE, - 'label' => '', - 'cost' => '0.00', - 'tax' => '0'); - } else { -// get all available shipping quotes - $quotes = $shipping_modules->quote(); - - foreach ($quotes as $quote) { - if (!isset($quote['error'])) { - foreach ($quote['methods'] as $rate) { - $quotes_array[] = array('id' => $quote['id'] . '_' . $rate['id'], - 'name' => $quote['module'], - 'label' => $rate['title'], - 'cost' => $rate['cost'], - 'tax' => $quote['tax']); - } - } - } - } - } else { - if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) { - tep_session_unregister('shipping'); - - $messageStack->add_session('checkout_address', MODULE_PAYMENT_PAYPAL_EXPRESS_ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); - } - } - } - - $counter = 0; - $cheapest_rate = null; - $expensive_rate = 0; - $cheapest_counter = $counter; - $default_shipping = null; - - foreach ($quotes_array as $quote) { - $shipping_rate = $paypal_express->format_raw($quote['cost'] + tep_calculate_tax($quote['cost'], $quote['tax'])); - - $item_params['L_SHIPPINGOPTIONNAME' . $counter] = trim($quote['name'] . ' ' . $quote['label']); - $item_params['L_SHIPPINGOPTIONAMOUNT' . $counter] = $shipping_rate; - $item_params['L_SHIPPINGOPTIONISDEFAULT' . $counter] = 'false'; - - if (is_null($cheapest_rate) || ($shipping_rate < $cheapest_rate)) { - $cheapest_rate = $shipping_rate; - $cheapest_counter = $counter; - } - - if ($shipping_rate > $expensive_rate) { - $expensive_rate = $shipping_rate; - } - - if (tep_session_is_registered('shipping') && ($shipping['id'] == $quote['id'])) { - $default_shipping = $counter; - } - - $counter++; - } - - if (!is_null($default_shipping)) { - $cheapest_rate = $item_params['L_SHIPPINGOPTIONAMOUNT' . $default_shipping]; - $cheapest_counter = $default_shipping; - } else { - if ( !empty($quotes_array) ) { - $shipping = array('id' => $quotes_array[$cheapest_counter]['id'], - 'title' => $item_params['L_SHIPPINGOPTIONNAME' . $cheapest_counter], - 'cost' => $paypal_express->format_raw($quotes_array[$cheapest_counter]['cost'])); - - $default_shipping = $cheapest_counter; - } else { - $shipping = false; - } - - if ( !tep_session_is_registered('shipping') ) { - tep_session_register('shipping'); - } - } - -// set shipping for order total calculations; shipping in $item_params includes taxes - if (!is_null($default_shipping)) { - $order->info['shipping_method'] = $item_params['L_SHIPPINGOPTIONNAME' . $default_shipping]; - $order->info['shipping_cost'] = $item_params['L_SHIPPINGOPTIONAMOUNT' . $default_shipping]; - - $order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost']; - - if ( DISPLAY_PRICE_WITH_TAX == 'false' ) { - $order->info['total'] += $order->info['tax']; - } - } - - if (!is_null($cheapest_rate)) { - $item_params['PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED'] = 'false'; - $item_params['L_SHIPPINGOPTIONISDEFAULT' . $cheapest_counter] = 'true'; - } - - if ( !empty($quotes_array) && (MODULE_PAYMENT_PAYPAL_EXPRESS_INSTANT_UPDATE == 'True') && ((MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER != 'Live') || ((MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') && (ENABLE_SSL == true))) ) { // Live server requires SSL to be enabled - $item_params['CALLBACK'] = tep_href_link('ext/modules/payment/paypal/express.php', 'osC_Action=callbackSet', 'SSL', false, false); - $item_params['CALLBACKTIMEOUT'] = '6'; - $item_params['CALLBACKVERSION'] = $paypal_express->api_version; - } - - include(DIR_WS_CLASSES . 'order_total.php'); - $order_total_modules = new order_total; - $order_totals = $order_total_modules->process(); - -// Remove shipping tax from total that was added again in ot_shipping - if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] = $order->info['shipping_cost'] / (1.0 + ($quotes_array[$default_shipping]['tax'] / 100)); - $module = substr($shipping['id'], 0, strpos($shipping['id'], '_')); - $order->info['tax'] -= tep_calculate_tax($order->info['shipping_cost'], $quotes_array[$default_shipping]['tax']); - $order->info['tax_groups'][tep_get_tax_description($module->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id'])] -= tep_calculate_tax($order->info['shipping_cost'], $quotes_array[$default_shipping]['tax']); - $order->info['total'] -= tep_calculate_tax($order->info['shipping_cost'], $quotes_array[$default_shipping]['tax']); - - $items_total = $paypal_express->format_raw($order->info['subtotal']); - - foreach ($order_totals as $ot) { - if ( !in_array($ot['code'], array('ot_subtotal', 'ot_shipping', 'ot_tax', 'ot_total')) ) { - $item_params['L_PAYMENTREQUEST_0_NAME' . $line_item_no] = $ot['title']; - $item_params['L_PAYMENTREQUEST_0_AMT' . $line_item_no] = $paypal_express->format_raw($ot['value']); - - $items_total += $paypal_express->format_raw($ot['value']); - - $line_item_no++; - } - } - - $params['PAYMENTREQUEST_0_AMT'] = $paypal_express->format_raw($order->info['total']); - - $item_params['MAXAMT'] = $paypal_express->format_raw($params['PAYMENTREQUEST_0_AMT'] + $expensive_rate + 100, '', 1); // safely pad higher for dynamic shipping rates (eg, USPS express) - $item_params['PAYMENTREQUEST_0_ITEMAMT'] = $items_total; - $item_params['PAYMENTREQUEST_0_SHIPPINGAMT'] = $paypal_express->format_raw($order->info['shipping_cost']); - - $paypal_item_total = $item_params['PAYMENTREQUEST_0_ITEMAMT'] + $item_params['PAYMENTREQUEST_0_SHIPPINGAMT']; - - if ( DISPLAY_PRICE_WITH_TAX == 'false' ) { - $item_params['PAYMENTREQUEST_0_TAXAMT'] = $paypal_express->format_raw($order->info['tax']); - - $paypal_item_total += $item_params['PAYMENTREQUEST_0_TAXAMT']; - } - - if ( $paypal_express->format_raw($paypal_item_total) == $params['PAYMENTREQUEST_0_AMT'] ) { - $params = array_merge($params, $item_params); - } - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_PAGE_STYLE)) { - $params['PAGESTYLE'] = MODULE_PAYMENT_PAYPAL_EXPRESS_PAGE_STYLE; - } - - $ppe_secret = tep_create_random_value(16, 'digits'); - - if ( !tep_session_is_registered('ppe_secret') ) { - tep_session_register('ppe_secret'); - } - - $params['PAYMENTREQUEST_0_CUSTOM'] = $ppe_secret; - -// Log In with PayPal token for seamless checkout - if (tep_session_is_registered('paypal_login_access_token')) { - $params['IDENTITYACCESSTOKEN'] = $paypal_login_access_token; - } - - $response_array = $paypal_express->setExpressCheckout($params); - - if (($response_array['ACK'] == 'Success') || ($response_array['ACK'] == 'SuccessWithWarning')) { - tep_redirect($paypal_url . 'token=' . $response_array['TOKEN'] . '&useraction=commit'); - } else { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . stripslashes($response_array['L_LONGMESSAGE0']), 'SSL')); - } - - break; - } - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - - require(DIR_WS_INCLUDES . 'application_bottom.php'); -?> diff --git a/catalog/ext/modules/payment/paypal/express_payflow.php b/catalog/ext/modules/payment/paypal/express_payflow.php deleted file mode 100644 index e4121b9a3..000000000 --- a/catalog/ext/modules/payment/paypal/express_payflow.php +++ /dev/null @@ -1,619 +0,0 @@ -count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - -// initialize variables if the customer is not logged in - if (!tep_session_is_registered('customer_id')) { - $customer_id = 0; - $customer_default_address_id = 0; - } - - require(DIR_WS_LANGUAGES . $language . '/modules/payment/paypal_pro_payflow_ec.php'); - require('includes/modules/payment/paypal_pro_payflow_ec.php'); - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT); - - $paypal_pro_payflow_ec = new paypal_pro_payflow_ec(); - - if (!$paypal_pro_payflow_ec->check() || !$paypal_pro_payflow_ec->enabled) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - if ( !tep_session_is_registered('sendto') ) { - if ( tep_session_is_registered('customer_id') ) { - $sendto = $customer_default_address_id; - } else { - $country = tep_get_countries(STORE_COUNTRY, true); - - $sendto = array('firstname' => '', - 'lastname' => '', - 'company' => '', - 'street_address' => '', - 'suburb' => '', - 'postcode' => '', - 'city' => '', - 'zone_id' => STORE_ZONE, - 'zone_name' => tep_get_zone_name(STORE_COUNTRY, STORE_ZONE, ''), - 'country_id' => STORE_COUNTRY, - 'country_name' => $country['countries_name'], - 'country_iso_code_2' => $country['countries_iso_code_2'], - 'country_iso_code_3' => $country['countries_iso_code_3'], - 'address_format_id' => tep_get_address_format_id(STORE_COUNTRY)); - } - } - - if ( !tep_session_is_registered('billto') ) { - $billto = $sendto; - } - -// register a random ID in the session to check throughout the checkout procedure -// against alterations in the shopping cart contents - if (!tep_session_is_registered('cartID')) tep_session_register('cartID'); - $cartID = $cart->cartID; - - switch ($HTTP_GET_VARS['osC_Action']) { - case 'retrieve': - $response_array = $paypal_pro_payflow_ec->getExpressCheckoutDetails($HTTP_GET_VARS['token']); - - if ($response_array['RESULT'] == '0') { - if ( !tep_session_is_registered('ppeuk_secret') || ($response_array['CUSTOM'] != $ppeuk_secret) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - if (!tep_session_is_registered('payment')) tep_session_register('payment'); - $payment = $paypal_pro_payflow_ec->code; - - if (!tep_session_is_registered('ppeuk_token')) tep_session_register('ppeuk_token'); - $ppeuk_token = $response_array['TOKEN']; - - if (!tep_session_is_registered('ppeuk_payerid')) tep_session_register('ppeuk_payerid'); - $ppeuk_payerid = $response_array['PAYERID']; - - if (!tep_session_is_registered('ppeuk_payerstatus')) tep_session_register('ppeuk_payerstatus'); - $ppeuk_payerstatus = $response_array['PAYERSTATUS']; - - if (!tep_session_is_registered('ppeuk_addressstatus')) tep_session_register('ppeuk_addressstatus'); - $ppeuk_addressstatus = $response_array['ADDRESSSTATUS']; - - $force_login = false; - -// check if e-mail address exists in database and login or create customer account - if (!tep_session_is_registered('customer_id')) { - $force_login = true; - - $email_address = tep_db_prepare_input($response_array['EMAIL']); - - $check_query = tep_db_query("select * from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - -// Force the customer to log into their local account if payerstatus is unverified and a local password is set - if ( ($response_array['PAYERSTATUS'] == 'unverified') && !empty($check['customers_password']) ) { - $messageStack->add_session('login', MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_WARNING_LOCAL_LOGIN_REQUIRED, 'warning'); - - $navigation->set_snapshot(); - - $login_url = tep_href_link(FILENAME_LOGIN, '', 'SSL'); - $login_email_address = tep_output_string($response_array['EMAIL']); - - $output = << - - - -EOD; - - echo $output; - exit; - } else { - $customer_id = $check['customers_id']; - $customers_firstname = $check['customers_firstname']; - $customer_default_address_id = $check['customers_default_address_id']; - } - } else { - $customers_firstname = tep_db_prepare_input($response_array['FIRSTNAME']); - $customers_lastname = tep_db_prepare_input($response_array['LASTNAME']); - - $sql_data_array = array('customers_firstname' => $customers_firstname, - 'customers_lastname' => $customers_lastname, - 'customers_email_address' => $email_address, - 'customers_telephone' => '', - 'customers_fax' => '', - 'customers_newsletter' => '0', - 'customers_password' => ''); - - if (isset($response_array['PHONENUM']) && tep_not_null($response_array['PHONENUM'])) { - $customers_telephone = tep_db_prepare_input($response_array['PHONENUM']); - - $sql_data_array['customers_telephone'] = $customers_telephone; - } - - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); - - $customer_id = tep_db_insert_id(); - - tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); - -// Only generate a password and send an email if the Set Password Content Module is not enabled - if ( !defined('MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS') || (MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS != 'True') ) { - $customer_password = tep_create_random_value(max(ENTRY_PASSWORD_MIN_LENGTH, 8)); - - tep_db_perform(TABLE_CUSTOMERS, array('customers_password' => tep_encrypt_password($customer_password)), 'update', 'customers_id = "' . (int)$customer_id . '"'); - -// build the message content - $name = $customers_firstname . ' ' . $customers_lastname; - $email_text = sprintf(EMAIL_GREET_NONE, $customers_firstname) . EMAIL_WELCOME . sprintf(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_EMAIL_PASSWORD, $email_address, $customer_password) . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; - tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - - if (SESSION_RECREATE == 'True') { - tep_session_recreate(); - } - - $customer_first_name = $customers_firstname; - tep_session_register('customer_id'); - tep_session_register('customer_first_name'); - -// reset session token - $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); - } - -// check if paypal shipping address exists in the address book - $ship_firstname = tep_db_prepare_input(substr($response_array['SHIPTONAME'], 0, strpos($response_array['SHIPTONAME'], ' '))); - $ship_lastname = tep_db_prepare_input(substr($response_array['SHIPTONAME'], strpos($response_array['SHIPTONAME'], ' ')+1)); - $ship_address = tep_db_prepare_input($response_array['SHIPTOSTREET']); - $ship_city = tep_db_prepare_input($response_array['SHIPTOCITY']); - $ship_zone = tep_db_prepare_input($response_array['SHIPTOSTATE']); - $ship_zone_id = 0; - $ship_postcode = tep_db_prepare_input($response_array['SHIPTOZIP']); - $ship_country = tep_db_prepare_input($response_array['SHIPTOCOUNTRY']); - $ship_country_id = 0; - $ship_address_format_id = 1; - - $country_query = tep_db_query("select countries_id, address_format_id from " . TABLE_COUNTRIES . " where countries_iso_code_2 = '" . tep_db_input($ship_country) . "' limit 1"); - if (tep_db_num_rows($country_query)) { - $country = tep_db_fetch_array($country_query); - - $ship_country_id = $country['countries_id']; - $ship_address_format_id = $country['address_format_id']; - } - - if ($ship_country_id > 0) { - $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$ship_country_id . "' and (zone_name = '" . tep_db_input($ship_zone) . "' or zone_code = '" . tep_db_input($ship_zone) . "') limit 1"); - if (tep_db_num_rows($zone_query)) { - $zone = tep_db_fetch_array($zone_query); - - $ship_zone_id = $zone['zone_id']; - } - } - - $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - - $sendto = $check['address_book_id']; - } else { - $sql_data_array = array('customers_id' => $customer_id, - 'entry_firstname' => $ship_firstname, - 'entry_lastname' => $ship_lastname, - 'entry_street_address' => $ship_address, - 'entry_postcode' => $ship_postcode, - 'entry_city' => $ship_city, - 'entry_country_id' => $ship_country_id); - - if (ACCOUNT_STATE == 'true') { - if ($ship_zone_id > 0) { - $sql_data_array['entry_zone_id'] = $ship_zone_id; - $sql_data_array['entry_state'] = ''; - } else { - $sql_data_array['entry_zone_id'] = '0'; - $sql_data_array['entry_state'] = $ship_zone; - } - } - - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); - - $address_id = tep_db_insert_id(); - - $sendto = $address_id; - - if ($customer_default_address_id < 1) { - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); - $customer_default_address_id = $address_id; - } - } - - $billto = $sendto; - - if ( !tep_session_is_registered('sendto') ) { - tep_session_register('sendto'); - } - - if ( !tep_session_is_registered('billto') ) { - tep_session_register('billto'); - } - - if ($force_login == true) { - $customer_country_id = $ship_country_id; - $customer_zone_id = $ship_zone_id; - tep_session_register('customer_default_address_id'); - tep_session_register('customer_country_id'); - tep_session_register('customer_zone_id'); - } - - include(DIR_WS_CLASSES . 'order.php'); - $order = new order; - - if ($cart->get_content_type() != 'virtual') { - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); - -// load all enabled shipping modules - include(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping; - - $free_shipping = false; - - if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { - $pass = false; - - switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { - case 'national': - if ($order->delivery['country_id'] == STORE_COUNTRY) { - $pass = true; - } - break; - - case 'international': - if ($order->delivery['country_id'] != STORE_COUNTRY) { - $pass = true; - } - break; - - case 'both': - $pass = true; - break; - } - - if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { - $free_shipping = true; - - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); - } - } - - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - $shipping = false; - - if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { - if ($free_shipping == true) { - $shipping = 'free_free'; - } else { -// get all available shipping quotes - $quotes = $shipping_modules->quote(); - -// select cheapest shipping method - $shipping = $shipping_modules->cheapest(); - $shipping = $shipping['id']; - } - } else { - if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) { - tep_session_unregister('shipping'); - - $messageStack->add_session('checkout_address', MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS, 'error'); - - tep_session_register('ppecuk_right_turn'); - $ppecuk_right_turn = true; - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); - } - } - - if (strpos($shipping, '_')) { - list($module, $method) = explode('_', $shipping); - - if ( is_object($$module) || ($shipping == 'free_free') ) { - if ($shipping == 'free_free') { - $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE; - $quote[0]['methods'][0]['cost'] = '0'; - } else { - $quote = $shipping_modules->quote($method, $module); - } - - if (isset($quote['error'])) { - tep_session_unregister('shipping'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); - } else { - if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) { - $shipping = array('id' => $shipping, - 'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'), - 'cost' => $quote[0]['methods'][0]['cost']); - } - } - } - } - } else { - if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); - $shipping = false; - - $sendto = false; - } - -/* useraction=commit tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')); */ - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL')); - } else { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode($response_array['OSCOM_ERROR_MESSAGE']), 'SSL')); - } - - break; - - default: - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Live') { - $paypal_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout'; - } else { - $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout'; - } - - include(DIR_WS_CLASSES . 'order.php'); - $order = new order; - - $params = array('CURRENCY' => $order->info['currency'], - 'EMAIL' => $order->customer['email_address'], - 'ALLOWNOTE' => '0'); - -// A billing address is required for digital orders so we use the shipping address PayPal provides -// if ($order->content_type == 'virtual') { -// $params['NOSHIPPING'] = '1'; -// } - - $item_params = array(); - - $line_item_no = 0; - - foreach ($order->products as $product) { - if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { - $product_price = $paypal_pro_payflow_ec->format_raw($product['final_price'] + tep_calculate_tax($product['final_price'], $product['tax'])); - } else { - $product_price = $paypal_pro_payflow_ec->format_raw($product['final_price']); - } - - $item_params['L_NAME' . $line_item_no] = $product['name']; - $item_params['L_COST' . $line_item_no] = $product_price; - $item_params['L_QTY' . $line_item_no] = $product['qty']; - - $line_item_no++; - } - - $params['BILLTOFIRSTNAME'] = $order->billing['firstname']; - $params['BILLTOLASTNAME'] = $order->billing['lastname']; - $params['BILLTOSTREET'] = $order->billing['street_address']; - $params['BILLTOCITY'] = $order->billing['city']; - $params['BILLTOSTATE'] = tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']); - $params['BILLTOCOUNTRY'] = $order->billing['country']['iso_code_2']; - $params['BILLTOZIP'] = $order->billing['postcode']; - - if (tep_not_null($order->delivery['street_address'])) { - $params['SHIPTONAME'] = $order->delivery['firstname'] . ' ' . $order->delivery['lastname']; - $params['SHIPTOSTREET'] = $order->delivery['street_address']; - $params['SHIPTOCITY'] = $order->delivery['city']; - $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['SHIPTOCOUNTRY'] = $order->delivery['country']['iso_code_2']; - $params['SHIPTOZIP'] = $order->delivery['postcode']; - } - - if ($cart->get_content_type() != 'virtual') { - $total_weight = $cart->show_weight(); - $total_count = $cart->count_contents(); - -// load all enabled shipping modules - include(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping; - - $free_shipping = false; - - if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) { - $pass = false; - - switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) { - case 'national': - if ($order->delivery['country_id'] == STORE_COUNTRY) { - $pass = true; - } - break; - - case 'international': - if ($order->delivery['country_id'] != STORE_COUNTRY) { - $pass = true; - } - break; - - case 'both': - $pass = true; - break; - } - - if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) { - $free_shipping = true; - - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php'); - } - } - - if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { - if ($free_shipping == true) { - $quotes_array[] = array('id' => 'free_free', - 'name' => FREE_SHIPPING_TITLE, - 'label' => '', - 'cost' => '0.00', - 'tax' => '0'); - } else { -// get all available shipping quotes - $quotes = $shipping_modules->quote(); - - foreach ($quotes as $quote) { - if (!isset($quote['error'])) { - foreach ($quote['methods'] as $rate) { - $quotes_array[] = array('id' => $quote['id'] . '_' . $rate['id'], - 'name' => $quote['module'], - 'label' => $rate['title'], - 'cost' => $rate['cost'], - 'tax' => $quote['tax']); - } - } - } - } - } else { - if ( defined('SHIPPING_ALLOW_UNDEFINED_ZONES') && (SHIPPING_ALLOW_UNDEFINED_ZONES == 'False') ) { - tep_session_unregister('shipping'); - - $messageStack->add_session('checkout_address', MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_NO_SHIPPING_AVAILABLE_TO_SHIPPING_ADDRESS); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL')); - } - } - } - - $counter = 0; - $cheapest_rate = null; - $expensive_rate = 0; - $cheapest_counter = $counter; - $default_shipping = null; - - foreach ($quotes_array as $quote) { - $shipping_rate = $paypal_pro_payflow_ec->format_raw($quote['cost'] + tep_calculate_tax($quote['cost'], $quote['tax'])); - - if (is_null($cheapest_rate) || ($shipping_rate < $cheapest_rate)) { - $cheapest_rate = $shipping_rate; - $cheapest_counter = $counter; - } - - if ($shipping_rate > $expensive_rate) { - $expensive_rate = $shipping_rate; - } - - if (tep_session_is_registered('shipping') && ($shipping['id'] == $quote['id'])) { - $default_shipping = $counter; - } - - $counter++; - } - - if (!is_null($default_shipping)) { - $cheapest_counter = $default_shipping; - } else { - if ( !empty($quotes_array) ) { - $shipping = array('id' => $quotes_array[$cheapest_counter]['id'], - 'title' => trim($quotes_array[$cheapest_counter]['name'] . ' ' . $quotes_array[$cheapest_counter]['label']), - 'cost' => $paypal_pro_payflow_ec->format_raw($quotes_array[$cheapest_counter]['cost'])); - - $default_shipping = $cheapest_counter; - } else { - $shipping = false; - } - - if ( !tep_session_is_registered('shipping') ) { - tep_session_register('shipping'); - } - } - -// set shipping for order total calculations; shipping in $item_params includes taxes - if (!is_null($default_shipping)) { - $order->info['shipping_method'] = trim($quotes_array[$default_shipping]['name'] . ' ' . $quotes_array[$default_shipping]['label']); - $order->info['shipping_cost'] = $paypal_pro_payflow_ec->format_raw($quotes_array[$default_shipping]['cost'] + tep_calculate_tax($quotes_array[$default_shipping]['cost'], $quotes_array[$default_shipping]['tax'])); - - $order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost']; - - if ( DISPLAY_PRICE_WITH_TAX == 'false' ) { - $order->info['total'] += $order->info['tax']; - } - } - - include(DIR_WS_CLASSES . 'order_total.php'); - $order_total_modules = new order_total; - $order_totals = $order_total_modules->process(); - -// Remove shipping tax from total that was added again in ot_shipping - if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] = $order->info['shipping_cost'] / (1.0 + ($quotes_array[$default_shipping]['tax'] / 100)); - $module = substr($shipping['id'], 0, strpos($shipping['id'], '_')); - $order->info['tax'] -= tep_calculate_tax($order->info['shipping_cost'], $quotes_array[$default_shipping]['tax']); - $order->info['tax_groups'][tep_get_tax_description($module->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id'])] -= tep_calculate_tax($order->info['shipping_cost'], $quotes_array[$default_shipping]['tax']); - $order->info['total'] -= tep_calculate_tax($order->info['shipping_cost'], $quotes_array[$default_shipping]['tax']); - - $items_total = $paypal_pro_payflow_ec->format_raw($order->info['subtotal']); - - foreach ($order_totals as $ot) { - if ( !in_array($ot['code'], array('ot_subtotal', 'ot_shipping', 'ot_tax', 'ot_total')) ) { - $item_params['L_NAME' . $line_item_no] = $ot['title']; - $item_params['L_COST' . $line_item_no] = $paypal_pro_payflow_ec->format_raw($ot['value']); - $item_params['L_QTY' . $line_item_no] = 1; - - $items_total += $paypal_pro_payflow_ec->format_raw($ot['value']); - - $line_item_no++; - } - } - - $params['AMT'] = $paypal_pro_payflow_ec->format_raw($order->info['total']); - - $item_params['MAXAMT'] = $paypal_pro_payflow_ec->format_raw($params['AMT'] + $expensive_rate + 100, '', 1); // safely pad higher for dynamic shipping rates (eg, USPS express) - $item_params['ITEMAMT'] = $items_total; - $item_params['FREIGHTAMT'] = $paypal_pro_payflow_ec->format_raw($order->info['shipping_cost']); - - $paypal_item_total = $item_params['ITEMAMT'] + $item_params['FREIGHTAMT']; - - if ( DISPLAY_PRICE_WITH_TAX == 'false' ) { - $item_params['TAXAMT'] = $paypal_pro_payflow_ec->format_raw($order->info['tax']); - - $paypal_item_total += $item_params['TAXAMT']; - } - - if ( $paypal_pro_payflow_ec->format_raw($paypal_item_total) == $params['AMT'] ) { - $params = array_merge($params, $item_params); - } - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PAGE_STYLE)) { - $params['PAGESTYLE'] = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PAGE_STYLE; - } - - $ppeuk_secret = tep_create_random_value(16, 'digits'); - - if ( !tep_session_is_registered('ppeuk_secret') ) { - tep_session_register('ppeuk_secret'); - } - - $params['CUSTOM'] = $ppeuk_secret; - - $response_array = $paypal_pro_payflow_ec->setExpressCheckout($params); - - if ($response_array['RESULT'] == '0') { - tep_redirect($paypal_url . '&token=' . $response_array['TOKEN'] /*. '&useraction=commit'*/); - } else { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode($response_array['OSCOM_ERROR_MESSAGE']), 'SSL')); - } - - break; - } - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - - require(DIR_WS_INCLUDES . 'application_bottom.php'); -?> diff --git a/catalog/ext/modules/payment/paypal/hosted_checkout.php b/catalog/ext/modules/payment/paypal/hosted_checkout.php deleted file mode 100644 index 5050ef3e1..000000000 --- a/catalog/ext/modules/payment/paypal/hosted_checkout.php +++ /dev/null @@ -1,73 +0,0 @@ - - -> - - -<?php echo tep_output_string_protected(TITLE); ?> - - - - -
      - -
      - -
      > - -
      - - - - - - - diff --git a/catalog/ext/modules/payment/paypal/images/hss_load.gif b/catalog/ext/modules/payment/paypal/images/hss_load.gif deleted file mode 100644 index c97ec6ea9..000000000 Binary files a/catalog/ext/modules/payment/paypal/images/hss_load.gif and /dev/null differ diff --git a/catalog/ext/modules/payment/paypal/paypal.com.crt b/catalog/ext/modules/payment/paypal/paypal.com.crt deleted file mode 100644 index 1202c2039..000000000 --- a/catalog/ext/modules/payment/paypal/paypal.com.crt +++ /dev/null @@ -1,171 +0,0 @@ -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA -TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah -WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf -Tqj/ZA1k ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO -FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 -lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB -MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT -1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD -Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 ------END CERTIFICATE----- - - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 -EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc -cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw -EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj -055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f -j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 -xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa -t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS -tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM -8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW -Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX -Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt -mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd -RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG -UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- -VeriSign Class 3 Public Primary Certification Authority - G5 -============================================================ ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln -biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh -dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz -j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD -Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ -Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r -fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ -BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv -Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG -SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ -X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE -KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC -Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE -ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- -VeriSign Universal Root Certification Authority -=============================================== ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u -IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj -1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP -MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 -9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I -AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR -tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G -CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O -a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 -Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx -Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx -P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P -wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 -mJO37M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G4 -============================================================ ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC -VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 -b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz -ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU -cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo -b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 -Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz -rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw -HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u -Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD -A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx -AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky -CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX -bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ -D/xwzoiQ ------END CERTIFICATE----- diff --git a/catalog/ext/modules/payment/paypal/pro_hosted_ipn.php b/catalog/ext/modules/payment/paypal/pro_hosted_ipn.php deleted file mode 100644 index b70d0e477..000000000 --- a/catalog/ext/modules/payment/paypal/pro_hosted_ipn.php +++ /dev/null @@ -1,38 +0,0 @@ -getTransactionDetails($HTTP_POST_VARS['txn_id']); - } - - if ( is_array($result) && isset($result['ACK']) && (($result['ACK'] == 'Success') || ($result['ACK'] == 'SuccessWithWarning')) ) { - $pphs_result = $result; - - $paypal_pro_hs->verifyTransaction(true); - } - - require('includes/application_bottom.php'); -?> diff --git a/catalog/ext/modules/payment/paypal/standard_ipn.php b/catalog/ext/modules/payment/paypal/standard_ipn.php deleted file mode 100755 index 0531c65fa..000000000 --- a/catalog/ext/modules/payment/paypal/standard_ipn.php +++ /dev/null @@ -1,46 +0,0 @@ - $value) { - $parameters .= '&' . $key . '=' . urlencode(stripslashes($value)); - } - - $result = $paypal_standard->sendTransactionToGateway($paypal_standard->form_action_url, $parameters); - } - - if ( $result == 'VERIFIED' ) { - $paypal_standard->verifyTransaction(true); - } else { - $paypal_standard->sendDebugEmail($result, true); - } - - tep_session_destroy(); - - require('includes/application_bottom.php'); -?> diff --git a/catalog/ext/modules/payment/rbsworldpay/hosted_callback.php b/catalog/ext/modules/payment/rbsworldpay/hosted_callback.php deleted file mode 100644 index a9caf011a..000000000 --- a/catalog/ext/modules/payment/rbsworldpay/hosted_callback.php +++ /dev/null @@ -1,109 +0,0 @@ -sendDebugEmail(); - - exit; - } - - $order = tep_db_fetch_array($order_query); - - if ($order['orders_status'] == MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID) { - $order_status_id = (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID); - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$order['orders_id'] . "'"); - - $sql_data_array = array('orders_id' => $order['orders_id'], - 'orders_status_id' => $order_status_id, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => ''); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - - $trans_result = 'WorldPay: Transaction Verified (Callback)' . "\n" . - 'Transaction ID: ' . $HTTP_POST_VARS['transId']; - - if (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE == 'True') { - $trans_result .= "\n" . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TEXT_WARNING_DEMO_MODE; - } - - $sql_data_array = array('orders_id' => $order['orders_id'], - 'orders_status_id' => MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $trans_result); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); -?> - -> - - -<?php echo tep_output_string_protected(TITLE); ?> - - - -

      - -

      - -
      -

      -
      - -

       

      - - - - - - - diff --git a/catalog/ext/modules/payment/sage_pay/checkout.php b/catalog/ext/modules/payment/sage_pay/checkout.php index 159625e71..7342571bf 100644 --- a/catalog/ext/modules/payment/sage_pay/checkout.php +++ b/catalog/ext/modules/payment/sage_pay/checkout.php @@ -5,52 +5,55 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTTP; + use OSC\OM\OSCOM; + chdir('../../../../'); require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => 'checkout_payment.php')); + OSCOM::redirect('login.php', '', 'SSL'); } // if there is nothing in the customers cart, redirect them to the shopping cart page - if ($cart->count_contents() < 1) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + if ($_SESSION['cart']->count_contents() < 1) { + OSCOM::redirect('shopping_cart.php'); } // avoid hack attempts during the checkout procedure by checking the internal cartID - if (isset($cart->cartID) && tep_session_is_registered('cartID')) { - if ($cart->cartID != $cartID) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) { + if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } } // if no shipping method has been selected, redirect the customer to the shipping method selection page - if (!tep_session_is_registered('shipping')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + if (!isset($_SESSION['shipping'])) { + OSCOM::redirect('checkout_shipping.php', '', 'SSL'); } - if (!tep_session_is_registered('payment') || (($payment != 'sage_pay_direct') && ($payment != 'sage_pay_server')) || (($payment == 'sage_pay_server') && !tep_session_is_registered('sage_pay_server_nexturl'))) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + if (!isset($_SESSION['payment']) || (($_SESSION['payment'] != 'sage_pay_direct') && ($_SESSION['payment'] != 'sage_pay_server')) || (($_SESSION['payment'] == 'sage_pay_server') && !isset($_SESSION['sage_pay_server_nexturl']))) { + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } // load the selected payment module require(DIR_WS_CLASSES . 'payment.php'); - $payment_modules = new payment($payment); + $payment_modules = new payment($_SESSION['payment']); require(DIR_WS_CLASSES . 'order.php'); $order = new order; $payment_modules->update_status(); - if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); + if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$_SESSION['payment']) ) || (is_object($$_SESSION['payment']) && ($$_SESSION['payment']->enabled == false)) ) { + OSCOM::redirect('checkout_payment.php', 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'); } if (is_array($payment_modules->modules)) { @@ -59,7 +62,7 @@ // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); - $shipping_modules = new shipping($shipping); + $shipping_modules = new shipping($_SESSION['shipping']); require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; @@ -75,26 +78,26 @@ } // Out of Stock if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); + OSCOM::redirect('shopping_cart.php'); } } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_confirmation.php'); - $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); + $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_shipping.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2); - if ($payment == 'sage_pay_direct') { - $iframe_url = tep_href_link('ext/modules/payment/sage_pay/direct_3dauth.php', '', 'SSL'); + if ($_SESSION['payment'] == 'sage_pay_direct') { + $iframe_url = OSCOM::link('ext/modules/payment/sage_pay/direct_3dauth.php', '', 'SSL'); } else { - $iframe_url = $sage_pay_server_nexturl; + $iframe_url = $_SESSION['sage_pay_server_nexturl']; } - if ( !file_exists(DIR_FS_CATALOG . DIR_WS_INCLUDES . 'template_top.php') ) { - tep_redirect($iframe_url); + if ( !file_exists(DIR_FS_CATALOG . 'includes/template_top.php') ) { + HTTP::redirect($iframe_url); } - include(DIR_WS_INCLUDES . 'template_top.php'); + include('includes/template_top.php'); ?> diff --git a/catalog/ext/modules/payment/sage_pay/direct_3dauth.php b/catalog/ext/modules/payment/sage_pay/direct_3dauth.php index bc2fe4ace..4a8f3fd7c 100644 --- a/catalog/ext/modules/payment/sage_pay/direct_3dauth.php +++ b/catalog/ext/modules/payment/sage_pay/direct_3dauth.php @@ -5,30 +5,32 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2009 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + chdir('../../../../'); require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => 'checkout_payment.php')); + OSCOM::redirect('login.php', '', 'SSL'); } - if (!tep_session_is_registered('sage_pay_direct_acsurl')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + if (!isset($_SESSION['sage_pay_direct_acsurl'])) { + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } - if (!tep_session_is_registered('payment') || ($payment != 'sage_pay_direct')) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); + if (!isset($_SESSION['payment']) || ($_SESSION['payment'] != 'sage_pay_direct')) { + OSCOM::redirect('checkout_payment.php', '', 'SSL'); } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION); - require(DIR_WS_LANGUAGES . $language . '/modules/payment/sage_pay_direct.php'); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_confirmation.php'); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/sage_pay_direct.php'); ?> > @@ -39,16 +41,16 @@ -
      - - - + + + + - - + diff --git a/catalog/ext/modules/payment/sage_pay/errors.php b/catalog/ext/modules/payment/sage_pay/errors.php index e43b70cc7..bfb9ab3cb 100644 --- a/catalog/ext/modules/payment/sage_pay/errors.php +++ b/catalog/ext/modules/payment/sage_pay/errors.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ diff --git a/catalog/ext/modules/payment/sage_pay/redirect.php b/catalog/ext/modules/payment/sage_pay/redirect.php index d041e73e5..a3790ebec 100644 --- a/catalog/ext/modules/payment/sage_pay/redirect.php +++ b/catalog/ext/modules/payment/sage_pay/redirect.php @@ -5,34 +5,37 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2009 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + chdir('../../../../'); require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page - if (!tep_session_is_registered('customer_id')) { - $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + if (!isset($_SESSION['customer_id'])) { + $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => 'checkout_payment.php')); + OSCOM::redirect('login.php', '', 'SSL'); } - if ( isset($HTTP_GET_VARS['payment_error']) && tep_not_null($HTTP_GET_VARS['payment_error']) ) { - $redirect_url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $HTTP_GET_VARS['payment_error'] . (isset($HTTP_GET_VARS['error']) && tep_not_null($HTTP_GET_VARS['error']) ? '&error=' . $HTTP_GET_VARS['error'] : ''), 'SSL'); + if ( isset($_GET['payment_error']) && tep_not_null($_GET['payment_error']) ) { + $redirect_url = OSCOM::link('checkout_payment.php', 'payment_error=' . $_GET['payment_error'] . (isset($_GET['error']) && tep_not_null($_GET['error']) ? '&error=' . $_GET['error'] : ''), 'SSL'); } else { $hidden_params = ''; - if ($payment == 'sage_pay_direct') { - $redirect_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, 'check=3D', 'SSL'); - $hidden_params = tep_draw_hidden_field('MD', $HTTP_POST_VARS['MD']) . tep_draw_hidden_field('PaRes', $HTTP_POST_VARS['PaRes']); + if ($_SESSION['payment'] == 'sage_pay_direct') { + $redirect_url = OSCOM::link('checkout_process.php', 'check=3D', 'SSL'); + $hidden_params = HTML::hiddenField('MD', $_POST['MD']) . HTML::hiddenField('PaRes', $_POST['PaRes']); } else { - $redirect_url = tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'); + $redirect_url = OSCOM::link('checkout_success.php', '', 'SSL'); } } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_confirmation.php'); ?> > @@ -49,9 +52,9 @@

      - - + diff --git a/catalog/ext/modules/payment/sage_pay/server.php b/catalog/ext/modules/payment/sage_pay/server.php index bb931f91e..f70031949 100644 --- a/catalog/ext/modules/payment/sage_pay/server.php +++ b/catalog/ext/modules/payment/sage_pay/server.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + chdir('../../../../'); require('includes/application_top.php'); @@ -17,142 +20,141 @@ exit; } - include(DIR_WS_LANGUAGES . $language . '/modules/payment/sage_pay_server.php'); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/sage_pay_server.php'); include('includes/modules/payment/sage_pay_server.php'); $sage_pay_server = new sage_pay_server(); $result = null; - if ( isset($HTTP_GET_VARS['skcode']) && isset($HTTP_POST_VARS['VPSSignature']) && isset($HTTP_POST_VARS['VPSTxId']) && isset($HTTP_POST_VARS['VendorTxCode']) && isset($HTTP_POST_VARS['Status']) ) { - $skcode = tep_db_prepare_input($HTTP_GET_VARS['skcode']); + if ( isset($_GET['skcode']) && isset($_POST['VPSSignature']) && isset($_POST['VPSTxId']) && isset($_POST['VendorTxCode']) && isset($_POST['Status']) ) { + $skcode = HTML::sanitize($_GET['skcode']); - $sp_query = tep_db_query('select securitykey from sagepay_server_securitykeys where code = "' . tep_db_input($skcode) . '" limit 1'); - if ( tep_db_num_rows($sp_query) ) { - $sp = tep_db_fetch_array($sp_query); + $Qsp = $OSCOM_Db->get('sagepay_server_securitykeys', 'securitykey', ['code' => $skcode], null, 1); - $transaction_details = array('ID' => $HTTP_POST_VARS['VPSTxId']); + if ($Qsp->fetch() !== false) { + $transaction_details = array('ID' => $_POST['VPSTxId']); - $sig = $HTTP_POST_VARS['VPSTxId'] . $HTTP_POST_VARS['VendorTxCode'] . $HTTP_POST_VARS['Status']; + $sig = $_POST['VPSTxId'] . $_POST['VendorTxCode'] . $_POST['Status']; - if ( isset($HTTP_POST_VARS['TxAuthNo']) ) { - $sig .= $HTTP_POST_VARS['TxAuthNo']; + if ( isset($_POST['TxAuthNo']) ) { + $sig .= $_POST['TxAuthNo']; } $sig .= strtolower(substr(MODULE_PAYMENT_SAGE_PAY_SERVER_VENDOR_LOGIN_NAME, 0, 15)); - if ( isset($HTTP_POST_VARS['AVSCV2']) ) { - $sig .= $HTTP_POST_VARS['AVSCV2']; + if ( isset($_POST['AVSCV2']) ) { + $sig .= $_POST['AVSCV2']; - $transaction_details['AVS/CV2'] = $HTTP_POST_VARS['AVSCV2']; + $transaction_details['AVS/CV2'] = $_POST['AVSCV2']; } - $sig .= $sp['securitykey']; + $sig .= $Qsp->value('securitykey'); - if ( isset($HTTP_POST_VARS['AddressResult']) ) { - $sig .= $HTTP_POST_VARS['AddressResult']; + if ( isset($_POST['AddressResult']) ) { + $sig .= $_POST['AddressResult']; - $transaction_details['Address'] = $HTTP_POST_VARS['AddressResult']; + $transaction_details['Address'] = $_POST['AddressResult']; } - if ( isset($HTTP_POST_VARS['PostCodeResult']) ) { - $sig .= $HTTP_POST_VARS['PostCodeResult']; + if ( isset($_POST['PostCodeResult']) ) { + $sig .= $_POST['PostCodeResult']; - $transaction_details['Post Code'] = $HTTP_POST_VARS['PostCodeResult']; + $transaction_details['Post Code'] = $_POST['PostCodeResult']; } - if ( isset($HTTP_POST_VARS['CV2Result']) ) { - $sig .= $HTTP_POST_VARS['CV2Result']; + if ( isset($_POST['CV2Result']) ) { + $sig .= $_POST['CV2Result']; - $transaction_details['CV2'] = $HTTP_POST_VARS['CV2Result']; + $transaction_details['CV2'] = $_POST['CV2Result']; } - if ( isset($HTTP_POST_VARS['GiftAid']) ) { - $sig .= $HTTP_POST_VARS['GiftAid']; + if ( isset($_POST['GiftAid']) ) { + $sig .= $_POST['GiftAid']; } - if ( isset($HTTP_POST_VARS['3DSecureStatus']) ) { - $sig .= $HTTP_POST_VARS['3DSecureStatus']; + if ( isset($_POST['3DSecureStatus']) ) { + $sig .= $_POST['3DSecureStatus']; - $transaction_details['3D Secure'] = $HTTP_POST_VARS['3DSecureStatus']; + $transaction_details['3D Secure'] = $_POST['3DSecureStatus']; } - if ( isset($HTTP_POST_VARS['CAVV']) ) { - $sig .= $HTTP_POST_VARS['CAVV']; + if ( isset($_POST['CAVV']) ) { + $sig .= $_POST['CAVV']; } - if ( isset($HTTP_POST_VARS['AddressStatus']) ) { - $sig .= $HTTP_POST_VARS['AddressStatus']; + if ( isset($_POST['AddressStatus']) ) { + $sig .= $_POST['AddressStatus']; - $transaction_details['PayPal Payer Address'] = $HTTP_POST_VARS['AddressStatus']; + $transaction_details['PayPal Payer Address'] = $_POST['AddressStatus']; } - if ( isset($HTTP_POST_VARS['PayerStatus']) ) { - $sig .= $HTTP_POST_VARS['PayerStatus']; + if ( isset($_POST['PayerStatus']) ) { + $sig .= $_POST['PayerStatus']; - $transaction_details['PayPal Payer Status'] = $HTTP_POST_VARS['PayerStatus']; + $transaction_details['PayPal Payer Status'] = $_POST['PayerStatus']; } - if ( isset($HTTP_POST_VARS['CardType']) ) { - $sig .= $HTTP_POST_VARS['CardType']; + if ( isset($_POST['CardType']) ) { + $sig .= $_POST['CardType']; - $transaction_details['Card'] = $HTTP_POST_VARS['CardType']; + $transaction_details['Card'] = $_POST['CardType']; } - if ( isset($HTTP_POST_VARS['Last4Digits']) ) { - $sig .= $HTTP_POST_VARS['Last4Digits']; + if ( isset($_POST['Last4Digits']) ) { + $sig .= $_POST['Last4Digits']; } - if ( isset($HTTP_POST_VARS['DeclineCode']) ) { - $sig .= $HTTP_POST_VARS['DeclineCode']; + if ( isset($_POST['DeclineCode']) ) { + $sig .= $_POST['DeclineCode']; } - if ( isset($HTTP_POST_VARS['ExpiryDate']) ) { - $sig .= $HTTP_POST_VARS['ExpiryDate']; + if ( isset($_POST['ExpiryDate']) ) { + $sig .= $_POST['ExpiryDate']; } - if ( isset($HTTP_POST_VARS['FraudResponse']) ) { - $sig .= $HTTP_POST_VARS['FraudResponse']; + if ( isset($_POST['FraudResponse']) ) { + $sig .= $_POST['FraudResponse']; } - if ( isset($HTTP_POST_VARS['BankAuthCode']) ) { - $sig .= $HTTP_POST_VARS['BankAuthCode']; + if ( isset($_POST['BankAuthCode']) ) { + $sig .= $_POST['BankAuthCode']; } $sig = strtoupper(md5($sig)); - if ( $HTTP_POST_VARS['VPSSignature'] == $sig ) { - if ( ($HTTP_POST_VARS['Status'] == 'OK') || ($HTTP_POST_VARS['Status'] == 'AUTHENTICATED') || ($HTTP_POST_VARS['Status'] == 'REGISTERED') ) { + if ( $_POST['VPSSignature'] == $sig ) { + if ( ($_POST['Status'] == 'OK') || ($_POST['Status'] == 'AUTHENTICATED') || ($_POST['Status'] == 'REGISTERED') ) { $transaction_details_string = ''; foreach ( $transaction_details as $k => $v ) { $transaction_details_string .= $k . ': ' . $v . "\n"; } - $transaction_details_string = tep_db_prepare_input($transaction_details_string); + $transaction_details_string = HTML::sanitize($transaction_details_string); - tep_db_query('update sagepay_server_securitykeys set verified = 1, transaction_details = "' . tep_db_input($transaction_details_string) . '" where code = "' . tep_db_input($skcode) . '"'); + $OSCOM_Db->save('sagepay_server_securitykeys', ['verified' => 1, 'transaction_details' => $transaction_details_string], ['code' => $skcode]); $result = 'Status=OK' . chr(13) . chr(10) . - 'RedirectURL=' . $sage_pay_server->formatURL(tep_href_link(FILENAME_CHECKOUT_PROCESS, 'check=PROCESS&skcode=' . $skcode, 'SSL', false)); + 'RedirectURL=' . $sage_pay_server->formatURL(OSCOM::link('checkout_process.php', 'check=PROCESS&skcode=' . $skcode, 'SSL', false)); } else { - $error = isset($HTTP_POST_VARS['StatusDetail']) ? $sage_pay_server->getErrorMessageNumber($HTTP_POST_VARS['StatusDetail']) : null; + $error = isset($_POST['StatusDetail']) ? $sage_pay_server->getErrorMessageNumber($_POST['StatusDetail']) : null; if ( MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE == 'Normal' ) { - $error_url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $sage_pay_server->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL', false); + $error_url = OSCOM::link('checkout_payment.php', 'payment_error=' . $sage_pay_server->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL', false); } else { - $error_url = tep_href_link('ext/modules/payment/sage_pay/redirect.php', 'payment_error=' . $sage_pay_server->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL', false); + $error_url = OSCOM::link('ext/modules/payment/sage_pay/redirect.php', 'payment_error=' . $sage_pay_server->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL', false); } $result = 'Status=OK' . chr(13) . chr(10) . 'RedirectURL=' . $sage_pay_server->formatURL($error_url); - tep_db_query('delete from sagepay_server_securitykeys where code = "' . tep_db_input($skcode) . '"'); + $OSCOM_Db->delete('sagepay_server_securitykeys', ['code' => $skcode]); $sage_pay_server->sendDebugEmail(); } } else { $result = 'Status=INVALID' . chr(13) . chr(10) . - 'RedirectURL=' . $sage_pay_server->formatURL(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL', false)); + 'RedirectURL=' . $sage_pay_server->formatURL(OSCOM::link('shopping_cart.php', '', 'SSL', false)); $sage_pay_server->sendDebugEmail(); } @@ -161,7 +163,7 @@ if ( !isset($result) ) { $result = 'Status=ERROR' . chr(13) . chr(10) . - 'RedirectURL=' . $sage_pay_server->formatURL(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL', false)); + 'RedirectURL=' . $sage_pay_server->formatURL(OSCOM::link('shopping_cart.php', '', 'SSL', false)); } echo $result; diff --git a/catalog/ext/modules/payment/sofortueberweisung/callback.php b/catalog/ext/modules/payment/sofortueberweisung/callback.php deleted file mode 100755 index a0d3a6b07..000000000 --- a/catalog/ext/modules/payment/sofortueberweisung/callback.php +++ /dev/null @@ -1,99 +0,0 @@ - 0) { - $order = tep_db_fetch_array($order_query); - - if ($order['orders_status'] == MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID) { - $total_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$kunden_var_0 . "' and class = 'ot_total' limit 1"); - $total = tep_db_fetch_array($total_query); - - $order_total_integer = number_format($total['value'] * $currencies->get_value('EUR'), 2, '.','')*100; - if ($order_total_integer < 1) { - $order_total_integer = '000'; - } elseif ($order_total_integer < 10) { - $order_total_integer = '00' . $order_total_integer; - } elseif ($order_total_integer < 100) { - $order_total_integer = '0' . $order_total_integer; - } - - if ((int)$betrag_integer == (int)$order_total_integer) { - $comment = 'Zahlung durch Sofortüberweisung Benachrichtigung bestätigt!'; - } else { - $comment = "Sofortüberweisungs Transaktionscheck fehlgeschlagen. Bitte manuell überprüfen\n" . ($betrag_integer/100) . '!=' . ($order_total_integer/100); - } - - if (MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STORE_TRANSACTION_DETAILS == 'True') { - $comment .= "\n" . serialize($HTTP_GET_VARS) . "\n" . serialize($HTTP_POST_VARS); - } - - $order_status = (MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID); - - $sql_data_array = array('orders_id' => (int)$kunden_var_0, - 'orders_status_id' => $order_status, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $comment); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status . "', last_modified = now() where orders_id = '" . (int)$kunden_var_0 . "'"); - } - } -?> diff --git a/catalog/ext/modules/payment/sofortueberweisung/images/sofortueberweisung.gif b/catalog/ext/modules/payment/sofortueberweisung/images/sofortueberweisung.gif deleted file mode 100755 index 88739e02b..000000000 Binary files a/catalog/ext/modules/payment/sofortueberweisung/images/sofortueberweisung.gif and /dev/null differ diff --git a/catalog/ext/photoset-grid/jquery.photoset-grid.min.js b/catalog/ext/photoset-grid/jquery.photoset-grid.min.js index 607a1920b..1c845e607 100644 --- a/catalog/ext/photoset-grid/jquery.photoset-grid.min.js +++ b/catalog/ext/photoset-grid/jquery.photoset-grid.min.js @@ -1,9 +1,9 @@ /** - * photoset-grid - v1.0.0 - * 2013-03-07 + * photoset-grid - v1.0.1 + * 2014-04-08 * jQuery plugin to arrange images into a flexible grid * http://stylehatch.github.com/photoset-grid/ * - * Copyright 2013 Jonathan Moore - Style Hatch + * Copyright 2014 Jonathan Moore - Style Hatch */ -(function(t,i,s,e){"use strict";function o(i,s){this.element=i,this.options=t.extend({},a,s),this._defaults=a,this._name=n,this.init()}var n="photosetGrid",a={width:"100%",gutter:"0px",highresLinks:!1,lowresWidth:500,rel:"",onInit:function(){},onComplete:function(){}};o.prototype={init:function(){this.options.onInit(),this._setupRows(this.element,this.options),this._setupColumns(this.element,this.options)},_callback:function(){this.options.onComplete()},_setupRows:function(i,s){if(s.layout)this.layout=s.layout;else if(t(i).attr("data-layout"))this.layout=t(i).attr("data-layout");else{for(var e="",o=1,n=0;t(i).find("img").length>n;n++)e+=""+o;this.layout=e}this.rows=this.layout.split("");for(var a in this.rows)this.rows[a]=parseInt(this.rows[a],10);var h=t(i).find("img"),r=0;t.each(this.rows,function(t,i){var s=r,e=r+i;h.slice(s,e).wrapAll('
      '),r=e}),t(i).find(".photoset-row:not(:last-child)").css({"margin-bottom":s.gutter})},_setupColumns:function(s,e){var o=this,n=function(){function o(){var i=""+t(s).width();i!==t(s).attr("data-width")&&(n.each(function(){var i=t(this).find("img:eq(0)");t(this).find("img").each(function(){var s=t(this);s.height()e.lowresWidth&&s.attr("data-highres")&&s.attr("src",s.attr("data-highres"))});var s=i.height(),o=Math.floor(.025*s);t(this).height(s-o),t(this).find("img").each(function(){var i=.5*(s-t(this).height())+"px";t(this).css({"margin-top":i})})}),t(s).attr("data-width",i))}var n=t(s).find(".photoset-row"),a=t(s).find("img");e.highresLinks?(a.each(function(){var i;i=t(this).attr("data-highres")?t(this).attr("data-highres"):t(this).attr("src"),t(this).wrapAll('')}),e.rel&&a.parent().attr("rel",e.rel)):a.each(function(){t(this).wrapAll('
      ')});var h=t(s).find(".photoset-cell"),r=t(s).find(".cols-1 .photoset-cell"),l=t(s).find(".cols-2 .photoset-cell"),c=t(s).find(".cols-3 .photoset-cell"),d=t(s).find(".cols-4 .photoset-cell"),f=t(s).find(".cols-5 .photoset-cell");t(s).css({width:e.width}),n.css({clear:"left",display:"block",overflow:"hidden"}),h.css({"float":"left",display:"block","line-height":"0","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),a.css({width:"100%",height:"auto"}),r.css({width:"100%"}),l.css({width:"50%"}),c.css({width:"33.3%"}),d.css({width:"25%"}),f.css({width:"20%"});var u=parseInt(e.gutter,10);t(s).find(".photoset-cell:not(:last-child)").css({"padding-right":u/2+"px"}),t(s).find(".photoset-cell:not(:first-child)").css({"padding-left":u/2+"px"}),o(),t(i).on("resize",function(){o()})};t(s).imagesLoaded(function(){n(),o._callback()})}},t.fn[n]=function(i){return this.each(function(){t.data(this,"plugin_"+n)||t.data(this,"plugin_"+n,new o(this,i))})};var h="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(i){function s(){var s=t(f),e=t(u);r&&(u.length?r.reject(c,s,e):r.resolve(c)),t.isFunction(i)&&i.call(a,c,s,e)}function o(t){n(t.target,"error"===t.type)}function n(i,e){i.src!==h&&-1===t.inArray(i,d)&&(d.push(i),e?u.push(i):f.push(i),t.data(i,"imagesLoaded",{isBroken:e,src:i.src}),l&&r.notifyWith(t(i),[e,c,t(f),t(u)]),c.length===d.length&&(setTimeout(s),c.unbind(".imagesLoaded",o)))}var a=this,r=t.isFunction(t.Deferred)?t.Deferred():0,l=t.isFunction(r.notify),c=a.find("img").add(a.filter("img")),d=[],f=[],u=[];return t.isPlainObject(i)&&t.each(i,function(t,s){"callback"===t?i=s:r&&r[t](s)}),c.length?c.bind("load.imagesLoaded error.imagesLoaded",o).each(function(i,s){var o=s.src,a=t.data(s,"imagesLoaded");return a&&a.src===o?(n(s,a.isBroken),e):s.complete&&s.naturalWidth!==e?(n(s,0===s.naturalWidth||0===s.naturalHeight),e):((s.readyState||s.complete)&&(s.src=h,s.src=o),e)}):s(),r?r.promise(a):a};var r,l,c,d=t.event,f={_:0},u=0;r=d.special.throttledresize={setup:function(){t(this).on("resize",r.handler)},teardown:function(){t(this).off("resize",r.handler)},handler:function(i,s){var e=this,o=arguments;l=!0,c||(setInterval(function(){u++,(u>r.threshold&&l||s)&&(i.type="throttledresize",d.dispatch.apply(e,o),l=!1,u=0),u>9&&(t(f).stop(),c=!1,u=0)},30),c=!0)},threshold:0}})(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){"use strict";function e(b,c){this.element=b,this.options=a.extend({},g,c),this._defaults=g,this._name=f,this.init()}var f="photosetGrid",g={width:"100%",gutter:"0px",highresLinks:!1,lowresWidth:500,rel:"",onInit:function(){},onComplete:function(){}};e.prototype={init:function(){this.options.onInit(),this._setupRows(this.element,this.options),this._setupColumns(this.element,this.options)},_callback:function(a){this.options.onComplete(a)},_setupRows:function(b,c){if(c.layout)this.layout=c.layout;else if(a(b).attr("data-layout"))this.layout=a(b).attr("data-layout");else{for(var d="",e=1,f=0;f
      '),i=d}),a(b).find(".photoset-row:not(:last-child)").css({"margin-bottom":c.gutter})},_setupColumns:function(c,d){var e=this,f=function(e){function f(){var b=a(c).width().toString();b!==a(c).attr("data-width")&&(g.each(function(){var b=a(this).find("img:eq(0)");a(this).find("img").each(function(){var c=a(this);c.attr("height")d.lowresWidth&&c.attr("data-highres")&&c.attr("src",c.attr("data-highres"))});var c=b.attr("height")*parseInt(b.css("width"),10)/b.attr("width"),e=Math.floor(.025*c);a(this).height(c-e),a(this).find("img").each(function(){var b=a(this).attr("height")*parseInt(a(this).css("width"),10)/a(this).attr("width"),d=.5*(c-b)+"px";a(this).css({"margin-top":d})})}),a(c).attr("data-width",b))}var g=a(c).find(".photoset-row"),h=a(c).find("img");d.highresLinks?(h.each(function(){var b;b=a(this).attr(a(this).attr("data-highres")?"data-highres":"src"),a(this).wrapAll('
      ')}),d.rel&&h.parent().attr("rel",d.rel)):h.each(function(){a(this).wrapAll('
      ')});var i=a(c).find(".photoset-cell"),j=a(c).find(".cols-1 .photoset-cell"),k=a(c).find(".cols-2 .photoset-cell"),l=a(c).find(".cols-3 .photoset-cell"),m=a(c).find(".cols-4 .photoset-cell"),n=a(c).find(".cols-5 .photoset-cell");a(c).css({width:d.width}),g.css({clear:"left",display:"block",overflow:"hidden"}),i.css({"float":"left",display:"block","line-height":"0","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),h.css({width:"100%",height:"auto"}),e&&h.each(function(){a(this).attr("height",a(this).height()),a(this).attr("width",a(this).width())}),j.css({width:"100%"}),k.css({width:"50%"}),l.css({width:"33.3%"}),m.css({width:"25%"}),n.css({width:"20%"});var o=parseInt(d.gutter,10);a(c).find(".photoset-cell:not(:last-child)").css({"padding-right":o/2+"px"}),a(c).find(".photoset-cell:not(:first-child)").css({"padding-left":o/2+"px"}),f(),a(b).on("resize",function(){f()})},g=!0,h=!0;a(c).find("img").each(function(){h&=!!a(this).attr("height")&!!a(this).attr("width")}),g=!h,g?a(c).imagesLoaded(function(){f(g),e._callback(c)}):(f(g),e._callback(c))}},a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})};var h="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";a.fn.imagesLoaded=function(b){function c(){var c=a(m),d=a(n);i&&(n.length?i.reject(k,c,d):i.resolve(k)),a.isFunction(b)&&b.call(g,k,c,d)}function e(a){f(a.target,"error"===a.type)}function f(b,d){b.src!==h&&-1===a.inArray(b,l)&&(l.push(b),d?n.push(b):m.push(b),a.data(b,"imagesLoaded",{isBroken:d,src:b.src}),j&&i.notifyWith(a(b),[d,k,a(m),a(n)]),k.length===l.length&&(setTimeout(c),k.unbind(".imagesLoaded",e)))}var g=this,i=a.isFunction(a.Deferred)?a.Deferred():0,j=a.isFunction(i.notify),k=g.find("img").add(g.filter("img")),l=[],m=[],n=[];return a.isPlainObject(b)&&a.each(b,function(a,c){"callback"===a?b=c:i&&i[a](c)}),k.length?k.bind("load.imagesLoaded error.imagesLoaded",e).each(function(b,c){var e=c.src,g=a.data(c,"imagesLoaded");return g&&g.src===e?void f(c,g.isBroken):c.complete&&c.naturalWidth!==d?void f(c,0===c.naturalWidth||0===c.naturalHeight):void((c.readyState||c.complete)&&(c.src=h,c.src=e))}):c(),i?i.promise(g):g};var i,j,k,l=a.event,m={_:0},n=0;i=l.special.throttledresize={setup:function(){a(this).on("resize",i.handler)},teardown:function(){a(this).off("resize",i.handler)},handler:function(b,c){var d=this,e=arguments;j=!0,k||(setInterval(function(){n++,(n>i.threshold&&j||c)&&(b.type="throttledresize",l.dispatch.apply(d,e),j=!1,n=0),n>9&&(a(m).stop(),k=!1,n=0)},30),k=!0)},threshold:0}}(jQuery,window,document); \ No newline at end of file diff --git a/catalog/images/account_notifications.gif b/catalog/images/account_notifications.gif deleted file mode 100644 index b6bee282c..000000000 Binary files a/catalog/images/account_notifications.gif and /dev/null differ diff --git a/catalog/images/account_orders.gif b/catalog/images/account_orders.gif deleted file mode 100644 index 78cae152e..000000000 Binary files a/catalog/images/account_orders.gif and /dev/null differ diff --git a/catalog/images/account_personal.gif b/catalog/images/account_personal.gif deleted file mode 100644 index ea364228b..000000000 Binary files a/catalog/images/account_personal.gif and /dev/null differ diff --git a/catalog/images/arrow_down.gif b/catalog/images/arrow_down.gif deleted file mode 100644 index 1da36bd57..000000000 Binary files a/catalog/images/arrow_down.gif and /dev/null differ diff --git a/catalog/images/arrow_east_south.gif b/catalog/images/arrow_east_south.gif deleted file mode 100644 index df5c97dff..000000000 Binary files a/catalog/images/arrow_east_south.gif and /dev/null differ diff --git a/catalog/images/arrow_green.gif b/catalog/images/arrow_green.gif deleted file mode 100644 index 95203ff31..000000000 Binary files a/catalog/images/arrow_green.gif and /dev/null differ diff --git a/catalog/images/arrow_south_east.gif b/catalog/images/arrow_south_east.gif deleted file mode 100644 index 8536e0c36..000000000 Binary files a/catalog/images/arrow_south_east.gif and /dev/null differ diff --git a/catalog/images/box_products_notifications.gif b/catalog/images/box_products_notifications.gif deleted file mode 100644 index 4eff94f98..000000000 Binary files a/catalog/images/box_products_notifications.gif and /dev/null differ diff --git a/catalog/images/box_products_notifications_remove.gif b/catalog/images/box_products_notifications_remove.gif deleted file mode 100644 index 3d56b7218..000000000 Binary files a/catalog/images/box_products_notifications_remove.gif and /dev/null differ diff --git a/catalog/images/box_write_review.gif b/catalog/images/box_write_review.gif deleted file mode 100644 index 71cd93650..000000000 Binary files a/catalog/images/box_write_review.gif and /dev/null differ diff --git a/catalog/images/checkout_bullet.gif b/catalog/images/checkout_bullet.gif deleted file mode 100644 index da63f245d..000000000 Binary files a/catalog/images/checkout_bullet.gif and /dev/null differ diff --git a/catalog/images/default/1.gif b/catalog/images/default/1.gif deleted file mode 100644 index d2815568a..000000000 Binary files a/catalog/images/default/1.gif and /dev/null differ diff --git a/catalog/images/default/2.gif b/catalog/images/default/2.gif deleted file mode 100644 index 7c5eff757..000000000 Binary files a/catalog/images/default/2.gif and /dev/null differ diff --git a/catalog/images/default/3.gif b/catalog/images/default/3.gif deleted file mode 100644 index 2cbd960cc..000000000 Binary files a/catalog/images/default/3.gif and /dev/null differ diff --git a/catalog/images/header_account.gif b/catalog/images/header_account.gif deleted file mode 100644 index 3f4a4f4a6..000000000 Binary files a/catalog/images/header_account.gif and /dev/null differ diff --git a/catalog/images/header_cart.gif b/catalog/images/header_cart.gif deleted file mode 100644 index d686ca8a9..000000000 Binary files a/catalog/images/header_cart.gif and /dev/null differ diff --git a/catalog/images/header_checkout.gif b/catalog/images/header_checkout.gif deleted file mode 100644 index ee323fac2..000000000 Binary files a/catalog/images/header_checkout.gif and /dev/null differ diff --git a/catalog/images/icons/cart.gif b/catalog/images/icons/cart.gif deleted file mode 100644 index f80dcb466..000000000 Binary files a/catalog/images/icons/cart.gif and /dev/null differ diff --git a/catalog/images/icons/error.gif b/catalog/images/icons/error.gif deleted file mode 100644 index d0e4f4382..000000000 Binary files a/catalog/images/icons/error.gif and /dev/null differ diff --git a/catalog/images/icons/shipping_ups.gif b/catalog/images/icons/shipping_ups.gif deleted file mode 100644 index a756ae9bf..000000000 Binary files a/catalog/images/icons/shipping_ups.gif and /dev/null differ diff --git a/catalog/images/icons/success.gif b/catalog/images/icons/success.gif deleted file mode 100644 index daaebdff7..000000000 Binary files a/catalog/images/icons/success.gif and /dev/null differ diff --git a/catalog/images/icons/warning.gif b/catalog/images/icons/warning.gif deleted file mode 100644 index 904485ce2..000000000 Binary files a/catalog/images/icons/warning.gif and /dev/null differ diff --git a/catalog/images/infobox/arrow_right.gif b/catalog/images/infobox/arrow_right.gif deleted file mode 100644 index 0f269f17d..000000000 Binary files a/catalog/images/infobox/arrow_right.gif and /dev/null differ diff --git a/catalog/images/infobox/corner_left.gif b/catalog/images/infobox/corner_left.gif deleted file mode 100644 index 3d015c581..000000000 Binary files a/catalog/images/infobox/corner_left.gif and /dev/null differ diff --git a/catalog/images/infobox/corner_right.gif b/catalog/images/infobox/corner_right.gif deleted file mode 100644 index 424dadfbd..000000000 Binary files a/catalog/images/infobox/corner_right.gif and /dev/null differ diff --git a/catalog/images/infobox/corner_right_left.gif b/catalog/images/infobox/corner_right_left.gif deleted file mode 100644 index 0e44df1a7..000000000 Binary files a/catalog/images/infobox/corner_right_left.gif and /dev/null differ diff --git a/catalog/images/table_background_account.gif b/catalog/images/table_background_account.gif deleted file mode 100644 index 052146cce..000000000 Binary files a/catalog/images/table_background_account.gif and /dev/null differ diff --git a/catalog/images/table_background_address_book.gif b/catalog/images/table_background_address_book.gif deleted file mode 100644 index 4adefc457..000000000 Binary files a/catalog/images/table_background_address_book.gif and /dev/null differ diff --git a/catalog/images/table_background_browse.gif b/catalog/images/table_background_browse.gif deleted file mode 100644 index de1320d71..000000000 Binary files a/catalog/images/table_background_browse.gif and /dev/null differ diff --git a/catalog/images/table_background_cart.gif b/catalog/images/table_background_cart.gif deleted file mode 100644 index a821c00de..000000000 Binary files a/catalog/images/table_background_cart.gif and /dev/null differ diff --git a/catalog/images/table_background_checkout.gif b/catalog/images/table_background_checkout.gif deleted file mode 100644 index 4338e1c8a..000000000 Binary files a/catalog/images/table_background_checkout.gif and /dev/null differ diff --git a/catalog/images/table_background_confirmation.gif b/catalog/images/table_background_confirmation.gif deleted file mode 100644 index 070683631..000000000 Binary files a/catalog/images/table_background_confirmation.gif and /dev/null differ diff --git a/catalog/images/table_background_contact_us.gif b/catalog/images/table_background_contact_us.gif deleted file mode 100644 index 52b12872e..000000000 Binary files a/catalog/images/table_background_contact_us.gif and /dev/null differ diff --git a/catalog/images/table_background_default.gif b/catalog/images/table_background_default.gif deleted file mode 100644 index 443f00448..000000000 Binary files a/catalog/images/table_background_default.gif and /dev/null differ diff --git a/catalog/images/table_background_delivery.gif b/catalog/images/table_background_delivery.gif deleted file mode 100644 index 81189ca6f..000000000 Binary files a/catalog/images/table_background_delivery.gif and /dev/null differ diff --git a/catalog/images/table_background_history.gif b/catalog/images/table_background_history.gif deleted file mode 100644 index 070683631..000000000 Binary files a/catalog/images/table_background_history.gif and /dev/null differ diff --git a/catalog/images/table_background_list.gif b/catalog/images/table_background_list.gif deleted file mode 100644 index 52239c253..000000000 Binary files a/catalog/images/table_background_list.gif and /dev/null differ diff --git a/catalog/images/table_background_login.gif b/catalog/images/table_background_login.gif deleted file mode 100644 index 9a0fc4b98..000000000 Binary files a/catalog/images/table_background_login.gif and /dev/null differ diff --git a/catalog/images/table_background_man_on_board.gif b/catalog/images/table_background_man_on_board.gif deleted file mode 100644 index bcbe063d8..000000000 Binary files a/catalog/images/table_background_man_on_board.gif and /dev/null differ diff --git a/catalog/images/table_background_password_forgotten.gif b/catalog/images/table_background_password_forgotten.gif deleted file mode 100644 index 512db0eff..000000000 Binary files a/catalog/images/table_background_password_forgotten.gif and /dev/null differ diff --git a/catalog/images/table_background_payment.gif b/catalog/images/table_background_payment.gif deleted file mode 100644 index 3d19e0184..000000000 Binary files a/catalog/images/table_background_payment.gif and /dev/null differ diff --git a/catalog/images/table_background_products_new.gif b/catalog/images/table_background_products_new.gif deleted file mode 100644 index ac4ced531..000000000 Binary files a/catalog/images/table_background_products_new.gif and /dev/null differ diff --git a/catalog/images/table_background_reviews.gif b/catalog/images/table_background_reviews.gif deleted file mode 100644 index 04ad05169..000000000 Binary files a/catalog/images/table_background_reviews.gif and /dev/null differ diff --git a/catalog/images/table_background_reviews_new.gif b/catalog/images/table_background_reviews_new.gif deleted file mode 100644 index 1e6132c82..000000000 Binary files a/catalog/images/table_background_reviews_new.gif and /dev/null differ diff --git a/catalog/images/table_background_specials.gif b/catalog/images/table_background_specials.gif deleted file mode 100644 index 2b6a773aa..000000000 Binary files a/catalog/images/table_background_specials.gif and /dev/null differ diff --git a/catalog/includes/OSC/OM/Cache.php b/catalog/includes/OSC/OM/Cache.php new file mode 100644 index 000000000..7e4c45e0f --- /dev/null +++ b/catalog/includes/OSC/OM/Cache.php @@ -0,0 +1,114 @@ +key; + } + + $key = basename($key); + + if (!static::hasSafeName($key)) { + trigger_error('OSCOM_Cache::write(): Invalid key name (\'' . $key . '\'). Valid characters are a-zA-Z0-9-_'); + + return false; + } + + if (is_writable(OSCOM::BASE_DIR . 'work/')) { + return file_put_contents(OSCOM::BASE_DIR . 'work/' . $key . '.cache', serialize($data), LOCK_EX) !== false; + } + + return false; + } + + public function read($key, $expire = null) + { + $key = basename($key); + + if (!static::hasSafeName($key)) { + trigger_error('OSCOM_Cache::read(): Invalid key name (\'' . $key . '\'). Valid characters are a-zA-Z0-9-_'); + + return false; + } + + $this->key = $key; + + $filename = OSCOM::BASE_DIR . 'work/' . $key . '.cache'; + + if (file_exists($filename)) { + $difference = floor((time() - filemtime($filename)) / 60); + + if (empty($expire) || (is_numeric($expire) && ($difference < $expire))) { + $this->data = unserialize(file_get_contents($filename)); + + return true; + } + } + + return false; + } + + public function getCache() + { + return $this->data; + } + + public static function hasSafeName($key) + { + return preg_match('/^[a-zA-Z0-9-_]+$/', $key) === 1; + } + + public function startBuffer() + { + ob_start(); + } + + public function stopBuffer() + { + $this->data = ob_get_contents(); + + ob_end_clean(); + + $this->write($this->data); + } + + public static function clear($key) + { + $key = basename($key); + + if (!static::hasSafeName($key)) { + trigger_error('OSCOM_Cache::clear(): Invalid key name (\'' . $key . '\'). Valid characters are a-zA-Z0-9-_'); + + return false; + } + + if (is_writable(OSCOM::BASE_DIR . 'work/')) { + $key_length = strlen($key); + + $d = dir(OSCOM::BASE_DIR . 'work/'); + + while (($entry = $d->read()) !== false) { + if ((strlen($entry) >= $key_length) && (substr($entry, 0, $key_length) == $key)) { + @unlink(OSCOM::BASE_DIR . 'work/' . $entry); + } + } + + $d->close(); + } + } +} diff --git a/catalog/includes/OSC/OM/DateTime.php b/catalog/includes/OSC/OM/DateTime.php new file mode 100644 index 000000000..148785eab --- /dev/null +++ b/catalog/includes/OSC/OM/DateTime.php @@ -0,0 +1,48 @@ + $zones_array) { + foreach ($zones_array as $key => $value) { + $result[] = [ + 'id' => $key, + 'text' => $value, + 'group' => $zone + ]; + } + } + + return $result; + } + + public static function setTimeZone($time_zone = null) + { + if (!isset($time_zone)) { + $time_zone = defined('CFG_TIME_ZONE') ? CFG_TIME_ZONE : date_default_timezone_get(); + } + + return date_default_timezone_set($time_zone); + } +} diff --git a/catalog/includes/OSC/OM/Db.php b/catalog/includes/OSC/OM/Db.php new file mode 100644 index 000000000..01c890d6a --- /dev/null +++ b/catalog/includes/OSC/OM/Db.php @@ -0,0 +1,423 @@ +autoPrefixTables($statement); + + return parent::exec($statement); + } + + public function prepare($statement, $driver_options = null) + { + $statement = $this->autoPrefixTables($statement); + + $DbStatement = parent::prepare($statement, is_array($driver_options) ? $driver_options : []); + $DbStatement->setQueryCall('prepare'); + $DbStatement->setPDO($this); + + return $DbStatement; + } + + public function query($statement) + { + $statement = $this->autoPrefixTables($statement); + + $args = func_get_args(); + + if (count($args) > 1) { + $DbStatement = call_user_func_array(array($this, 'parent::query'), $args); + } else { + $DbStatement = parent::query($statement); + } + + $DbStatement->setQueryCall('query'); + $DbStatement->setPDO($this); + + return $DbStatement; + } + + public function get($table, $fields, array $where = null, $order = null, $limit = null, $cache = null) + { + if (!is_array($table)) { + $table = [ $table ]; + } + + array_walk($table, function(&$v, &$k) { + if ((strlen($v) < 7) || (substr($v, 0, 7) != ':table_')) { + $v = ':table_' . $v; + } + }); + + if (!is_array($fields)) { + $fields = [ $fields ]; + } + + if (isset($order) && !is_array($order)) { + $order = [ $order ]; + } + + if (isset($limit)) { + if (is_array($limit) && (count($limit) === 2) && is_numeric($limit[0]) && is_numeric($limit[1])) { + $limit = implode(', ', $limit); + } elseif (!is_numeric($limit)) { + $limit = null; + } + } + + $statement = 'select ' . implode(', ', $fields) . ' from ' . implode(', ', $table); + + if (!isset($where) && !isset($cache)) { + if (isset($order)) { + $statement .= ' order by ' . implode(', ', $order); + } + + return $this->query($statement); + } + + if (isset($where)) { + $statement .= ' where '; + + foreach (array_keys($where) as $c) { + $statement .= $c . ' = :cond_' . $c . ' and '; + } + + $statement = substr($statement, 0, -5); + } + + if (isset($order)) { + $statement .= ' order by ' . implode(', ', $order); + } + + if (isset($limit)) { + $statement .= ' limit ' . $limit; + } + + $Q = $this->prepare($statement); + + if (isset($where)) { + foreach ($where as $c => $v) { + $Q->bindValue(':cond_' . $c, $v); + } + } + + if (isset($cache)) { + if (!is_array($cache)) { + $cache = [ $cache ]; + } + + call_user_func_array([$Q, 'setCache'], $cache); + } + + $Q->execute(); + + return $Q; + } + + public function save($table, array $data, array $where_condition = null) + { + if (empty($data)) { + return false; + } + + if ((strlen($table) < 7) || (substr($table, 0, 7) != ':table_')) { + $table = ':table_' . $table; + } + + if (isset($where_condition)) { + $statement = 'update ' . $table . ' set '; + + foreach ($data as $c => $v) { + if ($v == 'now()' || $v == 'null') { + $statement .= $c . ' = ' . $v . ', '; + } else { + $statement .= $c . ' = :new_' . $c . ', '; + } + } + + $statement = substr($statement, 0, -2) . ' where '; + + foreach (array_keys($where_condition) as $c) { + $statement .= $c . ' = :cond_' . $c . ' and '; + } + + $statement = substr($statement, 0, -5); + + $Q = $this->prepare($statement); + + foreach ($data as $c => $v) { + if ($v != 'now()' && $v != 'null') { + $Q->bindValue(':new_' . $c, $v); + } + } + + foreach ($where_condition as $c => $v) { + $Q->bindValue(':cond_' . $c, $v); + } + + $Q->execute(); + + return $Q->rowCount(); + } else { + $is_prepared = false; + + $statement = 'insert into ' . $table . ' (' . implode(', ', array_keys($data)) . ') values ('; + + foreach ($data as $c => $v) { + if ($v == 'now()' || $v == 'null') { + $statement .= $v . ', '; + } else { + if ($is_prepared === false) { + $is_prepared = true; + } + + $statement .= ':' . $c . ', '; + } + } + + $statement = substr($statement, 0, -2) . ')'; + + if ($is_prepared === true) { + $Q = $this->prepare($statement); + + foreach ($data as $c => $v) { + if ($v != 'now()' && $v != 'null') { + $Q->bindValue(':' . $c, $v); + } + } + + $Q->execute(); + + return $Q->rowCount(); + } else { + return $this->exec($statement); + } + } + + return false; + } + + public function delete($table, array $where_condition) + { + if ((strlen($table) < 7) || (substr($table, 0, 7) != ':table_')) { + $table = ':table_' . $table; + } + + $statement = 'delete from ' . $table . ' where '; + + foreach (array_keys($where_condition) as $c) { + $statement .= $c . ' = :cond_' . $c . ' and '; + } + + $statement = substr($statement, 0, -5); + + $Q = $this->prepare($statement); + + foreach ($where_condition as $c => $v) { + $Q->bindValue(':cond_' . $c, $v); + } + + $Q->execute(); + + return $Q->rowCount(); + } + + public function importSQL($sql_file, $table_prefix = null) + { + if (file_exists($sql_file)) { + $import_queries = file_get_contents($sql_file); + } else { + trigger_error(sprintf(ERROR_SQL_FILE_NONEXISTENT, $sql_file)); + + return false; + } + + set_time_limit(0); + + $sql_queries = array(); + $sql_length = strlen($import_queries); + $pos = strpos($import_queries, ';'); + + for ($i = $pos; $i < $sql_length; $i++) { +// remove comments + if (($import_queries[0] == '#') || (substr($import_queries, 0, 2) == '--')) { + $import_queries = ltrim(substr($import_queries, strpos($import_queries, "\n"))); + $sql_length = strlen($import_queries); + $i = strpos($import_queries, ';') - 1; + continue; + } + + if ($import_queries[($i+1)] == "\n") { + $next = ''; + + for ($j = ($i+2); $j < $sql_length; $j++) { + if (!empty($import_queries[$j])) { + $next = substr($import_queries, $j, 6); + + if (($next[0] == '#') || (substr($next, 0, 2) == '--')) { +// find out where the break position is so we can remove this line (#comment line) + for ($k = $j; $k < $sql_length; $k++) { + if ($import_queries[$k] == "\n") { + break; + } + } + + $query = substr($import_queries, 0, $i + 1); + + $import_queries = substr($import_queries, $k); + +// join the query before the comment appeared, with the rest of the dump + $import_queries = $query . $import_queries; + $sql_length = strlen($import_queries); + $i = strpos($import_queries, ';') - 1; + continue 2; + } + + break; + } + } + + if (empty($next)) { // get the last insert query + $next = 'insert'; + } + + if ((strtoupper($next) == 'DROP T') || + (strtoupper($next) == 'CREATE') || + (strtoupper($next) == 'INSERT') || + (strtoupper($next) == 'ALTER ') || + (strtoupper($next) == 'SET FO')) { + $next = ''; + + $sql_query = substr($import_queries, 0, $i); + + if (isset($table_prefix)) { + if (strtoupper(substr($sql_query, 0, 25)) == 'DROP TABLE IF EXISTS OSC_') { + $sql_query = 'DROP TABLE IF EXISTS ' . $table_prefix . substr($sql_query, 25); + } elseif (strtoupper(substr($sql_query, 0, 17)) == 'CREATE TABLE OSC_') { + $sql_query = 'CREATE TABLE ' . $table_prefix . substr($sql_query, 17); + } elseif (strtoupper(substr($sql_query, 0, 16)) == 'INSERT INTO OSC_') { + $sql_query = 'INSERT INTO ' . $table_prefix . substr($sql_query, 16); + } elseif (strtoupper(substr($sql_query, 0, 12)) == 'CREATE INDEX') { + $sql_query = substr($sql_query, 0, stripos($sql_query, ' on osc_')) . + ' on ' . + $table_prefix . + substr($sql_query, stripos($sql_query, ' on osc_') + 8); + } + } + + $sql_queries[] = trim($sql_query); + + $import_queries = ltrim(substr($import_queries, $i+1)); + $sql_length = strlen($import_queries); + $i = strpos($import_queries, ';')-1; + } + } + } + + $error = false; + + foreach ($sql_queries as $q) { + if ($this->exec($q) === false) { + $error = true; + + break; + } + } + + return !$error; + } + + public static function prepareInput($string) + { + if (is_string($string)) { + return HTML::sanitize($string); + } elseif (is_array($string)) { + foreach ($string as $k => $v) { + $string[$k] = static::prepareInput($v); + } + + return $string; + } else { + return $string; + } + } + + public static function prepareIdentifier($string) + { + return '`' . str_replace('`', '``', $string) . '`'; + } + + protected function autoPrefixTables($statement) + { + $prefix = ''; + + if (defined('DB_TABLE_PREFIX')) { + $prefix = DB_TABLE_PREFIX; + } + + $statement = str_replace(':table_', $prefix, $statement); + + return $statement; + } +} diff --git a/catalog/includes/OSC/OM/Db/MySQL.php b/catalog/includes/OSC/OM/Db/MySQL.php new file mode 100644 index 000000000..eafe4cc51 --- /dev/null +++ b/catalog/includes/OSC/OM/Db/MySQL.php @@ -0,0 +1,53 @@ +server = $server; + $this->username = $username; + $this->password = $password; + $this->database = $database; + $this->port = $port; + $this->driver_options = $driver_options; + + return $this->connect(); + } + + public function connect() + { + $dsn_array = []; + + if (!empty($this->database)) { + $dsn_array[] = 'dbname=' . $this->database; + } + + if ((strpos($this->server, '/') !== false) || (strpos($this->server, '\\') !== false)) { + $dsn_array[] = 'unix_socket=' . $this->server; + } else { + $dsn_array[] = 'host=' . $this->server; + + if (!empty($this->port)) { + $dsn_array[] = 'port=' . $this->port; + } + } + + $dsn_array[] = 'charset=utf8'; + + $dsn = 'mysql:' . implode(';', $dsn_array); + + $this->connected = true; + + $dbh = parent::__construct($dsn, $this->username, $this->password, $this->driver_options); + + return $dbh; + } +} diff --git a/catalog/includes/OSC/OM/DbStatement.php b/catalog/includes/OSC/OM/DbStatement.php new file mode 100644 index 000000000..70561de86 --- /dev/null +++ b/catalog/includes/OSC/OM/DbStatement.php @@ -0,0 +1,367 @@ +bindValue($parameter, (int)$value, \PDO::PARAM_INT); + } + + public function bindBool($parameter, $value) + { +// force type to bool (see http://bugs.php.net/bug.php?id=44639) + return $this->bindValue($parameter, (bool)$value, \PDO::PARAM_BOOL); + } + + public function bindDecimal($parameter, $value) { + return $this->bindValue($parameter, (float)$value); // there is no \PDO::PARAM_FLOAT + } + + public function bindNull($parameter) + { + return $this->bindValue($parameter, null, \PDO::PARAM_NULL); + } + + public function setPageSet($max_results, $page_set_keyword = null, $placeholder_offset = 'page_set_offset', $placeholder_max_results = 'page_set_max_results') + { + if (!empty($page_set_keyword)) { + $this->page_set_keyword = $page_set_keyword; + } + + $this->page_set = (isset($_GET[$this->page_set_keyword]) && is_numeric($_GET[$this->page_set_keyword]) && ($_GET[$this->page_set_keyword] > 0)) ? $_GET[$this->page_set_keyword] : 1; + $this->page_set_results_per_page = $max_results; + + $offset = max(($this->page_set * $max_results) - $max_results, 0); + + $this->bindInt(':' . $placeholder_offset, $offset); + $this->bindInt(':' . $placeholder_max_results, $max_results); + } + + public function execute($input_parameters = null) + { + if (isset($this->cache_key)) { + if (isset($this->page_set)) { + $this->cache_key = $this->cache_key . '-pageset' . $this->page_set; + } + + if (Registry::get('Cache')->read($this->cache_key, $this->cache_expire)) { + $this->cache_data = Registry::get('Cache')->getCache(); + + if (isset($this->cache_data['data']) && isset($this->cache_data['total'])) { + $this->page_set_total_rows = $this->cache_data['total']; + $this->cache_data = $this->cache_data['data']; + } + + $this->cache_read = true; + } + } + + if ($this->cache_read === false) { + if (empty($input_parameters)) { + $input_parameters = null; + } + + $this->is_error = !parent::execute($input_parameters); + + if ($this->is_error === true) { + trigger_error($this->queryString); + } + + if (strpos($this->queryString, ' SQL_CALC_FOUND_ROWS ') !== false) { + $this->page_set_total_rows = $this->pdo->query('select found_rows()')->fetchColumn(); + } elseif (isset($this->page_set)) { + trigger_error('OSC\\OM\\DbStatement::execute(): Page Set query does not contain SQL_CALC_FOUND_ROWS. Please add it to the query: ' . $this->queryString); + } + } + } + + public function fetch( + $fetch_style = \PDO::FETCH_ASSOC, + $cursor_orientation = \PDO::FETCH_ORI_NEXT, + $cursor_offset = 0 + ) { + if ($this->cache_read === true) { + list(, $this->result) = each($this->cache_data); + } else { + $this->result = parent::fetch($fetch_style, $cursor_orientation, $cursor_offset); + + if (isset($this->cache_key) && ($this->result !== false)) { + if (!isset($this->cache_data)) { + $this->cache_data = []; + } + + $this->cache_data[] = $this->result; + } + } + + return $this->result; + } + + public function fetchAll($fetch_style = \PDO::FETCH_ASSOC, $fetch_argument = null, $ctor_args = []) + { + if ($this->cache_read === true) { + $this->result = $this->cache_data; + } else { +// fetchAll() fails if second argument is passed in a fetch style that does not +// use the optional argument + if (in_array($fetch_style, array(\PDO::FETCH_COLUMN, \PDO::FETCH_CLASS, \PDO::FETCH_FUNC))) { + $this->result = parent::fetchAll($fetch_style, $fetch_argument, $ctor_args); + } else { + $this->result = parent::fetchAll($fetch_style); + } + + if (isset($this->cache_key) && ($this->result !== false)) { + $this->cache_data = $this->result; + } + } + + return $this->result; + } + + public function toArray() + { + if (!isset($this->result)) { + $this->fetch(); + } + + return $this->result; + } + + public function setCache($key, $expire = null, $cache_empty_results = false) + { + if (!is_numeric($expire)) { + $expire = 0; + } + + if (!is_bool($cache_empty_results)) { + $cache_empty_results = false; + } + + $this->cache_key = basename($key); + $this->cache_expire = $expire; + $this->cache_empty_results = $cache_empty_results; + + if ($this->query_call != 'prepare') { + trigger_error('OSCOM_DbStatement::setCache(): Cannot set cache (\'' . $this->cache_key . '\') on a non-prepare query. Please change the query to a prepare() query.'); + } + } + + protected function valueMixed($column, $type = 'string') + { + if (!isset($this->result)) { + $this->fetch(); + } + + switch ($type) { + case 'protected': + return HTML::outputProtected($this->result[$column]); + break; + + case 'int': + return (int)$this->result[$column]; + break; + + case 'decimal': + return (float)$this->result[$column]; + break; + + case 'string': + default: + return $this->result[$column]; + } + } + + public function value($column) + { + return $this->valueMixed($column, 'string'); + } + + public function valueProtected($column) + { + return $this->valueMixed($column, 'protected'); + } + + public function valueInt($column) + { + return $this->valueMixed($column, 'int'); + } + + public function valueDecimal($column) + { + return $this->valueMixed($column, 'decimal'); + } + + public function hasValue($column) { + if (!isset($this->result)) { + $this->fetch(); + } + + return isset($this->result[$column]); + } + + public function isError() + { + return $this->is_error; + } + + public function getQuery() + { + return $this->queryString; + } + + public function setQueryCall($type) + { + $this->query_call = $type; + } + + public function getQueryCall() + { + return $this->query_call; + } + + public function getCurrentPageSet() { + return $this->page_set; + } + + public function getPageSetResultsPerPage() + { + return $this->page_set_results_per_page; + } + + public function getPageSetTotalRows() + { + return $this->page_set_total_rows; + } + + public function setPDO(\PDO $instance) + { + $this->pdo = $instance; + } + + public function getPageSetLabel($text) + { + if ($this->page_set_total_rows < 1) { + $from = 0; + } else { + $from = max(($this->page_set * $this->page_set_results_per_page) - $this->page_set_results_per_page, 1); + } + + $to = min($this->page_set * $this->page_set_results_per_page, $this->page_set_total_rows); + + if ($to > $this->page_set_results_per_page) { + $from++; + } + + return sprintf($text, $from, $to, $this->page_set_total_rows); + } + + public function getPageSetLinks($parameters = null) + { + global $PHP_SELF, $request_type; + + $number_of_pages = ceil($this->page_set_total_rows / $this->page_set_results_per_page); + + if (!empty($parameters) && (substr($parameters, -1) != '&')) { + $parameters .= '&'; + } + + $output = '
        '; + +// previous button - not displayed on first page + if ($this->page_set > 1) { + $output .= '
      • «
      • '; + } else { + $output .= '
      • «
      • '; + } + +// check if number_of_pages > $max_page_links + $cur_window_num = (int)($this->page_set / $this->page_set_total_rows); + if ($this->page_set % $this->page_set_total_rows) { + $cur_window_num++; + } + + $max_window_num = (int)($number_of_pages / $this->page_set_total_rows); + if ($number_of_pages % $this->page_set_total_rows) { + $max_window_num++; + } + +// previous window of pages + if ($cur_window_num > 1) { + $output .= '
      • ...
      • '; + } + +// page nn button + for ($jump_to_page = 1 + (($cur_window_num - 1) * $this->page_set_total_rows); ($jump_to_page <= ($cur_window_num * $this->page_set_total_rows)) && ($jump_to_page <= $number_of_pages); $jump_to_page++) { + if ($jump_to_page == $this->page_set) { + $output .= '
      • ' . $jump_to_page . '(current)
      • '; + } else { + $output .= '
      • ' . $jump_to_page . '
      • '; + } + } + +// next window of pages + if ($cur_window_num < $max_window_num) { + $output .= '... '; + } + +// next button + if (($this->page_set < $number_of_pages) && ($number_of_pages != 1)) { + $output .= '
      • »
      • '; + } else { + $output .= '
      • »
      • '; + } + + $output .= '
      '; + + return $output; + } + + public function __destruct() + { + if (($this->cache_read === false) && isset($this->cache_key) && is_array($this->cache_data)) { + if ($this->cache_empty_results || ($this->cache_data[0] !== false)) { + $cache_data = $this->cache_data; + + if (isset($this->page_set_total_rows)) { + $cache_data = [ + 'data' => $cache_data, + 'total' => $this->page_set_total_rows + ]; + } + + Registry::get('Cache')->write($cache_data, $this->cache_key); + } + } + } +} diff --git a/catalog/includes/OSC/OM/HTML.php b/catalog/includes/OSC/OM/HTML.php new file mode 100644 index 000000000..dec53c8ff --- /dev/null +++ b/catalog/includes/OSC/OM/HTML.php @@ -0,0 +1,383 @@ + '"' + ]; + } + + return strtr(trim($string), $translate); + } + + public static function outputProtected($string) + { + return htmlspecialchars(trim($string)); + } + + public static function sanitize($string) + { + $patterns = [ + '/ +/', + '/[<>]/' + ]; + + $replace = [ + ' ', + '_' + ]; + + return preg_replace($patterns, $replace, trim($string)); + } + + public static function image($src, $alt = '', $width = '', $height = '', $parameters = '', $responsive = true, $bootstrap_css = '') + { + if ((empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false')) { + return false; + } + +// alt is added to the img tag even if it is null to prevent browsers from outputting +// the image filename as default + $image = '' . static::output($alt) . ''; + } + + if (empty($default) && ((isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])))) { + if (isset($_GET[$name]) && is_string($_GET[$name])) { + $default = $_GET[$name]; + } elseif (isset($_POST[$name]) && is_string($_POST[$name])) { + $default = $_POST[$name]; + } + } + + $ci = new \CachingIterator(new \ArrayIterator($values), \CachingIterator::TOSTRING_USE_CURRENT); // used for hasNext() below + + foreach ($ci as $v) { + if (isset($v['group'])) { + if ($group != $v['group']) { + $group = $v['group']; + + $field .= ''; + } + } + + $field .= ''; + } + } + + $field .= ''; + + return $field; + } + + public static function hiddenField($name, $value = '', $parameters = '') + { + $field = ''; + + if (isset($icon) && !empty($icon)) { + $button .= ' '; + } + + $button .= $title; + + if (($params['type'] == 'button') && isset($link)) { + $button .= ''; + } else { + $button .= ''; + } + + $button_counter++; + + return $button; + } + + public static function stars($rating = 0, $meta = false) + { + $stars = str_repeat('', (int)$rating) . + str_repeat('', 5-(int)$rating); + + if ($meta !== false) { + $stars .= ''; + } + + return $stars; + } +} diff --git a/catalog/includes/OSC/OM/HTTP.php b/catalog/includes/OSC/OM/HTTP.php new file mode 100644 index 000000000..a191a246b --- /dev/null +++ b/catalog/includes/OSC/OM/HTTP.php @@ -0,0 +1,25 @@ +HashPassword($plain); + } +} diff --git a/catalog/includes/OSC/OM/OSCOM.php b/catalog/includes/OSC/OM/OSCOM.php new file mode 100644 index 000000000..05ca7482e --- /dev/null +++ b/catalog/includes/OSC/OM/OSCOM.php @@ -0,0 +1,150 @@ +Parse Time: ' . $parse_time . 's'; @@ -25,8 +22,6 @@ } if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) { - if ( (PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4') ) { tep_gzip_output(GZIP_LEVEL); - } } ?> diff --git a/catalog/includes/application_top.php b/catalog/includes/application_top.php index 5d46ea0c0..8a74fb15a 100644 --- a/catalog/includes/application_top.php +++ b/catalog/includes/application_top.php @@ -5,21 +5,23 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Cache; + use OSC\OM\Db; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + // start the timer for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); + define('OSCOM_BASE_DIR', __DIR__ . '/'); // set the level of error reporting - error_reporting(E_ALL & ~E_NOTICE); - -// check support for register_globals - if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) { - exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. Please use PHP 4.3+ if register_globals cannot be enabled on the server.'); - } + error_reporting(E_ALL | E_STRICT); + ini_set('display_errors', true); // TODO remove on release // load server configuration parameters if (file_exists('includes/local/configure.php')) { // for developers @@ -28,153 +30,117 @@ include('includes/configure.php'); } - if (strlen(DB_SERVER) < 1) { + if (DB_SERVER == '') { if (is_dir('install')) { header('Location: install/index.php'); + exit; } } -// define the project version --- obsolete, now retrieved with tep_get_version() - define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3'); + require(OSCOM_BASE_DIR . 'OSC/OM/OSCOM.php'); + spl_autoload_register('OSC\\OM\\OSCOM::autoload'); -// some code to solve compatibility issues - require(DIR_WS_FUNCTIONS . 'compatibility.php'); + OSCOM::initialize(); // set the type of request (secure or not) - $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; - -// set php_self in the local scope - $req = parse_url($HTTP_SERVER_VARS['SCRIPT_NAME']); - $PHP_SELF = substr($req['path'], ($request_type == 'NONSSL') ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG)); - - if ($request_type == 'NONSSL') { - define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG); - } else { + if ( (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on')) || (isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] == 443)) ) { + $request_type = 'SSL'; define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG); +// set the cookie domain + $cookie_domain = HTTPS_COOKIE_DOMAIN; + $cookie_path = HTTPS_COOKIE_PATH; + } else { + $request_type = 'NONSSL'; + define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG); + $cookie_domain = HTTP_COOKIE_DOMAIN; + $cookie_path = HTTP_COOKIE_PATH; } -// include the list of project filenames - require(DIR_WS_INCLUDES . 'filenames.php'); - -// include the list of project database tables - require(DIR_WS_INCLUDES . 'database_tables.php'); - -// include the database functions - require(DIR_WS_FUNCTIONS . 'database.php'); +// set php_self in the local scope + $req = parse_url($_SERVER['SCRIPT_NAME']); + $PHP_SELF = substr($req['path'], ($request_type == 'NONSSL') ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG)); -// make a connection to the database... now - tep_db_connect() or die('Unable to connect to database server!'); + Registry::set('Cache', new Cache()); + Registry::set('Db', Db::initialize()); + $OSCOM_Db = Registry::get('Db'); // set the application parameters - $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); - while ($configuration = tep_db_fetch_array($configuration_query)) { - define($configuration['cfgKey'], $configuration['cfgValue']); + $Qcfg = $OSCOM_Db->get('configuration', ['configuration_key as k', 'configuration_value as v']);//, null, null, null, 'configuration'); // TODO add cache when supported by admin + + while ($Qcfg->fetch()) { + define($Qcfg->value('k'), $Qcfg->value('v')); } // if gzip_compression is enabled, start to buffer the output - if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && !headers_sent() ) { - if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) { - if (PHP_VERSION < '5.4' || PHP_VERSION > '5.4.5') { // see PHP bug 55544 - if (PHP_VERSION >= '4.0.4') { - ob_start('ob_gzhandler'); - } elseif (PHP_VERSION >= '4.0.1') { - include(DIR_WS_FUNCTIONS . 'gzip_compression.php'); - ob_start(); - ob_implicit_flush(); - } + if ( (GZIP_COMPRESSION == 'true') && extension_loaded('zlib') && !headers_sent() ) { + if ( (int)ini_get('zlib.output_compression') < 1 ) { + if ( (PHP_VERSION < '5.4') || (PHP_VERSION > '5.4.5') ) { // see PHP bug 55544 + ob_start('ob_gzhandler'); } - } elseif (function_exists('ini_set')) { + } elseif ( function_exists('ini_set') ) { ini_set('zlib.output_compression_level', GZIP_LEVEL); } } -// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled - if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') { - if (strlen(getenv('PATH_INFO')) > 1) { - $GET_array = array(); - $PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF); - $vars = explode('/', substr(getenv('PATH_INFO'), 1)); - do_magic_quotes_gpc($vars); - for ($i=0, $n=sizeof($vars); $i<$n; $i++) { - if (strpos($vars[$i], '[]')) { - $GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1]; - } else { - $HTTP_GET_VARS[$vars[$i]] = $vars[$i+1]; - } - $i++; - } - - if (sizeof($GET_array) > 0) { - while (list($key, $value) = each($GET_array)) { - $HTTP_GET_VARS[$key] = $value; - } - } - } - } - // define general functions used application-wide - require(DIR_WS_FUNCTIONS . 'general.php'); - require(DIR_WS_FUNCTIONS . 'html_output.php'); - -// set the cookie domain - $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN); - $cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH); + require('includes/functions/general.php'); // include cache functions if enabled - if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php'); + if ( USE_CACHE == 'true' ) include('includes/functions/cache.php'); // include shopping cart class - require(DIR_WS_CLASSES . 'shopping_cart.php'); + require('includes/classes/shopping_cart.php'); // include navigation history class - require(DIR_WS_CLASSES . 'navigation_history.php'); + require('includes/classes/navigation_history.php'); // define how the session functions will be used - require(DIR_WS_FUNCTIONS . 'sessions.php'); + require('includes/functions/sessions.php'); // set the session name and save path - tep_session_name('osCsid'); - tep_session_save_path(SESSION_WRITE_DIRECTORY); + session_name('osCsid'); + session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters - if (function_exists('session_set_cookie_params')) { - session_set_cookie_params(0, $cookie_path, $cookie_domain); - } elseif (function_exists('ini_set')) { - ini_set('session.cookie_lifetime', '0'); - ini_set('session.cookie_path', $cookie_path); - ini_set('session.cookie_domain', $cookie_domain); - } + session_set_cookie_params(0, $cookie_path, $cookie_domain); - @ini_set('session.use_only_cookies', (SESSION_FORCE_COOKIE_USE == 'True') ? 1 : 0); + if ( function_exists('ini_set') ) { + ini_set('session.use_only_cookies', (SESSION_FORCE_COOKIE_USE == 'True') ? 1 : 0); + } // set the session ID if it exists if ( SESSION_FORCE_COOKIE_USE == 'False' ) { - if ( isset($HTTP_GET_VARS[tep_session_name()]) && (!isset($HTTP_COOKIE_VARS[tep_session_name()]) || ($HTTP_COOKIE_VARS[tep_session_name()] != $HTTP_GET_VARS[tep_session_name()])) ) { - tep_session_id($HTTP_GET_VARS[tep_session_name()]); - } elseif ( isset($HTTP_POST_VARS[tep_session_name()]) && (!isset($HTTP_COOKIE_VARS[tep_session_name()]) || ($HTTP_COOKIE_VARS[tep_session_name()] != $HTTP_POST_VARS[tep_session_name()])) ) { - tep_session_id($HTTP_POST_VARS[tep_session_name()]); + if ( isset($_GET[session_name()]) && (!isset($_COOKIE[session_name()]) || ($_COOKIE[session_name()] != $_GET[session_name()])) ) { + session_id($_GET[session_name()]); + } elseif ( isset($_POST[session_name()]) && (!isset($_COOKIE[session_name()]) || ($_COOKIE[session_name()] != $_POST[session_name()])) ) { + session_id($_POST[session_name()]); } } // start the session $session_started = false; - if (SESSION_FORCE_COOKIE_USE == 'True') { - tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain); - if (isset($HTTP_COOKIE_VARS['cookie_test'])) { + if ( SESSION_FORCE_COOKIE_USE == 'True' ) { + tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30); + + if ( isset($_COOKIE['cookie_test']) ) { tep_session_start(); $session_started = true; } - } elseif (SESSION_BLOCK_SPIDERS == 'True') { - $user_agent = strtolower(getenv('HTTP_USER_AGENT')); - $spider_flag = false; + } elseif ( SESSION_BLOCK_SPIDERS == 'True' ) { + + $user_agent = ''; - if (tep_not_null($user_agent)) { - $spiders = file(DIR_WS_INCLUDES . 'spiders.txt'); + if (isset($_SERVER['HTTP_USER_AGENT'])) { + $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); + } + + $spider_flag = false; - for ($i=0, $n=sizeof($spiders); $i<$n; $i++) { - if (tep_not_null($spiders[$i])) { - if (is_integer(strpos($user_agent, trim($spiders[$i])))) { + if ( !empty($user_agent) ) { + foreach ( file('includes/spiders.txt') as $spider ) { + if ( !empty($spider) ) { + if ( strpos($user_agent, $spider) !== false ) { $spider_flag = true; break; } @@ -182,7 +148,7 @@ } } - if ($spider_flag == false) { + if ( $spider_flag === false ) { tep_session_start(); $session_started = true; } @@ -191,260 +157,244 @@ $session_started = true; } - if ( ($session_started == true) && (PHP_VERSION >= 4.3) && function_exists('ini_get') && (ini_get('register_globals') == false) ) { - extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS); - } - // initialize a session token - if (!tep_session_is_registered('sessiontoken')) { - $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); - tep_session_register('sessiontoken'); + if ( !isset($_SESSION['sessiontoken']) ) { + $_SESSION['sessiontoken'] = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); } // set SID once, even if empty $SID = (defined('SID') ? SID : ''); // verify the ssl_session_id if the feature is enabled - if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) { - $ssl_session_id = getenv('SSL_SESSION_ID'); - if (!tep_session_is_registered('SSL_SESSION_ID')) { - $SESSION_SSL_ID = $ssl_session_id; - tep_session_register('SESSION_SSL_ID'); + if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started === true) ) { + if ( !isset($_SESSION['SSL_SESSION_ID']) ) { + $_SESSION['SESSION_SSL_ID'] = $_SERVER['SSL_SESSION_ID']; } - if ($SESSION_SSL_ID != $ssl_session_id) { + if ( $_SESSION['SESSION_SSL_ID'] != $_SERVER['SSL_SESSION_ID'] ) { tep_session_destroy(); - tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); + + OSCOM::redirect('ssl_check.php'); } } // verify the browser user agent if the feature is enabled - if (SESSION_CHECK_USER_AGENT == 'True') { - $http_user_agent = getenv('HTTP_USER_AGENT'); - if (!tep_session_is_registered('SESSION_USER_AGENT')) { - $SESSION_USER_AGENT = $http_user_agent; - tep_session_register('SESSION_USER_AGENT'); + if ( SESSION_CHECK_USER_AGENT == 'True' ) { + if ( !isset($_SESSION['SESSION_USER_AGENT']) ) { + $_SESSION['SESSION_USER_AGENT'] = $_SERVER['HTTP_USER_AGENT']; } - if ($SESSION_USER_AGENT != $http_user_agent) { + if ( $_SESSION['SESSION_USER_AGENT'] != $_SERVER['HTTP_USER_AGENT'] ) { tep_session_destroy(); - tep_redirect(tep_href_link(FILENAME_LOGIN)); + OSCOM::redirect('login.php'); } } // verify the IP address if the feature is enabled - if (SESSION_CHECK_IP_ADDRESS == 'True') { - $ip_address = tep_get_ip_address(); - if (!tep_session_is_registered('SESSION_IP_ADDRESS')) { - $SESSION_IP_ADDRESS = $ip_address; - tep_session_register('SESSION_IP_ADDRESS'); + if ( SESSION_CHECK_IP_ADDRESS == 'True' ) { + if ( !isset($_SESSION['SESSION_IP_ADDRESS']) ) { + $_SESSION['SESSION_IP_ADDRESS'] = tep_get_ip_address(); } - if ($SESSION_IP_ADDRESS != $ip_address) { + if ( $_SESSION['SESSION_IP_ADDRESS'] != tep_get_ip_address() ) { tep_session_destroy(); - tep_redirect(tep_href_link(FILENAME_LOGIN)); + OSCOM::redirect('login.php'); } } // create the shopping cart - if (!tep_session_is_registered('cart') || !is_object($cart)) { - tep_session_register('cart'); - $cart = new shoppingCart; + if ( !isset($_SESSION['cart']) || !is_object($_SESSION['cart']) || (get_class($_SESSION['cart']) != 'shoppingCart') ) { + $_SESSION['cart'] = new shoppingCart(); } // include currencies class and create an instance - require(DIR_WS_CLASSES . 'currencies.php'); + require('includes/classes/currencies.php'); $currencies = new currencies(); // include the mail classes - require(DIR_WS_CLASSES . 'mime.php'); - require(DIR_WS_CLASSES . 'email.php'); + require('includes/classes/mime.php'); + require('includes/classes/email.php'); // set the language - if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) { - if (!tep_session_is_registered('language')) { - tep_session_register('language'); - tep_session_register('languages_id'); - } - - include(DIR_WS_CLASSES . 'language.php'); + if ( !isset($_SESSION['language']) || isset($_GET['language']) ) { + include('includes/classes/language.php'); $lng = new language(); - if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) { - $lng->set_language($HTTP_GET_VARS['language']); + if ( isset($_GET['language']) && !empty($_GET['language']) ) { + $lng->set_language($_GET['language']); } else { $lng->get_browser_language(); } - $language = $lng->language['directory']; - $languages_id = $lng->language['id']; + $_SESSION['language'] = $lng->language['directory']; + $_SESSION['languages_id'] = $lng->language['id']; } // include the language translations $_system_locale_numeric = setlocale(LC_NUMERIC, 0); - require(DIR_WS_LANGUAGES . $language . '.php'); + require('includes/languages/' . basename($_SESSION['language']) . '.php'); setlocale(LC_NUMERIC, $_system_locale_numeric); // Prevent LC_ALL from setting LC_NUMERIC to a locale with 1,0 float/decimal values instead of 1.0 (see bug #634) // currency - if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) { - if (!tep_session_is_registered('currency')) tep_session_register('currency'); - - if (isset($HTTP_GET_VARS['currency']) && $currencies->is_set($HTTP_GET_VARS['currency'])) { - $currency = $HTTP_GET_VARS['currency']; + if ( !isset($_SESSION['currency']) || isset($_GET['currency']) || ((USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $_SESSION['currency'])) ) { + if ( isset($_GET['currency']) && $currencies->is_set($_GET['currency']) ) { + $_SESSION['currency'] = $_GET['currency']; } else { - $currency = ((USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && $currencies->is_set(LANGUAGE_CURRENCY)) ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; + $_SESSION['currency'] = ((USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && $currencies->is_set(LANGUAGE_CURRENCY)) ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } } // navigation history - if (!tep_session_is_registered('navigation') || !is_object($navigation)) { - tep_session_register('navigation'); - $navigation = new navigationHistory; + if ( !isset($_SESSION['navigation']) || !is_object($_SESSION['navigation']) || (get_class($_SESSION['navigation']) != 'navigationHistory') ) { + $_SESSION['navigation'] = new navigationHistory(); } - $navigation->add_current_page(); + + $_SESSION['navigation']->add_current_page(); // action recorder - include('includes/classes/action_recorder.php'); + require('includes/classes/action_recorder.php'); +// initialize the message stack for output messages + require('includes/classes/alertbox.php'); + require('includes/classes/message_stack.php'); + $messageStack = new messageStack(); // Shopping cart actions - if (isset($HTTP_GET_VARS['action'])) { + if ( isset($_GET['action']) ) { // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled - if ($session_started == false) { - tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); + if ( $session_started == false ) { + OSCOM::redirect('cookie_usage.php'); } - if (DISPLAY_CART == 'true') { - $goto = FILENAME_SHOPPING_CART; + if ( DISPLAY_CART == 'true' ) { + $goto = 'shopping_cart.php'; $parameters = array('action', 'cPath', 'products_id', 'pid'); } else { $goto = $PHP_SELF; - if ($HTTP_GET_VARS['action'] == 'buy_now') { + + if ( $_GET['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id'); } else { $parameters = array('action', 'pid'); } } - switch ($HTTP_GET_VARS['action']) { + + switch ( $_GET['action'] ) { // customer wants to update the product quantity in their shopping cart - case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) { - if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) { - $cart->remove($HTTP_POST_VARS['products_id'][$i]); - } else { - $attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : ''; - $cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false); - } + case 'update_product' : for ($i=0, $n=sizeof($_POST['products_id']); $i<$n; $i++) { + $attributes = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : ''; + $_SESSION['cart']->add_cart($_POST['products_id'][$i], $_POST['cart_quantity'][$i], $attributes, false); + $messageStack->add_session('product_action', sprintf(PRODUCT_ADDED, tep_get_products_name((int)$_POST['products_id'][$i])), 'success'); } - tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); + OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; // customer adds a product from the products page - case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { - $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : ''; - $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes); + case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) { + $attributes = isset($_POST['id']) ? $_POST['id'] : ''; + $_SESSION['cart']->add_cart($_POST['products_id'], $_SESSION['cart']->get_quantity(tep_get_uprid($_POST['products_id'], $attributes))+1, $attributes); + $messageStack->add_session('product_action', sprintf(PRODUCT_ADDED, tep_get_products_name((int)$_POST['products_id'])), 'success'); } - tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); + OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; // customer removes a product from their shopping cart - case 'remove_product' : if (isset($HTTP_GET_VARS['products_id'])) { - $cart->remove($HTTP_GET_VARS['products_id']); + case 'remove_product' : if (isset($_GET['products_id'])) { + $_SESSION['cart']->remove($_GET['products_id']); + $messageStack->add_session('product_action', sprintf(PRODUCT_REMOVED, tep_get_products_name($_GET['products_id'])), 'warning'); } - tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); + OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; // performed by the 'buy now' button in product listings and review page - case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) { - if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) { - tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); + case 'buy_now' : if (isset($_GET['products_id'])) { + if (tep_has_product_attributes($_GET['products_id'])) { + OSCOM::redirect('product_info.php', 'products_id=' . $_GET['products_id']); } else { - $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1); + $_SESSION['cart']->add_cart($_GET['products_id'], $_SESSION['cart']->get_quantity($_GET['products_id'])+1); + $messageStack->add_session('product_action', sprintf(PRODUCT_ADDED, tep_get_products_name((int)$_GET['products_id'])), 'success'); } } - tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); + OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; - case 'notify' : if (tep_session_is_registered('customer_id')) { - if (isset($HTTP_GET_VARS['products_id'])) { - $notify = $HTTP_GET_VARS['products_id']; - } elseif (isset($HTTP_GET_VARS['notify'])) { - $notify = $HTTP_GET_VARS['notify']; - } elseif (isset($HTTP_POST_VARS['notify'])) { - $notify = $HTTP_POST_VARS['notify']; + case 'notify' : if ( isset($_SESSION['customer_id']) ) { + if (isset($_GET['products_id'])) { + $notify = $_GET['products_id']; + } elseif (isset($_GET['notify'])) { + $notify = $_GET['notify']; + } elseif (isset($_POST['notify'])) { + $notify = $_POST['notify']; } else { - tep_redirect(tep_href_link($PHP_SELF, tep_get_all_get_params(array('action', 'notify')))); + OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action', 'notify'))); } if (!is_array($notify)) $notify = array($notify); for ($i=0, $n=sizeof($notify); $i<$n; $i++) { - $check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$notify[$i] . "' and customers_id = '" . (int)$customer_id . "'"); - $check = tep_db_fetch_array($check_query); - if ($check['count'] < 1) { - tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . (int)$notify[$i] . "', '" . (int)$customer_id . "', now())"); + $Qcheck = $OSCOM_Db->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $notify[$i]]); + + if ($Qcheck->fetch() === false) { + $OSCOM_Db->save('products_notifications', ['products_id' => $notify[$i], 'customers_id' => $_SESSION['customer_id'], 'date_added' => 'now()']); + $messageStack->add_session('product_action', sprintf(PRODUCT_SUBSCRIBED, tep_get_products_name((int)$notify[$i])), 'success'); } } - tep_redirect(tep_href_link($PHP_SELF, tep_get_all_get_params(array('action', 'notify')))); + OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action', 'notify'))); } else { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } break; - case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_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); - if ($check['count'] > 0) { - tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . (int)$customer_id . "'"); + case 'notify_remove' : if ( isset($_SESSION['customer_id']) && isset($_GET['products_id'])) { + $Qcheck = $OSCOM_Db->get('products_notifications', 'products_id', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $_GET['products_id']]); + + if ($Qcheck->fetch() !== false) { + $OSCOM_Db->delete('products_notifications', ['customers_id' => $_SESSION['customer_id'], 'products_id' => $_GET['products_id']]); + $messageStack->add_session('product_action', sprintf(PRODUCT_UNSUBSCRIBED, tep_get_products_name((int)$_GET['products_id'])), 'warning'); } - tep_redirect(tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')))); + OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action'))); } else { - $navigation->set_snapshot(); - tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); + $_SESSION['navigation']->set_snapshot(); + OSCOM::redirect('login.php', '', 'SSL'); } break; - case 'cust_order' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) { - if (tep_has_product_attributes($HTTP_GET_VARS['pid'])) { - tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['pid'])); + 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 { - $cart->add_cart($HTTP_GET_VARS['pid'], $cart->get_quantity($HTTP_GET_VARS['pid'])+1); + $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid'])+1); } } - tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); + OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; } } // include the who's online functions - require(DIR_WS_FUNCTIONS . 'whos_online.php'); + require('includes/functions/whos_online.php'); tep_update_whos_online(); // include the password crypto functions - require(DIR_WS_FUNCTIONS . 'password_funcs.php'); + require('includes/functions/password_funcs.php'); // include validation functions (right now only email address) - require(DIR_WS_FUNCTIONS . 'validations.php'); - -// split-page-results - require(DIR_WS_CLASSES . 'split_page_results.php'); - -// infobox - require(DIR_WS_CLASSES . 'boxes.php'); + require('includes/functions/validations.php'); // auto activate and expire banners - require(DIR_WS_FUNCTIONS . 'banner.php'); + require('includes/functions/banner.php'); tep_activate_banners(); tep_expire_banners(); // auto expire special products - require(DIR_WS_FUNCTIONS . 'specials.php'); + require('includes/functions/specials.php'); tep_expire_specials(); - require(DIR_WS_CLASSES . 'osc_template.php'); + require('includes/classes/osc_template.php'); $oscTemplate = new oscTemplate(); // calculate category path - if (isset($HTTP_GET_VARS['cPath'])) { - $cPath = $HTTP_GET_VARS['cPath']; - } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) { - $cPath = tep_get_product_path($HTTP_GET_VARS['products_id']); + if ( isset($_GET['cPath']) ) { + $cPath = $_GET['cPath']; + } elseif ( isset($_GET['products_id']) && !isset($_GET['manufacturers_id']) ) { + $cPath = tep_get_product_path($_GET['products_id']); } else { $cPath = ''; } - if (tep_not_null($cPath)) { + if ( !empty($cPath) ) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; @@ -452,45 +402,35 @@ $current_category_id = 0; } +// include category tree class + require('includes/classes/category_tree.php'); + // include the breadcrumb class and start the breadcrumb trail - require(DIR_WS_CLASSES . 'breadcrumb.php'); + require('includes/classes/breadcrumb.php'); $breadcrumb = new breadcrumb; $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); - $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_DEFAULT)); + $breadcrumb->add(HEADER_TITLE_CATALOG, OSCOM::link('index.php')); // add category names or the manufacturer name to the breadcrumb trail - if (isset($cPath_array)) { - for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) { - $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'"); - if (tep_db_num_rows($categories_query) > 0) { - $categories = tep_db_fetch_array($categories_query); - $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); + if ( isset($cPath_array) ) { + for ( $i=0, $n=sizeof($cPath_array); $i<$n; $i++ ) { + $Qcategories = $OSCOM_Db->get('categories_description', 'categories_name', ['categories_id' => $cPath_array[$i], 'language_id' => $_SESSION['languages_id']]); + + if ($Qcategories->fetch() !== false) { + $breadcrumb->add($Qcategories->value('categories_name'), OSCOM::link('index.php', 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1))))); } else { break; } } - } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) { - $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); - if (tep_db_num_rows($manufacturers_query)) { - $manufacturers = tep_db_fetch_array($manufacturers_query); - $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'])); - } - } + } elseif ( isset($_GET['manufacturers_id']) ) { + $Qmanufacturer = $OSCOM_Db->get('manufacturers', 'manufacturers_name', ['manufacturers_id' => $_GET['manufacturers_id']]); -// add the products model to the breadcrumb trail - if (isset($HTTP_GET_VARS['products_id'])) { - $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); - if (tep_db_num_rows($model_query)) { - $model = tep_db_fetch_array($model_query); - $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id'])); + if ($Qmanufacturer->fetch() !== false) { + $breadcrumb->add($Qmanufacturer->value('manufacturers_name'), OSCOM::link('index.php', 'manufacturers_id=' . $_GET['manufacturers_id'])); } } -// initialize the message stack for output messages - require(DIR_WS_CLASSES . 'message_stack.php'); - $messageStack = new messageStack; - require(DIR_FS_CATALOG . 'includes/classes/hooks.php'); $OSCOM_Hooks = new hooks('shop'); ?> diff --git a/catalog/includes/classes/action_recorder.php b/catalog/includes/classes/action_recorder.php index 66fc63d85..2a3c80ee2 100644 --- a/catalog/includes/classes/action_recorder.php +++ b/catalog/includes/classes/action_recorder.php @@ -5,18 +5,20 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class actionRecorder { var $_module; var $_user_id; var $_user_name; function actionRecorder($module, $user_id = null, $user_name = null) { - global $language, $PHP_SELF; + global $PHP_SELF; $module = tep_sanitize_string(str_replace(' ', '', $module)); @@ -24,7 +26,7 @@ function actionRecorder($module, $user_id = null, $user_name = null) { if (tep_not_null($module) && in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), explode(';', MODULE_ACTION_RECORDER_INSTALLED))) { if (!class_exists($module)) { if (file_exists(DIR_WS_MODULES . 'action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)))) { - include(DIR_WS_LANGUAGES . $language . '/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1))); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1))); include(DIR_WS_MODULES . 'action_recorder/' . $module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1))); } else { return false; @@ -72,8 +74,10 @@ function getIdentifier() { } function record($success = true) { + $OSCOM_Db = Registry::get('Db'); + if (tep_not_null($this->_module)) { - tep_db_query("insert into " . TABLE_ACTION_RECORDER . " (module, user_id, user_name, identifier, success, date_added) values ('" . tep_db_input($this->_module) . "', '" . (int)$this->_user_id . "', '" . tep_db_input($this->_user_name) . "', '" . tep_db_input($this->getIdentifier()) . "', '" . ($success == true ? 1 : 0) . "', now())"); + $OSCOM_Db->save('action_recorder', ['module' => $this->_module, 'user_id' => (int)$this->_user_id, 'user_name' => $this->_user_name, 'identifier' => $this->getIdentifier(), 'success' => ($success == true ? 1 : 0), 'date_added' => 'now()']); } } diff --git a/catalog/includes/classes/alertbox.php b/catalog/includes/classes/alertbox.php new file mode 100644 index 000000000..81e989de5 --- /dev/null +++ b/catalog/includes/classes/alertbox.php @@ -0,0 +1,32 @@ +' . "\n"; + $alertBox_string .= ' ' . "\n"; + $alertBox_string .= $contents[$i]['text']; + + $alertBox_string .= '
      ' . "\n"; + } + + if ($alert_output == true) echo $alertBox_string; + return $alertBox_string; + } + } + diff --git a/catalog/includes/classes/boxes.php b/catalog/includes/classes/boxes.php deleted file mode 100644 index 285f3f02b..000000000 --- a/catalog/includes/classes/boxes.php +++ /dev/null @@ -1,178 +0,0 @@ -table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"'; - if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters; - $tableBox_string .= '>' . "\n"; - - for ($i=0, $n=sizeof($contents); $i<$n; $i++) { - if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n"; - $tableBox_string .= ' table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters; - if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params']; - $tableBox_string .= '>' . "\n"; - - if (isset($contents[$i][0]) && is_array($contents[$i][0])) { - for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) { - if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) { - $tableBox_string .= ' table_data_parameters)) { - $tableBox_string .= ' ' . $this->table_data_parameters; - } - $tableBox_string .= '>'; - if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form']; - $tableBox_string .= $contents[$i][$x]['text']; - if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= ''; - $tableBox_string .= '
      ' . "\n"; - - if ($direct_output == true) echo $tableBox_string; - - return $tableBox_string; - } - } - - class infoBox extends tableBox { - function infoBox($contents) { - $info_box_contents = array(); - $info_box_contents[] = array('text' => $this->infoBoxContents($contents)); - $this->table_cellpadding = '1'; - $this->table_parameters = 'class="infoBox"'; - $this->tableBox($info_box_contents, true); - } - - function infoBoxContents($contents) { - $this->table_cellpadding = '3'; - $this->table_parameters = 'class="infoBoxContents"'; - $info_box_contents = array(); - $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); - for ($i=0, $n=sizeof($contents); $i<$n; $i++) { - $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''), - 'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''), - 'params' => 'class="boxText"', - 'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : ''))); - } - $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1'))); - return $this->tableBox($info_box_contents); - } - } - - class infoBoxHeading extends tableBox { - function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) { - $this->table_cellpadding = '0'; - - if ($left_corner == true) { - $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif'); - } else { - $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif'); - } - if ($right_arrow == true) { - $right_arrow = '' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . ''; - } else { - $right_arrow = ''; - } - if ($right_corner == true) { - $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif'); - } else { - $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14'); - } - - $info_box_contents = array(); - $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', - 'text' => $left_corner), - array('params' => 'width="100%" height="14" class="infoBoxHeading"', - 'text' => $contents[0]['text']), - array('params' => 'height="14" class="infoBoxHeading" nowrap', - 'text' => $right_corner)); - - $this->tableBox($info_box_contents, true); - } - } - - class contentBox extends tableBox { - function contentBox($contents) { - $info_box_contents = array(); - $info_box_contents[] = array('text' => $this->contentBoxContents($contents)); - $this->table_cellpadding = '1'; - $this->table_parameters = 'class="infoBox"'; - $this->tableBox($info_box_contents, true); - } - - function contentBoxContents($contents) { - $this->table_cellpadding = '4'; - $this->table_parameters = 'class="infoBoxContents"'; - return $this->tableBox($contents); - } - } - - class contentBoxHeading extends tableBox { - function contentBoxHeading($contents) { - $this->table_width = '100%'; - $this->table_cellpadding = '0'; - - $info_box_contents = array(); - $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', - 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')), - array('params' => 'height="14" class="infoBoxHeading" width="100%"', - 'text' => $contents[0]['text']), - array('params' => 'height="14" class="infoBoxHeading"', - 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif'))); - - $this->tableBox($info_box_contents, true); - } - } - - class errorBox extends tableBox { - function errorBox($contents) { - $this->table_data_parameters = 'class="errorBox"'; - $this->tableBox($contents, true); - } - } - - class productListingBox extends tableBox { - function productListingBox($contents) { - $this->table_parameters = 'class="productListing"'; - $this->tableBox($contents, true); - } - } -?> diff --git a/catalog/includes/classes/breadcrumb.php b/catalog/includes/classes/breadcrumb.php index 5ffe1ea60..baee4377d 100644 --- a/catalog/includes/classes/breadcrumb.php +++ b/catalog/includes/classes/breadcrumb.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -25,19 +25,22 @@ function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } - function trail($separator = ' - ') { - $trail_string = ''; + function trail($separator = NULL) { + $breadcrumb_count = 1; + + $trail_string = ''; + return $trail_string; } } diff --git a/catalog/includes/classes/category_tree.php b/catalog/includes/classes/category_tree.php new file mode 100644 index 000000000..823fd6fa6 --- /dev/null +++ b/catalog/includes/classes/category_tree.php @@ -0,0 +1,328 @@ +', + $parent_group_end_string = '', + $parent_group_apply_to_root = false, + $child_start_string = '
    • ', + $child_end_string = '
    • ', + $breadcrumb_separator = '_', + $breadcrumb_usage = true, + $spacer_string = '', + $spacer_multiplier = 1, + $follow_cpath = false, + $cpath_array = array(), + $cpath_start_string = '', + $cpath_end_string = ''; + + public function __construct() { + static $_category_tree_data; + + $OSCOM_Db = Registry::get('Db'); + + if ( isset($_category_tree_data) ) { + $this->_data = $_category_tree_data; + } else { + $Qcategories = $OSCOM_Db->prepare('select c.categories_id, c.parent_id, c.categories_image, cd.categories_name from :table_categories c, :table_categories_description cd where c.categories_id = cd.categories_id and cd.language_id = :language_id order by c.parent_id, c.sort_order, cd.categories_name'); + $Qcategories->bindInt(':language_id', $_SESSION['languages_id']); + $Qcategories->execute(); + + while ($Qcategories->fetch()) { + $this->_data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('name' => $Qcategories->value('categories_name'), + 'image' => $Qcategories->value('categories_image')); + } + + $_category_tree_data = $this->_data; + } + } + + protected function _buildBranch($parent_id, $level = 0) { + $result = ((($level === 0) && ($this->parent_group_apply_to_root === true)) || ($level > 0)) ? $this->parent_group_start_string : null; + + if ( isset($this->_data[$parent_id]) ) { + foreach ( $this->_data[$parent_id] as $category_id => $category ) { + if ( $this->breadcrumb_usage === true ) { + $category_link = $this->buildBreadcrumb($category_id); + } else { + $category_link = $category_id; + } + + $result .= $this->child_start_string; + + if ( isset($this->_data[$category_id]) ) { + $result .= $this->parent_start_string; + } + + if ( $level === 0 ) { + $result .= $this->root_start_string; + } + + if ( ($this->follow_cpath === true) && in_array($category_id, $this->cpath_array) ) { + $link_title = $this->cpath_start_string . $category['name'] . $this->cpath_end_string; + } else { + $link_title = $category['name']; + } + + $result .= ''; + $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level); + $result .= $link_title . ''; + + if ( $level === 0 ) { + $result .= $this->root_end_string; + } + + if ( isset($this->_data[$category_id]) ) { + $result .= $this->parent_end_string; + } + + + + if ( isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1)) ) { + if ( $this->follow_cpath === true ) { + if ( in_array($category_id, $this->cpath_array) ) { + $result .= $this->_buildBranch($category_id, $level+1); + } + } else { + $result .= $this->_buildBranch($category_id, $level+1); + } + } + + $result .= $this->child_end_string; + } + } + + $result .= ((($level === 0) && ($this->parent_group_apply_to_root === true)) || ($level > 0)) ? $this->parent_group_end_string : null; + + return $result; + } + + function buildBranchArray($parent_id, $level = 0, $result = '') { + if (empty($result)) { + $result = array(); + } + + if (isset($this->_data[$parent_id])) { + foreach ($this->_data[$parent_id] as $category_id => $category) { + if ($this->breadcrumb_usage == true) { + $category_link = $this->buildBreadcrumb($category_id); + } else { + $category_link = $category_id; + } + + $result[] = array('id' => $category_link, + 'title' => str_repeat($this->spacer_string, $this->spacer_multiplier * $level) . $category['name']); + + if (isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) { + if ($this->follow_cpath === true) { + if (in_array($category_id, $this->cpath_array)) { + $result = $this->buildBranchArray($category_id, $level+1, $result); + } + } else { + $result = $this->buildBranchArray($category_id, $level+1, $result); + } + } + } + } + + return $result; + } + + function buildBreadcrumb($category_id, $level = 0) { + $breadcrumb = ''; + + foreach ($this->_data as $parent => $categories) { + foreach ($categories as $id => $info) { + if ($id == $category_id) { + if ($level < 1) { + $breadcrumb = $id; + } else { + $breadcrumb = $id . $this->breadcrumb_separator . $breadcrumb; + } + + if ($parent != $this->root_category_id) { + $breadcrumb = $this->buildBreadcrumb($parent, $level+1) . $breadcrumb; + } + } + } + } + + return $breadcrumb; + } + +/** + * Return a formated string representation of the category structure relationship data + * + * @access public + * @return string + */ + + public function getTree() { + return $this->_buildBranch($this->root_category_id); + } + +/** + * Magic function; return a formated string representation of the category structure relationship data + * + * This is used when echoing the class object, eg: + * + * echo $osC_CategoryTree; + * + * @access public + * @return string + */ + + public function __toString() { + return $this->getTree(); + } + + function getArray($parent_id = '') { + return $this->buildBranchArray((empty($parent_id) ? $this->root_category_id : $parent_id)); + } + + function exists($id) { + foreach ($this->_data as $parent => $categories) { + foreach ($categories as $category_id => $info) { + if ($id == $category_id) { + return true; + } + } + } + + return false; + } + + function getChildren($category_id, &$array = array()) { + foreach ($this->_data as $parent => $categories) { + if ($parent == $category_id) { + foreach ($categories as $id => $info) { + $array[] = $id; + $this->getChildren($id, $array); + } + } + } + + return $array; + } + +/** + * Return category information + * + * @param int $id The category ID to return information of + * @param string $key The key information to return (since v3.0.2) + * @return mixed + * @since v3.0.0 + */ + + public function getData($id, $key = null) { + foreach ( $this->_data as $parent => $categories ) { + foreach ( $categories as $category_id => $info ) { + if ( $id == $category_id ) { + $data = array('id' => $id, + 'name' => $info['name'], + 'parent_id' => $parent, + 'image' => $info['image']); + + return ( isset($key) ? $data[$key] : $data ); + } + } + } + + return false; + } + +/** + * Return the parent ID of a category + * + * @param int $id The category ID to return the parent ID of + * @return int + * @since v3.0.2 + */ + + public function getParentID($id) { + return $this->getData($id, 'parent_id'); + } + + function setRootCategoryID($root_category_id) { + $this->root_category_id = $root_category_id; + } + + function setMaximumLevel($max_level) { + $this->max_level = $max_level; + } + + function setRootString($root_start_string, $root_end_string) { + $this->root_start_string = $root_start_string; + $this->root_end_string = $root_end_string; + } + + function setParentString($parent_start_string, $parent_end_string) { + $this->parent_start_string = $parent_start_string; + $this->parent_end_string = $parent_end_string; + } + + function setParentGroupString($parent_group_start_string, $parent_group_end_string, $apply_to_root = false) { + $this->parent_group_start_string = $parent_group_start_string; + $this->parent_group_end_string = $parent_group_end_string; + $this->parent_group_apply_to_root = $apply_to_root; + } + + function setChildString($child_start_string, $child_end_string) { + $this->child_start_string = $child_start_string; + $this->child_end_string = $child_end_string; + } + + function setBreadcrumbSeparator($breadcrumb_separator) { + $this->breadcrumb_separator = $breadcrumb_separator; + } + + function setBreadcrumbUsage($breadcrumb_usage) { + if ($breadcrumb_usage === true) { + $this->breadcrumb_usage = true; + } else { + $this->breadcrumb_usage = false; + } + } + + function setSpacerString($spacer_string, $spacer_multiplier = 2) { + $this->spacer_string = $spacer_string; + $this->spacer_multiplier = $spacer_multiplier; + } + + function setCategoryPath($cpath, $cpath_start_string = '', $cpath_end_string = '') { + $this->follow_cpath = true; + $this->cpath_array = explode($this->breadcrumb_separator, $cpath); + $this->cpath_start_string = $cpath_start_string; + $this->cpath_end_string = $cpath_end_string; + } + + function setFollowCategoryPath($follow_cpath) { + if ($follow_cpath === true) { + $this->follow_cpath = true; + } else { + $this->follow_cpath = false; + } + } + + function setCategoryPathString($cpath_start_string, $cpath_end_string) { + $this->cpath_start_string = $cpath_start_string; + $this->cpath_end_string = $cpath_end_string; + } + } + diff --git a/catalog/includes/classes/cc_validation.php b/catalog/includes/classes/cc_validation.php index 332b0a8f3..3dc056c43 100644 --- a/catalog/includes/classes/cc_validation.php +++ b/catalog/includes/classes/cc_validation.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ diff --git a/catalog/includes/classes/currencies.php b/catalog/includes/classes/currencies.php index 89aad3f61..9009b188e 100644 --- a/catalog/includes/classes/currencies.php +++ b/catalog/includes/classes/currencies.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + //// // Class to handle currencies // TABLES: currencies @@ -18,24 +20,26 @@ class currencies { // class constructor function currencies() { + $OSCOM_Db = Registry::get('Db'); + $this->currencies = array(); - $currencies_query = tep_db_query("select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from " . TABLE_CURRENCIES); - while ($currencies = tep_db_fetch_array($currencies_query)) { - $this->currencies[$currencies['code']] = array('title' => $currencies['title'], - 'symbol_left' => $currencies['symbol_left'], - 'symbol_right' => $currencies['symbol_right'], - 'decimal_point' => $currencies['decimal_point'], - 'thousands_point' => $currencies['thousands_point'], - 'decimal_places' => (int)$currencies['decimal_places'], - 'value' => $currencies['value']); + + $Qcurrencies = $OSCOM_Db->query('select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from :table_currencies'); + + while ($Qcurrencies->fetch()) { + $this->currencies[$Qcurrencies->value('code')] = array('title' => $Qcurrencies->value('title'), + 'symbol_left' => $Qcurrencies->value('symbol_left'), + 'symbol_right' => $Qcurrencies->value('symbol_right'), + 'decimal_point' => $Qcurrencies->value('decimal_point'), + 'thousands_point' => $Qcurrencies->value('thousands_point'), + 'decimal_places' => $Qcurrencies->valueInt('decimal_places'), + 'value' => $Qcurrencies->valueDecimal('value')); } } // class methods function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '') { - global $currency; - - if (empty($currency_type)) $currency_type = $currency; + if (empty($currency_type)) $currency_type = $_SESSION['currency']; if ($calculate_currency_value == true) { $rate = (tep_not_null($currency_value)) ? $currency_value : $this->currencies[$currency_type]['value']; @@ -48,9 +52,7 @@ function format($number, $calculate_currency_value = true, $currency_type = '', } function calculate_price($products_price, $products_tax, $quantity = 1) { - global $currency; - - return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity; + return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$_SESSION['currency']]['decimal_places']) * $quantity; } function is_set($code) { diff --git a/catalog/includes/classes/email.php b/catalog/includes/classes/email.php index e67a327d9..8e078d540 100644 --- a/catalog/includes/classes/email.php +++ b/catalog/includes/classes/email.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License @@ -68,8 +68,7 @@ function email($headers = '') { $this->headers[] = 'MIME-Version: 1.0'; - reset($headers); - while (list(,$value) = each($headers)) { + foreach($headers as $value) { if (tep_not_null($value)) { $this->headers[] = $value; } @@ -113,9 +112,8 @@ function get_file($filename) { function find_html_images($images_dir) { // Build the list of image extensions - while (list($key, ) = each($this->image_types)) { - $extensions[] = $key; - } + + $extensions[] = array_keys( $this->image_types); preg_match_all('/"([^"]+\.(' . implode('|', $extensions).'))"/Ui', $this->html, $images); @@ -189,8 +187,6 @@ function add_attachment($file, $name = '', $c_type='application/octet-stream', $ * Adds a text subpart to a mime_part object */ -/* HPDL PHP3 */ -// function &add_text_part(&$obj, $text) { function add_text_part(&$obj, $text) { $params['content_type'] = 'text/plain'; $params['encoding'] = $this->build_params['text_encoding']; @@ -207,8 +203,6 @@ function add_text_part(&$obj, $text) { * Adds a html subpart to a mime_part object */ -/* HPDL PHP3 */ -// function &add_html_part(&$obj) { function add_html_part(&$obj) { $params['content_type'] = 'text/html'; $params['encoding'] = $this->build_params['html_encoding']; @@ -225,8 +219,6 @@ function add_html_part(&$obj) { * Starts a message with a mixed part */ -/* HPDL PHP3 */ -// function &add_mixed_part() { function add_mixed_part() { $params['content_type'] = 'multipart/mixed'; @@ -237,8 +229,6 @@ function add_mixed_part() { * Adds an alternative part to a mime_part object */ -/* HPDL PHP3 */ -// function &add_alternative_part(&$obj) { function add_alternative_part(&$obj) { $params['content_type'] = 'multipart/alternative'; @@ -253,8 +243,6 @@ function add_alternative_part(&$obj) { * Adds a html subpart to a mime_part object */ -/* HPDL PHP3 */ -// function &add_related_part(&$obj) { function add_related_part(&$obj) { $params['content_type'] = 'multipart/related'; @@ -269,8 +257,6 @@ function add_related_part(&$obj) { * Adds an html image subpart to a mime_part object */ -/* HPDL PHP3 */ -// function &add_html_image_part(&$obj, $value) { function add_html_image_part(&$obj, $value) { $params['content_type'] = $value['c_type']; $params['encoding'] = 'base64'; @@ -285,8 +271,6 @@ function add_html_image_part(&$obj, $value) { * Adds an attachment subpart to a mime_part object */ -/* HPDL PHP3 */ -// function &add_attachment_part(&$obj, $value) { function add_attachment_part(&$obj, $value) { $params['content_type'] = $value['c_type']; $params['encoding'] = $value['encoding']; @@ -316,21 +300,17 @@ function add_attachment_part(&$obj, $value) { * - Default is iso-8859-1 */ -/* HPDL PHP3 */ -// function build_message($params = array()) { function build_message($params = '') { if ($params == '') $params = array(); - if (count($params) > 0) { - reset($params); - while(list($key, $value) = each($params)) { + if (!empty($params)) { + foreach($params as $key => $value) { $this->build_params[$key] = $value; } } if (tep_not_null($this->html_images)) { - reset($this->html_images); - while (list(,$value) = each($this->html_images)) { + foreach($this->html_images as $value) { $this->html = str_replace($value['name'], 'cid:' . $value['cid'], $this->html); } } @@ -343,13 +323,9 @@ function build_message($params = '') { switch (true) { case (($text == true) && ($attachments == false)): -/* HPDL PHP3 */ -// $message =& $this->add_text_part($null, $this->text); $message = $this->add_text_part($null, $this->text); break; case (($text == false) && ($attachments == true) && ($html == false)): -/* HPDL PHP3 */ -// $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); for ($i=0; $iattachments); $i++) { @@ -357,8 +333,6 @@ function build_message($params = '') { } break; case (($text == true) && ($attachments == true)): -/* HPDL PHP3 */ -// $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); $this->add_text_part($message, $this->text); @@ -368,30 +342,19 @@ function build_message($params = '') { break; case (($html == true) && ($attachments == false) && ($html_images == false)): if (tep_not_null($this->html_text)) { -/* HPDL PHP3 */ -// $message =& $this->add_alternative_part($null); $message = $this->add_alternative_part($null); $this->add_text_part($message, $this->html_text); $this->add_html_part($message); } else { -/* HPDL PHP3 */ -// $message =& $this->add_html_part($null); $message = $this->add_html_part($null); } break; case (($html == true) && ($attachments == false) && ($html_images == true)): if (tep_not_null($this->html_text)) { -/* HPDL PHP3 */ -// $message =& $this->add_alternative_part($null); $message = $this->add_alternative_part($null); $this->add_text_part($message, $this->html_text); -/* HPDL PHP3 */ -// $related =& $this->add_related_part($message); $related = $this->add_related_part($message); } else { -/* HPDL PHP3 */ -// $message =& $this->add_related_part($null); -// $related =& $message; $message = $this->add_related_part($null); $related = $message; } @@ -402,12 +365,8 @@ function build_message($params = '') { } break; case (($html == true) && ($attachments == true) && ($html_images == false)): -/* HPDL PHP3 */ -// $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); if (tep_not_null($this->html_text)) { -/* HPDL PHP3 */ -// $alt =& $this->add_alternative_part($message); $alt = $this->add_alternative_part($message); $this->add_text_part($alt, $this->html_text); $this->add_html_part($alt); @@ -420,21 +379,13 @@ function build_message($params = '') { } break; case (($html == true) && ($attachments == true) && ($html_images == true)): -/* HPDL PHP3 */ -// $message =& $this->add_mixed_part(); $message = $this->add_mixed_part(); if (tep_not_null($this->html_text)) { -/* HPDL PHP3 */ -// $alt =& $this->add_alternative_part($message); $alt = $this->add_alternative_part($message); $this->add_text_part($alt, $this->html_text); -/* HPDL PHP3 */ -// $rel =& $this->add_related_part($alt); $rel = $this->add_related_part($alt); } else { -/* HPDL PHP3 */ -// $rel =& $this->add_related_part($message); $rel = $this->add_related_part($message); } $this->add_html_part($rel); @@ -453,8 +404,7 @@ function build_message($params = '') { $output = $message->encode(); $this->output = $output['body']; - reset($output['headers']); - while (list($key, $value) = each($output['headers'])) { + foreach($output['headers'] as $key => $value) { $headers[] = $key . ': ' . $value; } diff --git a/catalog/includes/classes/http_client.php b/catalog/includes/classes/http_client.php index 22b584ea7..568633b50 100644 --- a/catalog/includes/classes/http_client.php +++ b/catalog/includes/classes/http_client.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License @@ -100,8 +100,7 @@ function setCredentials($username, $password) { **/ function setHeaders($headers) { if (is_array($headers)) { - reset($headers); - while (list($name, $value) = each($headers)) { + foreach($headers as $name => $value) { $this->requestHeaders[$name] = $value; } } @@ -202,8 +201,7 @@ function Post($uri, $query_params = '') { if (is_array($query_params)) { $postArray = array(); - reset($query_params); - while (list($k, $v) = each($query_params)) { + foreach($query_params as $k => $v) { $postArray[] = urlencode($k) . '=' . urlencode($v); } @@ -338,8 +336,7 @@ function sendCommand($command) { $this->request = $command; $cmd = $command . "\r\n"; if (is_array($this->requestHeaders)) { - reset($this->requestHeaders); - while (list($k, $v) = each($this->requestHeaders)) { + foreach($this->requestHeaders as $k => $v) { $cmd .= $k . ': ' . $v . "\r\n"; } } @@ -456,4 +453,4 @@ function makeUri($uri) { return $requesturi; } } -?> \ No newline at end of file +?> diff --git a/catalog/includes/classes/language.php b/catalog/includes/classes/language.php index 4ae106504..600ef6273 100644 --- a/catalog/includes/classes/language.php +++ b/catalog/includes/classes/language.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License @@ -13,11 +13,17 @@ Copyright Stephane Garin (detect_language.php v0.1 04/02/2002) */ + use OSC\OM\Registry; + class language { var $languages, $catalog_languages, $browser_languages, $language; function language($lng = '') { - $this->languages = array('ar' => 'ar([-_][[:alpha:]]{2})?|arabic', + $OSCOM_Db = Registry::get('Db'); + + $this->languages = array('af' => 'af|afrikaans', + 'ar' => 'ar([-_][[:alpha:]]{2})?|arabic', + 'be' => 'be|belarusian', 'bg' => 'bg|bulgarian', 'br' => 'pt[-_]br|brazilian portuguese', 'ca' => 'ca|catalan', @@ -28,10 +34,16 @@ function language($lng = '') { 'en' => 'en([-_][[:alpha:]]{2})?|english', 'es' => 'es([-_][[:alpha:]]{2})?|spanish', 'et' => 'et|estonian', + 'eu' => 'eu|basque', + 'fa' => 'fa|farsi', 'fi' => 'fi|finnish', + 'fo' => 'fo|faeroese', 'fr' => 'fr([-_][[:alpha:]]{2})?|french', + 'ga' => 'ga|irish', 'gl' => 'gl|galician', 'he' => 'he|hebrew', + 'hi' => 'hi|hindi', + 'hr' => 'hr|croatian', 'hu' => 'hu|hungarian', 'id' => 'id|indonesian', 'it' => 'it|italian', @@ -40,6 +52,9 @@ function language($lng = '') { 'ka' => 'ka|georgian', 'lt' => 'lt|lithuanian', 'lv' => 'lv|latvian', + 'mk' => 'mk|macedonian', + 'mt' => 'mt|maltese', + 'ms' => 'ms|malaysian', 'nl' => 'nl([-_][[:alpha:]]{2})?|dutch', 'no' => 'no|norwegian', 'pl' => 'pl|polish', @@ -47,21 +62,32 @@ function language($lng = '') { 'ro' => 'ro|romanian', 'ru' => 'ru|russian', 'sk' => 'sk|slovak', + 'sq' => 'sq|albanian', 'sr' => 'sr|serbian', 'sv' => 'sv|swedish', + 'sz' => 'sz|sami', + 'sx' => 'sx|sutu', 'th' => 'th|thai', + 'ts' => 'ts|tsonga', 'tr' => 'tr|turkish', + 'tn' => 'tn|tswana', 'uk' => 'uk|ukrainian', + 'ur' => 'ur|urdu', + 'vi' => 'vi|vietnamese', 'tw' => 'zh[-_]tw|chinese traditional', - 'zh' => 'zh|chinese simplified'); + 'zh' => 'zh|chinese simplified', + 'ji' => 'ji|yiddish', + 'zu' => 'zu|zulu'); $this->catalog_languages = array(); - $languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order"); - while ($languages = tep_db_fetch_array($languages_query)) { - $this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'], - 'name' => $languages['name'], - 'image' => $languages['image'], - 'directory' => $languages['directory']); + + $Qlanguages = $OSCOM_Db->query('select languages_id, name, code, image, directory from :table_languages order by sort_order'); + + while ($Qlanguages->fetch()) { + $this->catalog_languages[$Qlanguages->value('code')] = array('id' => $Qlanguages->valueInt('languages_id'), + 'name' => $Qlanguages->value('name'), + 'image' => $Qlanguages->value('image'), + 'directory' => $Qlanguages->value('directory')); } $this->browser_languages = ''; @@ -79,16 +105,19 @@ function set_language($language) { } function get_browser_language() { - $this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE')); - - for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) { - reset($this->languages); - while (list($key, $value) = each($this->languages)) { - if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) { - $this->language = $this->catalog_languages[$key]; - break 2; + if ( isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ){ + $this->browser_languages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + + for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) { + foreach($this->languages as $key => $value) { + if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) { + $this->language = $this->catalog_languages[$key]; + break 2; + } } } + } else { + return false; } } } diff --git a/catalog/includes/classes/message_stack.php b/catalog/includes/classes/message_stack.php index 61045585c..f44585c04 100644 --- a/catalog/includes/classes/message_stack.php +++ b/catalog/includes/classes/message_stack.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License @@ -17,7 +17,7 @@ if ($messageStack->size('general') > 0) echo $messageStack->output('general'); */ - class messageStack extends tableBox { + class messageStack extends alertBlock { // class constructor function messageStack() { @@ -25,36 +25,36 @@ function messageStack() { $this->messages = array(); - if (tep_session_is_registered('messageToStack')) { - for ($i=0, $n=sizeof($messageToStack); $i<$n; $i++) { - $this->add($messageToStack[$i]['class'], $messageToStack[$i]['text'], $messageToStack[$i]['type']); + if (isset($_SESSION['messageToStack'])) { + for ($i=0, $n=sizeof($_SESSION['messageToStack']); $i<$n; $i++) { + $this->add($_SESSION['messageToStack'][$i]['class'], $_SESSION['messageToStack'][$i]['text'], $_SESSION['messageToStack'][$i]['type']); } - tep_session_unregister('messageToStack'); + unset($_SESSION['messageToStack']); } } // class methods function add($class, $message, $type = 'error') { if ($type == 'error') { - $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . ' ' . $message); + $this->messages[] = array('params' => 'class="alert alert-danger"', 'class' => $class, 'text' => $message); } elseif ($type == 'warning') { - $this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message); + $this->messages[] = array('params' => 'class="alert alert-warning"', 'class' => $class, 'text' => $message); } elseif ($type == 'success') { - $this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => tep_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . $message); + $this->messages[] = array('params' => 'class="alert alert-success"', 'class' => $class, 'text' => $message); } else { - $this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message); + $this->messages[] = array('params' => 'class="alert alert-info"', 'class' => $class, 'text' => $message); } } function add_session($class, $message, $type = 'error') { - global $messageToStack; - if (!tep_session_is_registered('messageToStack')) { - tep_session_register('messageToStack'); - $messageToStack = array(); + + if (!isset($_SESSION['messageToStack'])) { + $_SESSION['messageToStack'] = array(); + } - $messageToStack[] = array('class' => $class, 'text' => $message, 'type' => $type); + $_SESSION['messageToStack'][] = array('class' => $class, 'text' => $message, 'type' => $type); } function reset() { @@ -62,7 +62,6 @@ function reset() { } function output($class) { - $this->table_data_parameters = 'class="messageBox"'; $output = array(); for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) { @@ -71,7 +70,7 @@ function output($class) { } } - return $this->tableBox($output); + return $this->alertBlock($output); } function size($class) { @@ -86,4 +85,3 @@ function size($class) { return $count; } } -?> diff --git a/catalog/includes/classes/mime.php b/catalog/includes/classes/mime.php index e2705fe3f..a8801fcd2 100644 --- a/catalog/includes/classes/mime.php +++ b/catalog/includes/classes/mime.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce mime.php - a class to assist in building mime-HTML eMails @@ -48,8 +48,7 @@ function mime($body, $params = '') { $this->lf = "\n"; } - reset($params); - while (list($key, $value) = each($params)) { + foreach($params as $key => $value) { switch ($key) { case 'content_type': $headers['Content-Type'] = $value . (isset($charset) ? '; charset="' . $charset . '"' : ''); @@ -91,8 +90,6 @@ function mime($body, $params = '') { // Assign stuff to member variables $this->_encoded = array(); -/* HPDL PHP3 */ -// $this->_headers =& $headers; $this->_headers = $headers; $this->_body = $body; } @@ -110,8 +107,6 @@ function mime($body, $params = '') { */ function encode() { -/* HPDL PHP3 */ -// $encoded =& $this->_encoded; $encoded = $this->_encoded; if (tep_not_null($this->_subparts)) { @@ -121,13 +116,10 @@ function encode() { // Add body parts to $subparts for ($i=0; $i_subparts); $i++) { $headers = array(); -/* HPDL PHP3 */ -// $tmp = $this->_subparts[$i]->encode(); $_subparts = $this->_subparts[$i]; $tmp = $_subparts->encode(); - reset($tmp['headers']); - while (list($key, $value) = each($tmp['headers'])) { + foreach($tmp['headers'] as $key => $value) { $headers[] = $key . ': ' . $value; } @@ -140,10 +132,7 @@ function encode() { } // Add headers to $encoded -/* HPDL PHP3 */ -// $encoded['headers'] =& $this->_headers; $encoded['headers'] = $this->_headers; - return $encoded; } @@ -163,11 +152,8 @@ function encode() { * @access public */ -/* HPDL PHP3 */ -// function &addSubPart($body, $params) { function addSubPart($body, $params) { $this->_subparts[] = new mime($body, $params); - return $this->_subparts[count($this->_subparts) - 1]; } @@ -214,7 +200,7 @@ function _quotedPrintableEncode($input , $line_max = 76) { $escape = '='; $output = ''; - while (list(, $line) = each($lines)) { + foreach($lines as $line) { $linlen = strlen($line); $newline = ''; diff --git a/catalog/includes/classes/navigation_history.php b/catalog/includes/classes/navigation_history.php index 596cca004..5ef5a6a0f 100644 --- a/catalog/includes/classes/navigation_history.php +++ b/catalog/includes/classes/navigation_history.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -23,7 +23,7 @@ function reset() { } function add_current_page() { - global $PHP_SELF, $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type, $cPath; + global $PHP_SELF, $request_type, $cPath; $set = 'true'; for ($i=0, $n=sizeof($this->path); $i<$n; $i++) { @@ -60,8 +60,8 @@ function add_current_page() { if ($set == 'true') { $this->path[] = array('page' => $PHP_SELF, 'mode' => $request_type, - 'get' => $this->filter_parameters($HTTP_GET_VARS), - 'post' => $this->filter_parameters($HTTP_POST_VARS)); + 'get' => $this->filter_parameters($_GET), + 'post' => $this->filter_parameters($_POST)); } } @@ -75,7 +75,7 @@ function remove_current_page() { } function set_snapshot($page = '') { - global $PHP_SELF, $HTTP_GET_VARS, $HTTP_POST_VARS, $request_type; + global $PHP_SELF, $request_type; if (is_array($page)) { $this->snapshot = array('page' => $page['page'], @@ -85,8 +85,8 @@ function set_snapshot($page = '') { } else { $this->snapshot = array('page' => $PHP_SELF, 'mode' => $request_type, - 'get' => $this->filter_parameters($HTTP_GET_VARS), - 'post' => $this->filter_parameters($HTTP_POST_VARS)); + 'get' => $this->filter_parameters($_GET), + 'post' => $this->filter_parameters($_POST)); } } @@ -105,12 +105,12 @@ function set_path_as_snapshot($history = 0) { function debug() { for ($i=0, $n=sizeof($this->path); $i<$n; $i++) { echo $this->path[$i]['page'] . '?'; - while (list($key, $value) = each($this->path[$i]['get'])) { + foreach($this->path[$i]['get'] as $key => $value) { echo $key . '=' . $value . '&'; } if (sizeof($this->path[$i]['post']) > 0) { echo '
      '; - while (list($key, $value) = each($this->path[$i]['post'])) { + foreach($this->path[$i]['post'] as $key => $value) { echo '  ' . $key . '=' . $value . '
      '; } } @@ -120,7 +120,7 @@ function debug() { if (sizeof($this->snapshot) > 0) { echo '

      '; - echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . tep_array_to_string($this->snapshot['get'], array(tep_session_name())) . '
      '; + echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . tep_array_to_string($this->snapshot['get'], array(session_name())) . '
      '; } } @@ -128,8 +128,7 @@ function filter_parameters($parameters) { $clean = array(); if (is_array($parameters)) { - reset($parameters); - while (list($key, $value) = each($parameters)) { + foreach($parameters as $key => $value) { if (strpos($key, '_nh-dns') < 1) { $clean[$key] = $value; } diff --git a/catalog/includes/classes/order.php b/catalog/includes/classes/order.php index 423b5c393..ce7cf55a8 100644 --- a/catalog/includes/classes/order.php +++ b/catalog/includes/classes/order.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2007 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class order { var $info, $totals, $products, $customer, $delivery, $content_type; @@ -28,100 +30,119 @@ function order($order_id = '') { } function query($order_id) { - global $languages_id; + $OSCOM_Db = Registry::get('Db'); + + $order_total = $shipping_title = ''; + + $Qorder = $OSCOM_Db->prepare('select * from :table_orders where orders_id = :orders_id'); + $Qorder->bindInt(':orders_id', $order_id); + $Qorder->execute(); - $order_id = tep_db_prepare_input($order_id); + $Qtotals = $OSCOM_Db->prepare('select title, text, class from :table_orders_total where orders_id = :orders_id order by sort_order'); + $Qtotals->bindInt(':orders_id', $order_id); + $Qtotals->execute(); - $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); - $order = tep_db_fetch_array($order_query); + while ($Qtotals->fetch()) { + $this->totals[] = array('title' => $Qtotals->value('title'), + 'text' => $Qtotals->value('text')); - $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order"); - while ($totals = tep_db_fetch_array($totals_query)) { - $this->totals[] = array('title' => $totals['title'], - 'text' => $totals['text']); + if ($Qtotals->value('class') == 'ot_total') { + $order_total = strip_tags($Qtotals->value('text')); + } elseif ($Qtotals->value('class') == 'ot_shipping') { + $shipping_title = strip_tags($Qtotals->value('title')); + + if (substr($shipping_title, -1) == ':') { + $shipping_title = substr($shipping_title, 0, -1); + } + } } - $order_total_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'"); - $order_total = tep_db_fetch_array($order_total_query); - - $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'"); - $shipping_method = tep_db_fetch_array($shipping_method_query); - - $order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int)$languages_id . "'"); - $order_status = tep_db_fetch_array($order_status_query); - - $this->info = array('currency' => $order['currency'], - 'currency_value' => $order['currency_value'], - 'payment_method' => $order['payment_method'], - 'cc_type' => $order['cc_type'], - 'cc_owner' => $order['cc_owner'], - 'cc_number' => $order['cc_number'], - 'cc_expires' => $order['cc_expires'], - 'date_purchased' => $order['date_purchased'], - 'orders_status' => $order_status['orders_status_name'], - 'last_modified' => $order['last_modified'], - 'total' => strip_tags($order_total['text']), - 'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']))); - - $this->customer = array('id' => $order['customers_id'], - 'name' => $order['customers_name'], - 'company' => $order['customers_company'], - 'street_address' => $order['customers_street_address'], - 'suburb' => $order['customers_suburb'], - 'city' => $order['customers_city'], - 'postcode' => $order['customers_postcode'], - 'state' => $order['customers_state'], - 'country' => array('title' => $order['customers_country']), - 'format_id' => $order['customers_address_format_id'], - 'telephone' => $order['customers_telephone'], - 'email_address' => $order['customers_email_address']); - - $this->delivery = array('name' => trim($order['delivery_name']), - 'company' => $order['delivery_company'], - 'street_address' => $order['delivery_street_address'], - 'suburb' => $order['delivery_suburb'], - 'city' => $order['delivery_city'], - 'postcode' => $order['delivery_postcode'], - 'state' => $order['delivery_state'], - 'country' => array('title' => $order['delivery_country']), - 'format_id' => $order['delivery_address_format_id']); + $Qstatus = $OSCOM_Db->prepare('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id'); + $Qstatus->bindInt(':orders_status_id', $Qorder->valueInt('orders_status')); + $Qstatus->bindInt(':language_id', $_SESSION['languages_id']); + $Qstatus->execute(); + + $this->info = array('currency' => $Qorder->value('currency'), + 'currency_value' => $Qorder->valueDecimal('currency_value'), + 'payment_method' => $Qorder->value('payment_method'), + 'cc_type' => $Qorder->value('cc_type'), + 'cc_owner' => $Qorder->value('cc_owner'), + 'cc_number' => $Qorder->value('cc_number'), + 'cc_expires' => $Qorder->value('cc_expires'), + 'date_purchased' => $Qorder->value('date_purchased'), + 'orders_status' => $Qstatus->value('orders_status_name'), + 'last_modified' => $Qorder->value('last_modified'), + 'total' => $order_total, + 'shipping_method' => $shipping_title); + + $this->customer = array('id' => $Qorder->valueInt('customers_id'), + 'name' => $Qorder->value('customers_name'), + 'company' => $Qorder->value('customers_company'), + 'street_address' => $Qorder->value('customers_street_address'), + 'suburb' => $Qorder->value('customers_suburb'), + 'city' => $Qorder->value('customers_city'), + 'postcode' => $Qorder->value('customers_postcode'), + 'state' => $Qorder->value('customers_state'), + 'country' => array('title' => $Qorder->value('customers_country')), + 'format_id' => $Qorder->valueInt('customers_address_format_id'), + 'telephone' => $Qorder->value('customers_telephone'), + 'email_address' => $Qorder->value('customers_email_address')); + + $this->delivery = array('name' => $Qorder->value('delivery_name'), + 'company' => $Qorder->value('delivery_company'), + 'street_address' => $Qorder->value('delivery_street_address'), + 'suburb' => $Qorder->value('delivery_suburb'), + 'city' => $Qorder->value('delivery_city'), + 'postcode' => $Qorder->value('delivery_postcode'), + 'state' => $Qorder->value('delivery_state'), + 'country' => array('title' => $Qorder->value('delivery_country')), + 'format_id' => $Qorder->valueInt('delivery_address_format_id')); if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) { $this->delivery = false; } - $this->billing = array('name' => $order['billing_name'], - 'company' => $order['billing_company'], - 'street_address' => $order['billing_street_address'], - 'suburb' => $order['billing_suburb'], - 'city' => $order['billing_city'], - 'postcode' => $order['billing_postcode'], - 'state' => $order['billing_state'], - 'country' => array('title' => $order['billing_country']), - 'format_id' => $order['billing_address_format_id']); + $this->billing = array('name' => $Qorder->value('billing_name'), + 'company' => $Qorder->value('billing_company'), + 'street_address' => $Qorder->value('billing_street_address'), + 'suburb' => $Qorder->value('billing_suburb'), + 'city' => $Qorder->value('billing_city'), + 'postcode' => $Qorder->value('billing_postcode'), + 'state' => $Qorder->value('billing_state'), + 'country' => array('title' => $Qorder->value('billing_country')), + 'format_id' => $Qorder->valueInt('billing_address_format_id')); $index = 0; - $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'"); - while ($orders_products = tep_db_fetch_array($orders_products_query)) { - $this->products[$index] = array('qty' => $orders_products['products_quantity'], - 'id' => $orders_products['products_id'], - 'name' => $orders_products['products_name'], - 'model' => $orders_products['products_model'], - 'tax' => $orders_products['products_tax'], - 'price' => $orders_products['products_price'], - 'final_price' => $orders_products['final_price']); + + $Qproducts = $OSCOM_Db->prepare('select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from :table_orders_products where orders_id = :orders_id'); + $Qproducts->bindInt(':orders_id', $order_id); + $Qproducts->execute(); + + while ($Qproducts->fetch()) { + $this->products[$index] = array('qty' => $Qproducts->valueInt('products_quantity'), + 'id' => $Qproducts->valueInt('products_id'), + 'name' => $Qproducts->value('products_name'), + 'model' => $Qproducts->value('products_model'), + 'tax' => $Qproducts->valueDecimal('products_tax'), + 'price' => $Qproducts->valueDecimal('products_price'), + 'final_price' => $Qproducts->valueDecimal('final_price')); $subindex = 0; - $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'"); - if (tep_db_num_rows($attributes_query)) { - while ($attributes = tep_db_fetch_array($attributes_query)) { - $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], - 'value' => $attributes['products_options_values'], - 'prefix' => $attributes['price_prefix'], - 'price' => $attributes['options_values_price']); + + $Qattributes = $OSCOM_Db->prepare('select products_options, products_options_values, options_values_price, price_prefix from :table_orders_products_attributes where orders_id = :orders_id and orders_products_id = :orders_products_id'); + $Qattributes->bindInt(':orders_id', $order_id); + $Qattributes->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id')); + $Qattributes->execute(); + + if ($Qattributes->fetch() !== false) { + do { + $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options'), + 'value' => $Qattributes->value('products_options_values'), + 'prefix' => $Qattributes->value('price_prefix'), + 'price' => $Qattributes->valueDecimal('options_values_price')); $subindex++; - } + } while ($Qattributes->fetch()); } $this->info['tax_groups']["{$this->products[$index]['tax']}"] = '1'; @@ -131,76 +152,110 @@ function query($order_id) { } function cart() { - global $HTTP_POST_VARS, $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment, $comments, $customer_default_address_id; + global $currencies; - $this->content_type = $cart->get_content_type(); + $OSCOM_Db = Registry::get('Db'); - if ( ($this->content_type != 'virtual') && ($sendto == false) ) { - $sendto = $customer_default_address_id; + $this->content_type = $_SESSION['cart']->get_content_type(); + + if ( ($this->content_type != 'virtual') && ($_SESSION['sendto'] == false) ) { + $_SESSION['sendto'] = $_SESSION['customer_default_address_id']; } - $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$customer_id . "' and ab.customers_id = '" . (int)$customer_id . "' and c.customers_default_address_id = ab.address_book_id"); - $customer_address = tep_db_fetch_array($customer_address_query); - - if (is_array($sendto) && !empty($sendto)) { - $shipping_address = array('entry_firstname' => $sendto['firstname'], - 'entry_lastname' => $sendto['lastname'], - 'entry_company' => $sendto['company'], - 'entry_street_address' => $sendto['street_address'], - 'entry_suburb' => $sendto['suburb'], - 'entry_postcode' => $sendto['postcode'], - 'entry_city' => $sendto['city'], - 'entry_zone_id' => $sendto['zone_id'], - 'zone_name' => $sendto['zone_name'], - 'entry_country_id' => $sendto['country_id'], - 'countries_id' => $sendto['country_id'], - 'countries_name' => $sendto['country_name'], - 'countries_iso_code_2' => $sendto['country_iso_code_2'], - 'countries_iso_code_3' => $sendto['country_iso_code_3'], - 'address_format_id' => $sendto['address_format_id'], - 'entry_state' => $sendto['zone_name']); - } elseif (is_numeric($sendto)) { - $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'"); - $shipping_address = tep_db_fetch_array($shipping_address_query); - } else { - $shipping_address = array('entry_firstname' => null, - 'entry_lastname' => null, - 'entry_company' => null, - 'entry_street_address' => null, - 'entry_suburb' => null, - 'entry_postcode' => null, - 'entry_city' => null, - 'entry_zone_id' => null, - 'zone_name' => null, - 'entry_country_id' => null, - 'countries_id' => null, - 'countries_name' => null, - 'countries_iso_code_2' => null, - 'countries_iso_code_3' => null, - 'address_format_id' => 0, - 'entry_state' => null); + $Qcustomer = $OSCOM_Db->prepare('select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from :table_customers c, :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries co on (ab.entry_country_id = co.countries_id) where c.customers_id = :customers_id and c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id'); + $Qcustomer->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcustomer->execute(); + + $customer_address = $Qcustomer->toArray(); + + $shipping_address = array('entry_firstname' => null, + 'entry_lastname' => null, + 'entry_company' => null, + 'entry_street_address' => null, + 'entry_suburb' => null, + 'entry_postcode' => null, + 'entry_city' => null, + 'entry_zone_id' => null, + 'zone_name' => null, + 'entry_country_id' => null, + 'countries_id' => null, + 'countries_name' => null, + 'countries_iso_code_2' => null, + 'countries_iso_code_3' => null, + 'address_format_id' => 0, + 'entry_state' => null); + + if (isset($_SESSION['sendto'])) { + if (is_array($_SESSION['sendto']) && !empty($_SESSION['sendto'])) { + $shipping_address = array('entry_firstname' => $_SESSION['sendto']['firstname'], + 'entry_lastname' => $_SESSION['sendto']['lastname'], + 'entry_company' => $_SESSION['sendto']['company'], + 'entry_street_address' => $_SESSION['sendto']['street_address'], + 'entry_suburb' => $_SESSION['sendto']['suburb'], + 'entry_postcode' => $_SESSION['sendto']['postcode'], + 'entry_city' => $_SESSION['sendto']['city'], + 'entry_zone_id' => $_SESSION['sendto']['zone_id'], + 'zone_name' => $_SESSION['sendto']['zone_name'], + 'entry_country_id' => $_SESSION['sendto']['country_id'], + 'countries_id' => $_SESSION['sendto']['country_id'], + 'countries_name' => $_SESSION['sendto']['country_name'], + 'countries_iso_code_2' => $_SESSION['sendto']['country_iso_code_2'], + 'countries_iso_code_3' => $_SESSION['sendto']['country_iso_code_3'], + 'address_format_id' => $_SESSION['sendto']['address_format_id'], + 'entry_state' => $_SESSION['sendto']['zone_name']); + } elseif (is_numeric($_SESSION['sendto'])) { + $Qaddress = $OSCOM_Db->prepare('select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries c on (ab.entry_country_id = c.countries_id) where ab.customers_id = :customers_id and ab.address_book_id = :address_book_id'); + $Qaddress->bindInt(':customers_id', $_SESSION['customer_id']); + $Qaddress->bindInt(':address_book_id', $_SESSION['sendto']); + $Qaddress->execute(); + + $shipping_address = $Qaddress->toArray(); + } } - if (is_array($billto) && !empty($billto)) { - $billing_address = array('entry_firstname' => $billto['firstname'], - 'entry_lastname' => $billto['lastname'], - 'entry_company' => $billto['company'], - 'entry_street_address' => $billto['street_address'], - 'entry_suburb' => $billto['suburb'], - 'entry_postcode' => $billto['postcode'], - 'entry_city' => $billto['city'], - 'entry_zone_id' => $billto['zone_id'], - 'zone_name' => $billto['zone_name'], - 'entry_country_id' => $billto['country_id'], - 'countries_id' => $billto['country_id'], - 'countries_name' => $billto['country_name'], - 'countries_iso_code_2' => $billto['country_iso_code_2'], - 'countries_iso_code_3' => $billto['country_iso_code_3'], - 'address_format_id' => $billto['address_format_id'], - 'entry_state' => $billto['zone_name']); - } else { - $billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$billto . "'"); - $billing_address = tep_db_fetch_array($billing_address_query); + $billing_address = array('entry_firstname' => null, + 'entry_lastname' => null, + 'entry_company' => null, + 'entry_street_address' => null, + 'entry_suburb' => null, + 'entry_postcode' => null, + 'entry_city' => null, + 'entry_zone_id' => null, + 'zone_name' => null, + 'entry_country_id' => null, + 'countries_id' => null, + 'countries_name' => null, + 'countries_iso_code_2' => null, + 'countries_iso_code_3' => null, + 'address_format_id' => 0, + 'entry_state' => null); + + if (isset($_SESSION['billto'])) { + if (is_array($_SESSION['billto']) && !empty($_SESSION['billto'])) { + $billing_address = array('entry_firstname' => $_SESSION['billto']['firstname'], + 'entry_lastname' => $_SESSION['billto']['lastname'], + 'entry_company' => $_SESSION['billto']['company'], + 'entry_street_address' => $_SESSION['billto']['street_address'], + 'entry_suburb' => $_SESSION['billto']['suburb'], + 'entry_postcode' => $_SESSION['billto']['postcode'], + 'entry_city' => $_SESSION['billto']['city'], + 'entry_zone_id' => $_SESSION['billto']['zone_id'], + 'zone_name' => $_SESSION['billto']['zone_name'], + 'entry_country_id' => $_SESSION['billto']['country_id'], + 'countries_id' => $_SESSION['billto']['country_id'], + 'countries_name' => $_SESSION['billto']['country_name'], + 'countries_iso_code_2' => $_SESSION['billto']['country_iso_code_2'], + 'countries_iso_code_3' => $_SESSION['billto']['country_iso_code_3'], + 'address_format_id' => $_SESSION['billto']['address_format_id'], + 'entry_state' => $_SESSION['billto']['zone_name']); + } elseif (is_numeric($_SESSION['billto'])) { + $Qaddress = $OSCOM_Db->prepare('select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries c on (ab.entry_country_id = c.countries_id) where ab.customers_id = :customers_id and ab.address_book_id = :address_book_id'); + $Qaddress->bindInt(':customers_id', $_SESSION['customer_id']); + $Qaddress->bindInt(':address_book_id', $_SESSION['billto']); + $Qaddress->execute(); + + $billing_address = $Qaddress->toArray(); + } } if ($this->content_type == 'virtual') { @@ -212,29 +267,29 @@ function cart() { } $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID, - 'currency' => $currency, - 'currency_value' => $currencies->currencies[$currency]['value'], - 'payment_method' => $payment, + 'currency' => $_SESSION['currency'], + 'currency_value' => $currencies->currencies[$_SESSION['currency']]['value'], + 'payment_method' => isset($_SESSION['payment']) ? $_SESSION['payment'] : '', 'cc_type' => '', 'cc_owner' => '', 'cc_number' => '', 'cc_expires' => '', - 'shipping_method' => $shipping['title'], - 'shipping_cost' => $shipping['cost'], + 'shipping_method' => isset($_SESSION['shipping']) ? $_SESSION['shipping']['title'] : '', + 'shipping_cost' => isset($_SESSION['shipping']) ? $_SESSION['shipping']['cost'] : 0, 'subtotal' => 0, 'tax' => 0, 'tax_groups' => array(), - 'comments' => (tep_session_is_registered('comments') && !empty($comments) ? $comments : '')); + 'comments' => (isset($_SESSION['comments']) && !empty($_SESSION['comments']) ? $_SESSION['comments'] : '')); - if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) { - if (isset($GLOBALS[$payment]->public_title)) { - $this->info['payment_method'] = $GLOBALS[$payment]->public_title; + if (isset($_SESSION['payment']) && isset($GLOBALS[$_SESSION['payment']]) && is_object($GLOBALS[$_SESSION['payment']])) { + if (isset($GLOBALS[$_SESSION['payment']]->public_title)) { + $this->info['payment_method'] = $GLOBALS[$_SESSION['payment']]->public_title; } else { - $this->info['payment_method'] = $GLOBALS[$payment]->title; + $this->info['payment_method'] = $GLOBALS[$_SESSION['payment']]->title; } - if ( isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && ($GLOBALS[$payment]->order_status > 0) ) { - $this->info['order_status'] = $GLOBALS[$payment]->order_status; + if ( isset($GLOBALS[$_SESSION['payment']]->order_status) && is_numeric($GLOBALS[$_SESSION['payment']]->order_status) && ($GLOBALS[$_SESSION['payment']]->order_status > 0) ) { + $this->info['order_status'] = $GLOBALS[$_SESSION['payment']]->order_status; } } @@ -279,7 +334,7 @@ function cart() { 'format_id' => $billing_address['address_format_id']); $index = 0; - $products = $cart->get_products(); + $products = $_SESSION['cart']->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { $this->products[$index] = array('qty' => $products[$i]['quantity'], 'name' => $products[$i]['name'], @@ -287,23 +342,26 @@ function cart() { 'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'price' => $products[$i]['price'], - 'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']), + 'final_price' => $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']), 'weight' => $products[$i]['weight'], 'id' => $products[$i]['id']); if ($products[$i]['attributes']) { $subindex = 0; - reset($products[$i]['attributes']); - while (list($option, $value) = each($products[$i]['attributes'])) { - $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); - $attributes = tep_db_fetch_array($attributes_query); - - $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'], - 'value' => $attributes['products_options_values_name'], + foreach($products[$i]['attributes'] as $option => $value) { + $Qattributes = $OSCOM_Db->prepare('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa where pa.products_id = :products_id and pa.options_id = :options_id and pa.options_id = popt.products_options_id and pa.options_values_id = :options_values_id and pa.options_values_id = poval.products_options_values_id and popt.language_id = :language_id and popt.language_id = poval.language_id'); + $Qattributes->bindInt(':products_id', $products[$i]['id']); + $Qattributes->bindInt(':options_id', $option); + $Qattributes->bindInt(':options_values_id', $value); + $Qattributes->bindInt(':language_id', $_SESSION['languages_id']); + $Qattributes->execute(); + + $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options_name'), + 'value' => $Qattributes->value('products_options_values_name'), 'option_id' => $option, 'value_id' => $value, - 'prefix' => $attributes['price_prefix'], - 'price' => $attributes['options_values_price']); + 'prefix' => $Qattributes->value('price_prefix'), + 'price' => $Qattributes->value('options_values_price')); $subindex++; } diff --git a/catalog/includes/classes/order_total.php b/catalog/includes/classes/order_total.php index ea6622837..8090b1b9b 100644 --- a/catalog/includes/classes/order_total.php +++ b/catalog/includes/classes/order_total.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -15,14 +15,11 @@ class order_total { // class constructor function order_total() { - global $language; - if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) { $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED); - reset($this->modules); - while (list(, $value) = each($this->modules)) { - include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value); + foreach($this->modules as $value) { + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/' . $value); include(DIR_WS_MODULES . 'order_total/' . $value); $class = substr($value, 0, strrpos($value, '.')); @@ -34,8 +31,7 @@ function order_total() { function process() { $order_total_array = array(); if (is_array($this->modules)) { - reset($this->modules); - while (list(, $value) = each($this->modules)) { + foreach($this->modules as $value) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $GLOBALS[$class]->output = array(); @@ -60,8 +56,7 @@ function process() { function output() { $output_string = ''; if (is_array($this->modules)) { - reset($this->modules); - while (list(, $value) = each($this->modules)) { + foreach($this->modules as $value) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $size = sizeof($GLOBALS[$class]->output); @@ -78,4 +73,4 @@ function output() { return $output_string; } } -?> \ No newline at end of file +?> diff --git a/catalog/includes/classes/osc_template.php b/catalog/includes/classes/osc_template.php index 796a0e3b0..7bd771e8b 100644 --- a/catalog/includes/classes/osc_template.php +++ b/catalog/includes/classes/osc_template.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -14,9 +14,9 @@ class oscTemplate { var $_title; var $_blocks = array(); var $_content = array(); - var $_grid_container_width = 24; - var $_grid_content_width = 16; - var $_grid_column_width = 4; + var $_grid_container_width = 12; + var $_grid_content_width = BOOTSTRAP_CONTENT; + var $_grid_column_width = 0; // deprecated var $_data = array(); function oscTemplate() { @@ -44,7 +44,7 @@ function setGridColumnWidth($width) { } function getGridColumnWidth() { - return $this->_grid_column_width; + return (12 - BOOTSTRAP_CONTENT) / 2; } function setTitle($title) { @@ -70,8 +70,6 @@ function getBlocks($group) { } function buildBlocks() { - global $language; - if ( defined('TEMPLATE_BLOCK_GROUPS') && tep_not_null(TEMPLATE_BLOCK_GROUPS) ) { $tbgroups_array = explode(';', TEMPLATE_BLOCK_GROUPS); @@ -82,11 +80,11 @@ function buildBlocks() { $modules_array = explode(';', constant($module_key)); foreach ( $modules_array as $module ) { - $class = substr($module, 0, strrpos($module, '.')); + $class = basename($module, '.php'); if ( !class_exists($class) ) { - if ( file_exists(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module) ) { - include(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module); + if ( file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/' . $group . '/' . $module) ) { + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/' . $group . '/' . $module); } if ( file_exists(DIR_WS_MODULES . $group . '/' . $class . '.php') ) { @@ -116,8 +114,6 @@ function hasContent($group) { } function getContent($group) { - global $language; - if ( !class_exists('tp_' . $group) && file_exists(DIR_WS_MODULES . 'pages/tp_' . $group . '.php') ) { include(DIR_WS_MODULES . 'pages/tp_' . $group . '.php'); } @@ -131,8 +127,8 @@ function getContent($group) { foreach ( $this->getContentModules($group) as $module ) { if ( !class_exists($module) ) { if ( file_exists(DIR_WS_MODULES . 'content/' . $group . '/' . $module . '.php') ) { - if ( file_exists(DIR_WS_LANGUAGES . $language . '/modules/content/' . $group . '/' . $module . '.php') ) { - include(DIR_WS_LANGUAGES . $language . '/modules/content/' . $group . '/' . $module . '.php'); + if ( file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/' . $group . '/' . $module . '.php') ) { + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/' . $group . '/' . $module . '.php'); } include(DIR_WS_MODULES . 'content/' . $group . '/' . $module . '.php'); diff --git a/catalog/includes/classes/passwordhash.php b/catalog/includes/classes/passwordhash.php index f30ab3997..3cc411ac3 100644 --- a/catalog/includes/classes/passwordhash.php +++ b/catalog/includes/classes/passwordhash.php @@ -144,17 +144,10 @@ function crypt_private($password, $setting) # in PHP would result in much worse performance and # consequently in lower iteration counts and hashes that are # quicker to crack (by non-PHP code). - if (PHP_VERSION >= '5') { - $hash = md5($salt . $password, TRUE); - do { - $hash = md5($hash . $password, TRUE); - } while (--$count); - } else { - $hash = pack('H*', md5($salt . $password)); - do { - $hash = pack('H*', md5($hash . $password)); - } while (--$count); - } + $hash = md5($salt . $password, TRUE); + do { + $hash = md5($hash . $password, TRUE); + } while (--$count); $output = substr($setting, 0, 12); $output .= $this->encode64($hash, 16); diff --git a/catalog/includes/classes/payment.php b/catalog/includes/classes/payment.php index 575a3b324..12eb2529c 100644 --- a/catalog/includes/classes/payment.php +++ b/catalog/includes/classes/payment.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2012 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -15,7 +15,7 @@ class payment { // class constructor function payment($module = '') { - global $payment, $language, $PHP_SELF; + global $PHP_SELF; if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) { $this->modules = explode(';', MODULE_PAYMENT_INSTALLED); @@ -27,25 +27,24 @@ function payment($module = '') { $include_modules[] = array('class' => $module, 'file' => $module . '.php'); } else { - reset($this->modules); - while (list(, $value) = each($this->modules)) { - $class = substr($value, 0, strrpos($value, '.')); + foreach($this->modules as $value) { + $class = basename($value, '.php'); $include_modules[] = array('class' => $class, 'file' => $value); } } for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) { - include(DIR_WS_LANGUAGES . $language . '/modules/payment/' . $include_modules[$i]['file']); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $include_modules[$i]['file']); include(DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file']); $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']; } // if there is only one payment method, select it as default because in -// checkout_confirmation.php the $payment variable is being assigned the -// $HTTP_POST_VARS['payment'] value which will be empty (no radio button selection possible) - if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$payment]) || (isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) ) { - $payment = $include_modules[0]['class']; +// checkout_confirmation.php the $_SESSION['payment'] variable is being assigned the +// $_POST['payment'] value which will be empty (no radio button selection possible) + if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$_SESSION['payment']]) || (isset($GLOBALS[$_SESSION['payment']]) && !is_object($GLOBALS[$_SESSION['payment']]))) ) { + $_SESSION['payment'] = $include_modules[0]['class']; } if ( (tep_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) { @@ -62,7 +61,7 @@ function payment($module = '') { The following method is a work-around to implementing the method in all payment modules available which would break the modules in the contributions section. This should be looked into again post 2.2. -*/ +*/ function update_status() { if (is_array($this->modules)) { if (is_object($GLOBALS[$this->selected_module])) { @@ -76,7 +75,7 @@ function update_status() { function javascript_validation() { $js = ''; if (is_array($this->modules)) { - $js = ' diff --git a/catalog/includes/functions/banner.php b/catalog/includes/functions/banner.php index 0b3295095..670003ebd 100644 --- a/catalog/includes/functions/banner.php +++ b/catalog/includes/functions/banner.php @@ -5,18 +5,24 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2012 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + //// // Sets the status of a banner function tep_set_banner_status($banners_id, $status) { + $OSCOM_Db = Registry::get('Db'); + if ($status == '1') { - return tep_db_query("update " . TABLE_BANNERS . " set status = '1', date_status_change = now(), date_scheduled = NULL where banners_id = '" . (int)$banners_id . "'"); + return $OSCOM_Db->save('banners', ['status' => 1, 'date_status_change' => 'now()', 'date_scheduled' => 'null'], ['banners_id' => (int)$banners_id]); } elseif ($status == '0') { - return tep_db_query("update " . TABLE_BANNERS . " set status = '0', date_status_change = now() where banners_id = '" . (int)$banners_id . "'"); + return $OSCOM_Db->save('banners', ['status' => 0, 'date_status_change' => 'now()'], ['banners_id' => (int)$banners_id]); } else { return -1; } @@ -25,101 +31,134 @@ function tep_set_banner_status($banners_id, $status) { //// // Auto activate banners function tep_activate_banners() { - $banners_query = tep_db_query("select banners_id, date_scheduled from " . TABLE_BANNERS . " where date_scheduled != ''"); - if (tep_db_num_rows($banners_query)) { - while ($banners = tep_db_fetch_array($banners_query)) { - if (date('Y-m-d H:i:s') >= $banners['date_scheduled']) { - tep_set_banner_status($banners['banners_id'], '1'); - } - } + $OSCOM_Db = Registry::get('Db'); + + $Qbanners = $OSCOM_Db->query('select banners_id from :table_banners where date_scheduled is not null and date_scheduled <= now() and status != 1'); + + if ($Qbanners->fetch() !== false) { + do { + tep_set_banner_status($Qbanners->valueInt('banners_id'), 1); + } while ($Qbanners->fetch()); } } //// // Auto expire banners function tep_expire_banners() { - $banners_query = tep_db_query("select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from " . TABLE_BANNERS . " b, " . TABLE_BANNERS_HISTORY . " bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_id"); - if (tep_db_num_rows($banners_query)) { - while ($banners = tep_db_fetch_array($banners_query)) { - if (tep_not_null($banners['expires_date'])) { - if (date('Y-m-d H:i:s') >= $banners['expires_date']) { - tep_set_banner_status($banners['banners_id'], '0'); - } - } elseif (tep_not_null($banners['expires_impressions'])) { - if ( ($banners['expires_impressions'] > 0) && ($banners['banners_shown'] >= $banners['expires_impressions']) ) { - tep_set_banner_status($banners['banners_id'], '0'); - } - } - } + $OSCOM_Db = Registry::get('Db'); + + $Qbanners = $OSCOM_Db->query('select b.banners_id, sum(bh.banners_shown) as banners_shown from :table_banners b, :table_banners_history bh where b.status = 1 and b.banners_id = bh.banners_id and ((b.expires_date is not null and now() >= b.expires_date) or (b.expires_impressions >= banners_shown)) group by b.banners_id'); + + if ($Qbanners->fetch() !== false) { + do { + tep_set_banner_status($Qbanners->valueInt('banners_id'), 0); + } while ($Qbanners->fetch()); } } //// // Display a banner from the specified group or banner id ($identifier) function tep_display_banner($action, $identifier) { + $OSCOM_Db = Registry::get('Db'); + + $banner = null; + if ($action == 'dynamic') { - $banners_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . tep_db_input($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 = '" . tep_db_input($identifier) . "'"); - } else { - return 'TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!'; + $Qcheck = $OSCOM_Db->prepare('select banners_id from :table_banners where banners_group = :banners_group and status = 1 limit 1'); + $Qcheck->bindValue(':banners_group', $identifier); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { + $Qbanner = $OSCOM_Db->prepare('select banners_id, banners_title, banners_image, banners_html_text from :table_banners where banners_group = :banners_group and status = 1 order by rand() limit 1'); + $Qbanner->bindValue(':banners_group', $identifier); + $Qbanner->execute(); + + $banner = $Qbanner->fetch(); } } 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 'TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive'; + $Qbanner = $OSCOM_Db->prepare('select banners_id, banners_title, banners_image, banners_html_text from :table_banners where banners_id = :banners_id and status = 1'); + $Qbanner->bindInt(':banners_id', $identifier); + $Qbanner->execute(); + + if ($Qbanner->fetch() !== false) { + $banner = $Qbanner->toArray(); } } - } else { - return 'TEP ERROR! (tep_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\''; } - if (tep_not_null($banner['banners_html_text'])) { - $banner_string = $banner['banners_html_text']; - } else { - $banner_string = '' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . ''; - } + $output = ''; + + if (isset($banner)) { + if (!empty($banner['banners_html_text'])) { + $output = $banner['banners_html_text']; + } else { + $output = '' . HTML::image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . ''; + } - tep_update_banner_display_count($banner['banners_id']); + tep_update_banner_display_count($banner['banners_id']); + } - return $banner_string; + return $output; } //// // Check to see if a banner exists function tep_banner_exists($action, $identifier) { + $OSCOM_Db = Registry::get('Db'); + + $result = false; + if ($action == 'dynamic') { - return tep_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . tep_db_input($identifier) . "'"); + $Qcheck = $OSCOM_Db->prepare('select banners_id from :table_banners where banners_group = :banners_group and status = 1 limit 1'); + $Qcheck->bindValue(':banners_group', $identifier); + $Qcheck->execute(); + + $result = $Qcheck->fetch() !== false; } elseif ($action == 'static') { - $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 . "'"); - return tep_db_fetch_array($banner_query); - } else { - return false; + $Qcheck = $OSCOM_Db->prepare('select banners_id from :table_banners where banners_id = :banners_id and status = 1'); + $Qcheck->bindInt(':banners_id', $identifier); + $Qcheck->execute(); + + $result = $Qcheck->fetch() !== false; } + + return $result; } //// // Update the banner display statistics function tep_update_banner_display_count($banner_id) { - $banner_check_query = tep_db_query("select count(*) as count from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')"); - $banner_check = tep_db_fetch_array($banner_check_query); + $OSCOM_Db = Registry::get('Db'); - if ($banner_check['count'] > 0) { - tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_shown = banners_shown + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')"); + $Qcheck = $OSCOM_Db->prepare('select banners_history_id from :table_banners_history where banners_id = :banners_id and date_format(banners_history_date, "%Y%m%d") = date_format(now(), "%Y%m%d") limit 1'); + $Qcheck->bindInt(':banners_id', $banner_id); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { + $Qview = $OSCOM_Db->prepare('update :table_banners_history set banners_shown = banners_shown + 1 where banners_id = :banners_id and date_format(banners_history_date, "%Y%m%d") = date_format(now(), "%Y%m%d")'); + $Qview->bindInt(':banners_id', $banner_id); + $Qview->execute(); } else { - tep_db_query("insert into " . TABLE_BANNERS_HISTORY . " (banners_id, banners_shown, banners_history_date) values ('" . (int)$banner_id . "', 1, now())"); + $Qview = $OSCOM_Db->prepare('insert into :table_banners_history (banners_id, banners_shown, banners_history_date) values (:banners_id, 1, now())'); + $Qview->bindInt(':banners_id', $banner_id); + $Qview->execute(); } + + return $Qview->rowCount(); } //// // Update the banner click statistics function tep_update_banner_click_count($banner_id) { - tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_clicked = banners_clicked + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')"); + $OSCOM_Db = Registry::get('Db'); + + $Qupdate = $OSCOM_Db->prepare('update :table_banners_history set banners_clicked = banners_clicked + 1 where banners_id = :banners_id and date_format(banners_history_date, "%Y%m%d") = date_format(now(), "%Y%m%d")'); + $Qupdate->bindInt(':banners_id', $banner_id); + $Qupdate->execute(); + + return $Qupdate->rowCount(); } ?> diff --git a/catalog/includes/functions/cache.php b/catalog/includes/functions/cache.php index 63d6de727..a199776c9 100644 --- a/catalog/includes/functions/cache.php +++ b/catalog/includes/functions/cache.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2006 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -68,41 +68,15 @@ function read_cache(&$var, $filename, $auto_expire = false){ return $success; } -//// -//! Get data from the cache or the database. -// get_db_cache checks the cache for cached SQL data in $filename -// or retreives it from the database is the cache is not present. -// $SQL - The SQL query to exectue if needed. -// $filename - The name of the cache file. -// $var - The variable to be filled. -// $refresh - Optional. If true, do not read from the cache. - function get_db_cache($sql, &$var, $filename, $refresh = false){ - $var = array(); - -// check for the refresh flag and try to the data - if (($refresh == true)|| !read_cache($var, $filename)) { -// Didn' get cache so go to the database. -// $conn = mysql_connect("localhost", "apachecon", "apachecon"); - $res = tep_db_query($sql); -// if ($err = mysql_error()) trigger_error($err, E_USER_ERROR); -// loop through the results and add them to an array - while ($rec = tep_db_fetch_array($res)) { - $var[] = $rec; - } -// write the data to the file - write_cache($var, $filename); - } - } - //// //! Cache the categories box // Cache the categories box function tep_cache_categories_box($auto_expire = false, $refresh = false) { - global $cPath, $language; + global $cPath; $cache_output = ''; - if (($refresh == true) || !read_cache($cache_output, 'categories_box-' . $language . '.cache' . $cPath, $auto_expire)) { + if (($refresh == true) || !read_cache($cache_output, 'categories_box-' . $_SESSION['language'] . '.cache' . $cPath, $auto_expire)) { if (!class_exists('bm_categories')) { include(DIR_WS_MODULES . 'boxes/bm_categories.php'); } @@ -110,7 +84,7 @@ function tep_cache_categories_box($auto_expire = false, $refresh = false) { $bm_categories = new bm_categories(); $cache_output = $bm_categories->getData(); - write_cache($cache_output, 'categories_box-' . $language . '.cache' . $cPath); + write_cache($cache_output, 'categories_box-' . $_SESSION['language'] . '.cache' . $cPath); } return $cache_output; @@ -120,16 +94,14 @@ function tep_cache_categories_box($auto_expire = false, $refresh = false) { //! Cache the manufacturers box // Cache the manufacturers box function tep_cache_manufacturers_box($auto_expire = false, $refresh = false) { - global $HTTP_GET_VARS, $language; - $cache_output = ''; $manufacturers_id = ''; - if (isset($HTTP_GET_VARS['manufacturers_id']) && is_numeric($HTTP_GET_VARS['manufacturers_id'])) { - $manufacturers_id = $HTTP_GET_VARS['manufacturers_id']; + if (isset($_GET['manufacturers_id']) && is_numeric($_GET['manufacturers_id'])) { + $manufacturers_id = $_GET['manufacturers_id']; } - if (($refresh == true) || !read_cache($cache_output, 'manufacturers_box-' . $language . '.cache' . $manufacturers_id, $auto_expire)) { + if (($refresh == true) || !read_cache($cache_output, 'manufacturers_box-' . $_SESSION['language'] . '.cache' . $manufacturers_id, $auto_expire)) { if (!class_exists('bm_manufacturers')) { include(DIR_WS_MODULES . 'boxes/bm_manufacturers.php'); } @@ -137,7 +109,7 @@ function tep_cache_manufacturers_box($auto_expire = false, $refresh = false) { $bm_manufacturers = new bm_manufacturers(); $cache_output = $bm_manufacturers->getData(); - write_cache($cache_output, 'manufacturers_box-' . $language . '.cache' . $manufacturers_id); + write_cache($cache_output, 'manufacturers_box-' . $_SESSION['language'] . '.cache' . $manufacturers_id); } return $cache_output; @@ -147,17 +119,15 @@ function tep_cache_manufacturers_box($auto_expire = false, $refresh = false) { //! Cache the also purchased module // Cache the also purchased module function tep_cache_also_purchased($auto_expire = false, $refresh = false) { - global $HTTP_GET_VARS, $language, $languages_id; - $cache_output = ''; - if (isset($HTTP_GET_VARS['products_id']) && is_numeric($HTTP_GET_VARS['products_id'])) { - if (($refresh == true) || !read_cache($cache_output, 'also_purchased-' . $language . '.cache' . $HTTP_GET_VARS['products_id'], $auto_expire)) { + if (isset($_GET['products_id']) && is_numeric($_GET['products_id'])) { + if (($refresh == true) || !read_cache($cache_output, 'also_purchased-' . $_SESSION['language'] . '.cache' . $_GET['products_id'], $auto_expire)) { ob_start(); - include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); + include('includes/modules/also_purchased_products.php'); $cache_output = ob_get_contents(); ob_end_clean(); - write_cache($cache_output, 'also_purchased-' . $language . '.cache' . $HTTP_GET_VARS['products_id']); + write_cache($cache_output, 'also_purchased-' . $_SESSION['language'] . '.cache' . $_GET['products_id']); } } diff --git a/catalog/includes/functions/compatibility.php b/catalog/includes/functions/compatibility.php deleted file mode 100644 index b0b49f64d..000000000 --- a/catalog/includes/functions/compatibility.php +++ /dev/null @@ -1,99 +0,0 @@ -= 4.1) { - $HTTP_GET_VARS =& $_GET; - $HTTP_POST_VARS =& $_POST; - $HTTP_COOKIE_VARS =& $_COOKIE; - $HTTP_SESSION_VARS =& $_SESSION; - $HTTP_POST_FILES =& $_FILES; - $HTTP_SERVER_VARS =& $_SERVER; - } else { - if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array(); - if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array(); - if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array(); - } - -// handle magic_quotes_gpc turned off. - if (!get_magic_quotes_gpc()) { - do_magic_quotes_gpc($HTTP_GET_VARS); - do_magic_quotes_gpc($HTTP_POST_VARS); - do_magic_quotes_gpc($HTTP_COOKIE_VARS); - } - -// set default timezone if none exists (PHP 5.3 throws an E_WARNING) - if (PHP_VERSION >= '5.2') { - date_default_timezone_set(defined('CFG_TIME_ZONE') ? CFG_TIME_ZONE : date_default_timezone_get()); - } - - if (!function_exists('checkdnsrr')) { - function checkdnsrr($host, $type) { - if(tep_not_null($host) && tep_not_null($type)) { - @exec("nslookup -type=" . escapeshellarg($type) . " " . escapeshellarg($host), $output); - while(list($k, $line) = each($output)) { - if(preg_match("/^$host/i", $line)) { - return true; - } - } - } - return false; - } - } - -/* - * stripos() natively supported from PHP 5.0 - * From Pear::PHP_Compat - */ - - if (!function_exists('stripos')) { - function stripos($haystack, $needle, $offset = null) { - $fix = 0; - - if (!is_null($offset)) { - if ($offset > 0) { - $haystack = substr($haystack, $offset, strlen($haystack) - $offset); - $fix = $offset; - } - } - - $segments = explode(strtolower($needle), strtolower($haystack), 2); - -// Check there was a match - if (count($segments) == 1) { - return false; - } - - $position = strlen($segments[0]) + $fix; - - return $position; - } - } -?> \ No newline at end of file diff --git a/catalog/includes/functions/database.php b/catalog/includes/functions/database.php deleted file mode 100644 index 70bf00298..000000000 --- a/catalog/includes/functions/database.php +++ /dev/null @@ -1,266 +0,0 @@ -' . $errno . ' - ' . $error . '

      ' . $query . '

      [TEP STOP]

      '); - } - - function tep_db_query($query, $link = 'db_link') { - global $$link; - - if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { - error_log('QUERY: ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); - } - - $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link)); - - return $result; - } - - function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { - reset($data); - if ($action == 'insert') { - $query = 'insert into ' . $table . ' ('; - while (list($columns, ) = each($data)) { - $query .= $columns . ', '; - } - $query = substr($query, 0, -2) . ') values ('; - reset($data); - while (list(, $value) = each($data)) { - switch ((string)$value) { - case 'now()': - $query .= 'now(), '; - break; - case 'null': - $query .= 'null, '; - break; - default: - $query .= '\'' . tep_db_input($value) . '\', '; - break; - } - } - $query = substr($query, 0, -2) . ')'; - } elseif ($action == 'update') { - $query = 'update ' . $table . ' set '; - while (list($columns, $value) = each($data)) { - switch ((string)$value) { - case 'now()': - $query .= $columns . ' = now(), '; - break; - case 'null': - $query .= $columns .= ' = null, '; - break; - default: - $query .= $columns . ' = \'' . tep_db_input($value) . '\', '; - break; - } - } - $query = substr($query, 0, -2) . ' where ' . $parameters; - } - - return tep_db_query($query, $link); - } - - function tep_db_fetch_array($db_query) { - return mysqli_fetch_array($db_query, MYSQLI_ASSOC); - } - - function tep_db_num_rows($db_query) { - return mysqli_num_rows($db_query); - } - - function tep_db_data_seek($db_query, $row_number) { - return mysqli_data_seek($db_query, $row_number); - } - - function tep_db_insert_id($link = 'db_link') { - global $$link; - - return mysqli_insert_id($$link); - } - - function tep_db_free_result($db_query) { - return mysqli_free_result($db_query); - } - - function tep_db_fetch_fields($db_query) { - return mysqli_fetch_field($db_query); - } - - function tep_db_output($string) { - return htmlspecialchars($string); - } - - function tep_db_input($string, $link = 'db_link') { - global $$link; - - return mysqli_real_escape_string($$link, $string); - } - - function tep_db_prepare_input($string) { - if (is_string($string)) { - return trim(tep_sanitize_string(stripslashes($string))); - } elseif (is_array($string)) { - reset($string); - while (list($key, $value) = each($string)) { - $string[$key] = tep_db_prepare_input($value); - } - return $string; - } else { - return $string; - } - } - - function tep_db_affected_rows($link = 'db_link') { - global $$link; - - return mysqli_affected_rows($$link); - } - - function tep_db_get_server_info($link = 'db_link') { - global $$link; - - return mysqli_get_server_info($$link); - } - - if ( !function_exists('mysqli_connect') ) { - define('MYSQLI_ASSOC', MYSQL_ASSOC); - - function mysqli_connect($server, $username, $password, $database) { - if ( substr($server, 0, 2) == 'p:' ) { - $link = mysql_pconnect(substr($server, 2), $username, $password); - } else { - $link = mysql_connect($server, $username, $password); - } - - if ( $link ) { - mysql_select_db($database, $link); - } - - return $link; - } - - function mysqli_connect_errno($link = null) { - if ( is_null($link) ) { - return mysql_errno(); - } - - return mysql_errno($link); - } - - function mysqli_connect_error($link = null) { - if ( is_null($link) ) { - return mysql_error(); - } - - return mysql_error($link); - } - - function mysqli_set_charset($link, $charset) { - if ( function_exists('mysql_set_charset') ) { - return mysql_set_charset($charset, $link); - } - } - - function mysqli_close($link) { - return mysql_close($link); - } - - function mysqli_query($link, $query) { - return mysql_query($query, $link); - } - - function mysqli_errno($link = null) { - if ( is_null($link) ) { - return mysql_errno(); - } - - return mysql_errno($link); - } - - function mysqli_error($link = null) { - if ( is_null($link) ) { - return mysql_error(); - } - - return mysql_error($link); - } - - function mysqli_fetch_array($query, $type) { - return mysql_fetch_array($query, $type); - } - - function mysqli_num_rows($query) { - return mysql_num_rows($query); - } - - function mysqli_data_seek($query, $offset) { - return mysql_data_seek($query, $offset); - } - - function mysqli_insert_id($link) { - return mysql_insert_id($link); - } - - function mysqli_free_result($query) { - return mysql_free_result($query); - } - - function mysqli_fetch_field($query) { - return mysql_fetch_field($query); - } - - function mysqli_real_escape_string($link, $string) { - if ( function_exists('mysql_real_escape_string') ) { - return mysql_real_escape_string($string, $link); - } elseif ( function_exists('mysql_escape_string') ) { - return mysql_escape_string($string); - } - - return addslashes($string); - } - - function mysqli_affected_rows($link) { - return mysql_affected_rows($link); - } - - function mysqli_get_server_info($link) { - return mysql_get_server_info($link); - } - } -?> diff --git a/catalog/includes/functions/general.php b/catalog/includes/functions/general.php index b448fa706..c83ed64f9 100644 --- a/catalog/includes/functions/general.php +++ b/catalog/includes/functions/general.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + //// // Get the installed version number function tep_get_version() { @@ -26,45 +30,19 @@ function tep_get_version() { // Stop from parsing any further PHP code // v2.3.3.1 now closes the session through a registered shutdown function function tep_exit() { - exit(); - } - -//// -// Redirect to another page or site - function tep_redirect($url) { - if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { - tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false)); - } - - if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page - if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)) == HTTP_SERVER . DIR_WS_HTTP_CATALOG) { // NONSSL url - $url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL - } - } - - if ( strpos($url, '&') !== false ) { - $url = str_replace('&', '&', $url); - } - - header('Location: ' . $url); - - tep_exit(); + exit; } //// // Parse the data used in the html tags to ensure the tags will not break - function tep_parse_input_field_data($data, $parse) { - return strtr(trim($data), $parse); - } - - function tep_output_string($string, $translate = false, $protected = false) { + function tep_output_string($string, $translate = false, $protected = false) { if ($protected == true) { return htmlspecialchars($string); } else { if ($translate == false) { - return tep_parse_input_field_data($string, array('"' => '"')); + return strtr(trim($string), array('"' => '"')); } else { - return tep_parse_input_field_data($string, $translate); + return strtr(trim($string), $translate); } } } @@ -79,54 +57,52 @@ function tep_sanitize_string($string) { return preg_replace($patterns, $replace, trim($string)); } -//// -// Return a random row from a database query - function tep_random_select($query) { - $random_product = ''; - $random_query = tep_db_query($query); - $num_rows = tep_db_num_rows($random_query); - if ($num_rows > 0) { - $random_row = tep_rand(0, ($num_rows - 1)); - tep_db_data_seek($random_query, $random_row); - $random_product = tep_db_fetch_array($random_query); - } - - return $random_product; - } - //// // Return a product's name // TABLES: products - function tep_get_products_name($product_id, $language = '') { - global $languages_id; + function tep_get_products_name($product_id, $language_id = null) { + $OSCOM_Db = Registry::get('Db'); - if (empty($language)) $language = $languages_id; + if (!isset($language_id)) $language_id = $_SESSION['languages_id']; - $product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'"); - $product = tep_db_fetch_array($product_query); + $Qproduct = $OSCOM_Db->prepare('select products_name from :table_products_description where products_id = :products_id and language_id = :language_id'); + $Qproduct->bindInt(':products_id', $product_id); + $Qproduct->bindInt(':language_id', $language_id); + $Qproduct->execute(); - return $product['products_name']; + return $Qproduct->value('products_name'); } //// // Return a product's special price (returns nothing if there is no offer) // TABLES: products function tep_get_products_special_price($product_id) { - $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status = 1"); - $product = tep_db_fetch_array($product_query); + $OSCOM_Db = Registry::get('Db'); + + $result = false; - return $product['specials_new_products_price']; + $Qproduct = $OSCOM_Db->prepare('select specials_new_products_price from :table_specials where products_id = :products_id and status = 1'); + $Qproduct->bindInt(':products_id', $product_id); + $Qproduct->execute(); + + if ($Qproduct->fetch() !== false) { + $result = $Qproduct->valueDecimal('specials_new_products_price'); + } + + return $result; } //// // Return a product's stock // TABLES: products function tep_get_products_stock($products_id) { - $products_id = tep_get_prid($products_id); - $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); - $stock_values = tep_db_fetch_array($stock_query); + $OSCOM_Db = Registry::get('Db'); - return $stock_values['products_quantity']; + $Qproduct = $OSCOM_Db->prepare('select products_quantity from :table_products where products_id = :products_id'); + $Qproduct->bindInt(':products_id', tep_get_prid($products_id)); + $Qproduct->execute(); + + return $Qproduct->valueInt('products_quantity'); } //// @@ -166,48 +142,51 @@ function tep_break_string($string, $len, $break_char = '-') { } //// -// Return all HTTP GET variables, except those passed as a parameter +// Return all $_GET variables, except those passed as a parameter function tep_get_all_get_params($exclude_array = '') { - global $HTTP_GET_VARS; - if (!is_array($exclude_array)) $exclude_array = array(); + $exclude_array[] = session_name(); + $exclude_array[] = 'error'; + $exclude_array[] = 'x'; + $exclude_array[] = 'y'; + $get_url = ''; - if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) { - reset($HTTP_GET_VARS); - while (list($key, $value) = each($HTTP_GET_VARS)) { - if ( is_string($value) && (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) { - $get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&'; - } - } - } - return $get_url; + if (is_array($_GET) && (!empty($_GET))) { + foreach ($_GET as $key => $value) { + if ( !in_array($key, $exclude_array) ) { + $get_url .= $key . '=' . rawurlencode($value) . '&'; + } + } } + return $get_url; +} //// // Returns an array with countries // TABLES: countries function tep_get_countries($countries_id = '', $with_iso_codes = false) { + $OSCOM_Db = Registry::get('Db'); + $countries_array = array(); + if (tep_not_null($countries_id)) { if ($with_iso_codes == true) { - $countries = tep_db_query("select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "' order by countries_name"); - $countries_values = tep_db_fetch_array($countries); - $countries_array = array('countries_name' => $countries_values['countries_name'], - 'countries_iso_code_2' => $countries_values['countries_iso_code_2'], - 'countries_iso_code_3' => $countries_values['countries_iso_code_3']); + $Qcountries = $OSCOM_Db->prepare('select countries_name, countries_iso_code_2, countries_iso_code_3 from :table_countries where countries_id = :countries_id'); + $Qcountries->bindInt(':countries_id', $countries_id); + $Qcountries->execute(); + + $countries_array = $Qcountries->toArray(); } else { - $countries = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'"); - $countries_values = tep_db_fetch_array($countries); - $countries_array = array('countries_name' => $countries_values['countries_name']); + $Qcountries = $OSCOM_Db->prepare('select countries_name from :table_countries where countries_id = :countries_id'); + $Qcountries->bindInt(':countries_id', $countries_id); + $Qcountries->execute(); + + $countries_array = $Qcountries->toArray(); } } else { - $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"); - while ($countries_values = tep_db_fetch_array($countries)) { - $countries_array[] = array('countries_id' => $countries_values['countries_id'], - 'countries_name' => $countries_values['countries_name']); - } + $countries_array = $OSCOM_Db->query('select countries_id, countries_name from :table_countries order by countries_name')->fetchAll(); } return $countries_array; @@ -224,19 +203,24 @@ function tep_get_countries_with_iso_codes($countries_id) { function tep_get_path($current_category_id = '') { global $cPath_array; + $OSCOM_Db = Registry::get('Db'); + if (tep_not_null($current_category_id)) { $cp_size = sizeof($cPath_array); if ($cp_size == 0) { $cPath_new = $current_category_id; } else { $cPath_new = ''; - $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[($cp_size-1)] . "'"); - $last_category = tep_db_fetch_array($last_category_query); - $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); - $current_category = tep_db_fetch_array($current_category_query); + $QlastCategory = $OSCOM_Db->prepare('select parent_id from :table_categories where categories_id = :categories_id'); + $QlastCategory->bindInt(':categories_id', $cPath_array[($cp_size-1)]); + $QlastCategory->execute(); - if ($last_category['parent_id'] == $current_category['parent_id']) { + $QcurrentCategory = $OSCOM_Db->prepare('select parent_id from :table_categories where categories_id = :categories_id'); + $QcurrentCategory->bindInt(':categories_id', $current_category_id); + $QcurrentCategory->execute(); + + if ($QlastCategory->valueInt('parent_id') == $QcurrentCategory->valueInt('parent_id')) { for ($i=0; $i<($cp_size-1); $i++) { $cPath_new .= '_' . $cPath_array[$i]; } @@ -261,9 +245,7 @@ function tep_get_path($current_category_id = '') { //// // Returns the clients browser function tep_browser_detect($component) { - global $HTTP_USER_AGENT; - - return stristr($HTTP_USER_AGENT, $component); + return stristr($_SERVER['HTTP_USER_AGENT'], $component); } //// @@ -278,10 +260,15 @@ function tep_get_country_name($country_id) { // Returns the zone (State/Province) name // TABLES: zones function tep_get_zone_name($country_id, $zone_id, $default_zone) { - $zone_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'"); - if (tep_db_num_rows($zone_query)) { - $zone = tep_db_fetch_array($zone_query); - return $zone['zone_name']; + $OSCOM_Db = Registry::get('Db'); + + $Qzone = $OSCOM_Db->prepare('select zone_name from :table_zones where zone_country_id = :zone_country_id and zone_id = :zone_id'); + $Qzone->bindInt(':zone_country_id', $country_id); + $Qzone->bindInt(':zone_id', $zone_id); + $Qzone->execute(); + + if ($Qzone->fetch() !== false) { + return $Qzone->value('zone_name'); } else { return $default_zone; } @@ -291,10 +278,15 @@ function tep_get_zone_name($country_id, $zone_id, $default_zone) { // Returns the zone (State/Province) code // TABLES: zones function tep_get_zone_code($country_id, $zone_id, $default_zone) { - $zone_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country_id . "' and zone_id = '" . (int)$zone_id . "'"); - if (tep_db_num_rows($zone_query)) { - $zone = tep_db_fetch_array($zone_query); - return $zone['zone_code']; + $OSCOM_Db = Registry::get('Db'); + + $Qzone = $OSCOM_Db->prepare('select zone_code from :table_zones where zone_country_id = :zone_country_id and zone_id = :zone_id'); + $Qzone->bindInt(':zone_country_id', $country_id); + $Qzone->bindInt(':zone_id', $zone_id); + $Qzone->execute(); + + if ($Qzone->fetch() !== false) { + return $Qzone->value('zone_code'); } else { return $default_zone; } @@ -326,26 +318,33 @@ function tep_round($number, $precision) { // Returns the tax rate for a zone / class // TABLES: tax_rates, zones_to_geo_zones function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) { - global $customer_zone_id, $customer_country_id; static $tax_rates = array(); + $OSCOM_Db = Registry::get('Db'); + if ( ($country_id == -1) && ($zone_id == -1) ) { - if (!tep_session_is_registered('customer_id')) { + if (!isset($_SESSION['customer_id'])) { $country_id = STORE_COUNTRY; $zone_id = STORE_ZONE; } else { - $country_id = $customer_country_id; - $zone_id = $customer_zone_id; + $country_id = $_SESSION['customer_country_id']; + $zone_id = $_SESSION['customer_zone_id']; } } if (!isset($tax_rates[$class_id][$country_id][$zone_id]['rate'])) { - $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' group by tr.tax_priority"); - if (tep_db_num_rows($tax_query)) { + $Qtax = $OSCOM_Db->prepare('select sum(tr.tax_rate) as tax_rate from :table_tax_rates tr left join :table_zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join :table_geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = 0 or za.zone_country_id = :zone_country_id) and (za.zone_id is null or za.zone_id = 0 or za.zone_id = :zone_id) and tr.tax_class_id = :tax_class_id group by tr.tax_priority'); + $Qtax->bindInt(':zone_country_id', $country_id); + $Qtax->bindInt(':zone_id', $zone_id); + $Qtax->bindInt(':tax_class_id', $class_id); + $Qtax->execute(); + + if ($Qtax->fetch() !== false) { $tax_multiplier = 1.0; - while ($tax = tep_db_fetch_array($tax_query)) { - $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100); - } + + do { + $tax_multiplier *= 1.0 + ($Qtax->valueDecimal('tax_rate') / 100); + } while ($Qtax->fetch()); $tax_rates[$class_id][$country_id][$zone_id]['rate'] = ($tax_multiplier - 1.0) * 100; } else { @@ -362,13 +361,22 @@ function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) { function tep_get_tax_description($class_id, $country_id, $zone_id) { static $tax_rates = array(); + $OSCOM_Db = Registry::get('Db'); + if (!isset($tax_rates[$class_id][$country_id][$zone_id]['description'])) { - $tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' order by tr.tax_priority"); - if (tep_db_num_rows($tax_query)) { + $Qtax = $OSCOM_Db->prepare('select tr.tax_description from :table_tax_rates tr left join :table_zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join :table_geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = 0 or za.zone_country_id = :zone_country_id) and (za.zone_id is null or za.zone_id = 0 or za.zone_id = :zone_id) and tr.tax_class_id = :tax_class_id order by tr.tax_priority'); + $Qtax->bindInt(':zone_country_id', $country_id); + $Qtax->bindInt(':zone_id', $zone_id); + $Qtax->bindInt(':tax_class_id', $class_id); + $Qtax->execute(); + + if ($Qtax->fetch() !== false) { $tax_description = ''; - while ($tax = tep_db_fetch_array($tax_query)) { - $tax_description .= $tax['tax_description'] . ' + '; - } + + do { + $tax_description .= $Qtax->value('tax_description') . ' + '; + } while ($Qtax->fetch()); + $tax_description = substr($tax_description, 0, -3); $tax_rates[$class_id][$country_id][$zone_id]['description'] = $tax_description; @@ -399,20 +407,32 @@ function tep_calculate_tax($price, $tax) { // Return the number of products in a category // TABLES: products, products_to_categories, categories function tep_count_products_in_category($category_id, $include_inactive = false) { + $OSCOM_Db = Registry::get('Db'); + $products_count = 0; - if ($include_inactive == true) { - $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$category_id . "'"); - } else { - $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$category_id . "'"); + + $products_query = 'select count(*) as total from :table_products p, :table_products_to_categories p2c where p.products_id = p2c.products_id and p2c.categories_id = :categories_id'; + + if ($include_inactive == false) { + $products_query .= ' and p.products_status = 1'; } - $products = tep_db_fetch_array($products_query); - $products_count += $products['total']; - $child_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'"); - if (tep_db_num_rows($child_categories_query)) { - while ($child_categories = tep_db_fetch_array($child_categories_query)) { - $products_count += tep_count_products_in_category($child_categories['categories_id'], $include_inactive); - } + $Qproducts = $OSCOM_Db->prepare($products_query); + $Qproducts->bindInt(':categories_id', $category_id); + $Qproducts->execute(); + + if ($Qproducts->fetch() !== false) { + $products_count += $Qproducts->valueInt('total'); + } + + $Qcategories = $OSCOM_Db->prepare('select categories_id from :table_categories where parent_id = :parent_id'); + $Qcategories->bindInt(':parent_id', $category_id); + $Qcategories->execute(); + + if ($Qcategories->fetch() !== false) { + do { + $products_count += tep_count_products_in_category($Qcategories->valueInt('categories_id'), $include_inactive); + } while ($Qcategories->fetch()); } return $products_count; @@ -422,64 +442,74 @@ function tep_count_products_in_category($category_id, $include_inactive = false) // Return true if the category has subcategories // TABLES: categories function tep_has_category_subcategories($category_id) { - $child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'"); - $child_category = tep_db_fetch_array($child_category_query); + $OSCOM_Db = Registry::get('Db'); - if ($child_category['count'] > 0) { - return true; - } else { - return false; - } + $Qcheck = $OSCOM_Db->prepare('select categories_id from :table_categories where parent_id = :parent_id limit 1'); + $Qcheck->bindInt(':parent_id', $category_id); + $Qcheck->execute(); + + return ($Qcheck->fetch() !== false); } //// // Returns the address_format_id for the given country // TABLES: countries; function tep_get_address_format_id($country_id) { - $address_format_query = tep_db_query("select address_format_id as format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$country_id . "'"); - if (tep_db_num_rows($address_format_query)) { - $address_format = tep_db_fetch_array($address_format_query); - return $address_format['format_id']; - } else { - return '1'; + $OSCOM_Db = Registry::get('Db'); + + $format_id = 1; + + $Qformat = $OSCOM_Db->prepare('select address_format_id from :table_countries where countries_id = :countries_id'); + $Qformat->bindInt(':countries_id', $country_id); + $Qformat->execute(); + + if ($Qformat->fetch() !== false) { + $format_id = $Qformat->valueInt('address_format_id'); } + + return $format_id; } //// // Return a formatted address // TABLES: address_format function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { - $address_format_query = tep_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . (int)$address_format_id . "'"); - $address_format = tep_db_fetch_array($address_format_query); + $OSCOM_Db = Registry::get('Db'); + + $Qformat = $OSCOM_Db->prepare('select address_format from :table_address_format where address_format_id = :address_format_id'); + $Qformat->bindInt(':address_format_id', $address_format_id); + $Qformat->execute(); + + $replace = [ + '$company' => HTML::outputProtected($address['company']), + '$firstname' => '', + '$lastname' => '', + '$street' => HTML::outputProtected($address['street_address']), + '$suburb' => HTML::outputProtected($address['suburb']), + '$city' => HTML::outputProtected($address['city']), + '$state' => HTML::outputProtected($address['state']), + '$postcode' => HTML::outputProtected($address['postcode']), + '$country' => '' + ]; - $company = tep_output_string_protected($address['company']); if (isset($address['firstname']) && tep_not_null($address['firstname'])) { - $firstname = tep_output_string_protected($address['firstname']); - $lastname = tep_output_string_protected($address['lastname']); + $replace['$firstname'] = HTML::outputProtected($address['firstname']); + $replace['$lastname'] = HTML::outputProtected($address['lastname']); } elseif (isset($address['name']) && tep_not_null($address['name'])) { - $firstname = tep_output_string_protected($address['name']); - $lastname = ''; - } else { - $firstname = ''; - $lastname = ''; + $replace['$firstname'] = HTML::outputProtected($address['name']); } - $street = tep_output_string_protected($address['street_address']); - $suburb = tep_output_string_protected($address['suburb']); - $city = tep_output_string_protected($address['city']); - $state = tep_output_string_protected($address['state']); + if (isset($address['country_id']) && tep_not_null($address['country_id'])) { - $country = tep_get_country_name($address['country_id']); + $replace['$country'] = tep_get_country_name($address['country_id']); if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) { - $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state); + $replace['$state'] = tep_get_zone_code($address['country_id'], $address['zone_id'], $replace['$state']); } } elseif (isset($address['country']) && tep_not_null($address['country'])) { - $country = tep_output_string_protected($address['country']['title']); - } else { - $country = ''; + $replace['$country'] = HTML::outputProtected($address['country']['title']); } - $postcode = tep_output_string_protected($address['postcode']); - $zip = $postcode; + + $replace['$zip'] = $replace['$postcode']; if ($html) { // HTML Mode @@ -501,16 +531,20 @@ function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { $hr = '----------------------------------------'; } - $statecomma = ''; - $streets = $street; - if ($suburb != '') $streets = $street . $cr . $suburb; - if ($state != '') $statecomma = $state . ', '; + $replace['$CR'] = $CR; + $replace['$cr'] = $cr; + $replace['$HR'] = $HR; + $replace['$hr'] = $hr; + + $replace['$statecomma'] = ''; + $replace['$streets'] = $replace['$street']; + if ($replace['$suburb'] != '') $replace['$streets'] = $replace['$street'] . $replace['$cr'] . $replace['$suburb']; + if ($replace['$state'] != '') $replace['$statecomma'] = $replace['$state'] . ', '; - $fmt = $address_format['format']; - eval("\$address = \"$fmt\";"); + $address = strtr($Qformat->value('address_format'), $replace); - if ( (ACCOUNT_COMPANY == 'true') && (tep_not_null($company)) ) { - $address = $company . $cr . $address; + if ( (ACCOUNT_COMPANY == 'true') && tep_not_null($replace['$company']) ) { + $address = $replace['$company'] . $replace['$cr'] . $address; } return $address; @@ -520,16 +554,20 @@ function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { // Return a formatted address // TABLES: customers, address_book function tep_address_label($customers_id, $address_id = 1, $html = false, $boln = '', $eoln = "\n") { + $OSCOM_Db = Registry::get('Db'); + if (is_array($address_id) && !empty($address_id)) { return tep_address_format($address_id['address_format_id'], $address_id, $html, $boln, $eoln); } - $address_query = tep_db_query("select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$address_id . "'"); - $address = tep_db_fetch_array($address_query); + $Qaddress = $OSCOM_Db->prepare('select entry_firstname as firstname, entry_lastname as lastname, entry_company as company, entry_street_address as street_address, entry_suburb as suburb, entry_city as city, entry_postcode as postcode, entry_state as state, entry_zone_id as zone_id, entry_country_id as country_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); + $Qaddress->bindInt(':address_book_id', $address_id); + $Qaddress->bindInt(':customers_id', $customers_id); + $Qaddress->execute(); - $format_id = tep_get_address_format_id($address['country_id']); + $format_id = tep_get_address_format_id($Qaddress->valueInt('country_id')); - return tep_address_format($format_id, $address, $html, $boln, $eoln); + return tep_address_format($format_id, $Qaddress->toArray(), $html, $boln, $eoln); } function tep_row_number_format($number) { @@ -539,17 +577,21 @@ function tep_row_number_format($number) { } function tep_get_categories($categories_array = '', $parent_id = '0', $indent = '') { - global $languages_id; + $OSCOM_Db = Registry::get('Db'); if (!is_array($categories_array)) $categories_array = array(); - $categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); - while ($categories = tep_db_fetch_array($categories_query)) { - $categories_array[] = array('id' => $categories['categories_id'], - 'text' => $indent . $categories['categories_name']); + $Qcategories = $OSCOM_Db->prepare('select c.categories_id, cd.categories_name from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by c.sort_order, cd.categories_name'); + $Qcategories->bindInt(':parent_id', $parent_id); + $Qcategories->bindInt(':language_id', $_SESSION['languages_id']); + $Qcategories->execute(); + + while ($Qcategories->fetch()) { + $categories_array[] = array('id' => $Qcategories->valueInt('categories_id'), + 'text' => $indent . $Qcategories->value('categories_name')); - if ($categories['categories_id'] != $parent_id) { - $categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '  '); + if ($Qcategories->valueInt('categories_id') != $parent_id) { + $categories_array = tep_get_categories($categories_array, $Qcategories->valueInt('categories_id'), $indent . '  '); } } @@ -557,11 +599,14 @@ function tep_get_categories($categories_array = '', $parent_id = '0', $indent = } function tep_get_manufacturers($manufacturers_array = '') { + $OSCOM_Db = Registry::get('Db'); + if (!is_array($manufacturers_array)) $manufacturers_array = array(); - $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); - while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { - $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); + $Qmanufacturers = $OSCOM_Db->query('select manufacturers_id, manufacturers_name from :table_manufacturers order by manufacturers_name'); + + while ($Qmanufacturers->fetch()) { + $manufacturers_array[] = array('id' => $Qmanufacturers->valueInt('manufacturers_id'), 'text' => $Qmanufacturers->value('manufacturers_name')); } return $manufacturers_array; @@ -571,11 +616,17 @@ function tep_get_manufacturers($manufacturers_array = '') { // Return all subcategory IDs // TABLES: categories function tep_get_subcategories(&$subcategories_array, $parent_id = 0) { - $subcategories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$parent_id . "'"); - while ($subcategories = tep_db_fetch_array($subcategories_query)) { - $subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id']; - if ($subcategories['categories_id'] != $parent_id) { - tep_get_subcategories($subcategories_array, $subcategories['categories_id']); + $OSCOM_Db = Registry::get('Db'); + + $Qsub = $OSCOM_Db->prepare('select categories_id from :table_categories where parent_id = :parent_id'); + $Qsub->bindInt(':parent_id', $parent_id); + $Qsub->execute(); + + while ($Qsub->fetch()) { + $subcategories_array[sizeof($subcategories_array)] = $Qsub->valueInt('categories_id'); + + if ($Qsub->valueInt('categories_id') != $parent_id) { + tep_get_subcategories($subcategories_array, $Qsub->valueInt('categories_id')); } } } @@ -893,7 +944,7 @@ function tep_create_sort_heading($sortby, $colnum, $heading) { $sort_suffix = ''; if ($sortby) { - $sort_prefix = '' ; + $sort_prefix = '' ; $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . ''; } @@ -904,12 +955,19 @@ function tep_create_sort_heading($sortby, $colnum, $heading) { // Recursively go through the categories and retreive all parent categories IDs // TABLES: categories function tep_get_parent_categories(&$categories, $categories_id) { - $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'"); - while ($parent_categories = tep_db_fetch_array($parent_categories_query)) { - if ($parent_categories['parent_id'] == 0) return true; - $categories[sizeof($categories)] = $parent_categories['parent_id']; - if ($parent_categories['parent_id'] != $categories_id) { - tep_get_parent_categories($categories, $parent_categories['parent_id']); + $OSCOM_Db = Registry::get('Db'); + + $Qparent = $OSCOM_Db->prepare('select parent_id from :table_categories where categories_id = :categories_id'); + $Qparent->bindInt(':categories_id', $categories_id); + $Qparent->execute(); + + while ($Qparent->fetch()) { + if ($Qparent->valueInt('parent_id') == 0) return true; + + $categories[sizeof($categories)] = $Qparent->valueInt('parent_id'); + + if ($Qparent->valueInt('parent_id') != $categories_id) { + tep_get_parent_categories($categories, $Qparent->valueInt('parent_id')); } } } @@ -918,21 +976,24 @@ function tep_get_parent_categories(&$categories, $categories_id) { // Construct a category path to the product // TABLES: products_to_categories function tep_get_product_path($products_id) { + $OSCOM_Db = Registry::get('Db'); + $cPath = ''; - $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1"); - if (tep_db_num_rows($category_query)) { - $category = tep_db_fetch_array($category_query); + $Qcategory = $OSCOM_Db->prepare('select p2c.categories_id from :table_products p, :table_products_to_categories p2c where p.products_id = :products_id and p.products_status = 1 and p.products_id = p2c.products_id limit 1'); + $Qcategory->bindInt(':products_id', $products_id); + $Qcategory->execute(); + if ($Qcategory->fetch() !== false) { $categories = array(); - tep_get_parent_categories($categories, $category['categories_id']); + tep_get_parent_categories($categories, $Qcategory->valueInt('categories_id')); $categories = array_reverse($categories); $cPath = implode('_', $categories); if (tep_not_null($cPath)) $cPath .= '_'; - $cPath .= $category['categories_id']; + $cPath .= $Qcategory->valueInt('categories_id'); } return $cPath; @@ -944,12 +1005,11 @@ function tep_get_uprid($prid, $params) { if (is_numeric($prid)) { $uprid = (int)$prid; - if (is_array($params) && (sizeof($params) > 0)) { + if (is_array($params) && (!empty($params))) { $attributes_check = true; $attributes_ids = ''; - reset($params); - while (list($option, $value) = each($params)) { + foreach ($params as $option => $value) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { @@ -1011,12 +1071,10 @@ function tep_get_prid($uprid) { //// // Return a customer greeting function tep_customer_greeting() { - global $customer_id, $customer_first_name; - - if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) { - $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW)); + if (isset($_SESSION['customer_first_name']) && isset($_SESSION['customer_id'])) { + $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($_SESSION['customer_first_name']), OSCOM::link('products_new.php')); } else { - $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); + $greeting_string = sprintf(TEXT_GREETING_GUEST, OSCOM::link('login.php', '', 'SSL'), OSCOM::link('create_account.php', '', 'SSL')); } return $greeting_string; @@ -1058,22 +1116,13 @@ function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $fro //// // Check if product has attributes function tep_has_product_attributes($products_id) { - $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'"); - $attributes = tep_db_fetch_array($attributes_query); - - if ($attributes['count'] > 0) { - return true; - } else { - return false; - } - } + $OSCOM_Db = Registry::get('Db'); -//// -// Get the number of times a word/character is present in a string - function tep_word_count($string, $needle) { - $temp_array = preg_split('/' . $needle . '/', $string); + $Qattributes = $OSCOM_Db->prepare('select products_id from :table_products_attributes where products_id = :products_id limit 1'); + $Qattributes->bindInt(':products_id', $products_id); + $Qattributes->execute(); - return sizeof($temp_array); + return $Qattributes->fetch() !== false; } function tep_count_modules($modules = '') { @@ -1151,8 +1200,8 @@ function tep_array_to_string($array, $exclude = '', $equals = '=', $separator = if (!is_array($exclude)) $exclude = array(); $get_string = ''; - if (sizeof($array) > 0) { - while (list($key, $value) = each($array)) { + if (!empty($array)) { + foreach ($array as $key => $value) { if ( (!in_array($key, $exclude)) && ($key != 'x') && ($key != 'y') ) { $get_string .= $key . $equals . $value . $separator; } @@ -1166,11 +1215,17 @@ function tep_array_to_string($array, $exclude = '', $equals = '=', $separator = function tep_not_null($value) { if (is_array($value)) { - if (sizeof($value) > 0) { + if (!empty($value)) { return true; } else { return false; } + } elseif(is_object($value)) { + if (count(get_object_vars($value)) === 0) { + return false; + } else { + return true; + } } else { if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) { return true; @@ -1218,51 +1273,34 @@ function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) { // Checks to see if the currency code exists as a currency // TABLES: currencies function tep_currency_exists($code) { - $code = tep_db_prepare_input($code); + $OSCOM_Db = Registry::get('Db'); - $currency_query = tep_db_query("select code from " . TABLE_CURRENCIES . " where code = '" . tep_db_input($code) . "' limit 1"); - if (tep_db_num_rows($currency_query)) { - $currency = tep_db_fetch_array($currency_query); - return $currency['code']; - } else { - return false; + $Qcurrency = $OSCOM_Db->prepare('select code from :table_currencies where code = :code limit 1'); + $Qcurrency->bindValue(':code', $code); + $Qcurrency->execute(); + + if ($Qcurrency->fetch() !== false) { + return $Qcurrency->value('code'); } - } - function tep_string_to_int($string) { - return (int)$string; + return false; } //// // Parse and secure the cPath parameter values function tep_parse_category_path($cPath) { // make sure the category IDs are integers - $cPath_array = array_map('tep_string_to_int', explode('_', $cPath)); + $cPath_array = array_map(function ($string) { + return (int)$string; + }, explode('_', $cPath)); // make sure no duplicate category IDs exist which could lock the server in a loop - $tmp_array = array(); - $n = sizeof($cPath_array); - for ($i=0; $i<$n; $i++) { - if (!in_array($cPath_array[$i], $tmp_array)) { - $tmp_array[] = $cPath_array[$i]; - } - } - - return $tmp_array; + return array_keys(array_flip($cPath_array)); } //// // Return a random value function tep_rand($min = null, $max = null) { - static $seeded; - - if (!isset($seeded)) { - $seeded = true; - - if ( (PHP_VERSION < '4.2.0') ) { - mt_srand((double)microtime()*1000000); - } - } if (isset($min) && isset($max)) { if ($min >= $max) { @@ -1275,122 +1313,132 @@ function tep_rand($min = null, $max = null) { } } - function tep_setcookie($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = 0) { - setcookie($name, $value, $expire, $path, (tep_not_null($domain) ? $domain : ''), $secure); + function tep_setcookie($name, $value = '', $expire = 0, $path = null, $domain = null, $secure = 0) { + global $cookie_path, $cookie_domain; + + setcookie($name, $value, $expire, (isset($path)) ? $path : $cookie_path, (isset($domain)) ? $domain : $cookie_domain, $secure); } function tep_validate_ip_address($ip_address) { - if (function_exists('filter_var') && defined('FILTER_VALIDATE_IP')) { - return filter_var($ip_address, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)); - } - - if (preg_match('/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ip_address)) { - $parts = explode('.', $ip_address); - - foreach ($parts as $ip_parts) { - if ( (intval($ip_parts) > 255) || (intval($ip_parts) < 0) ) { - return false; // number is not within 0-255 - } - } - - return true; - } - - return false; + return filter_var($ip_address, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)); } function tep_get_ip_address() { - global $HTTP_SERVER_VARS; + static $_ip_address; - $ip_address = null; - $ip_addresses = array(); + if ( !isset($_ip_address) ) { + $_ip_address = '0.0.0.0'; + $ip_addresses = array(); - if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']) && !empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) { - foreach ( array_reverse(explode(',', $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) as $x_ip ) { - $x_ip = trim($x_ip); + if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { + foreach ( array_reverse(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])) as $x_ip ) { + $x_ip = trim($x_ip); - if (tep_validate_ip_address($x_ip)) { - $ip_addresses[] = $x_ip; + if ( tep_validate_ip_address($x_ip) ) { + $ip_addresses[] = $x_ip; + } } } - } - if (isset($HTTP_SERVER_VARS['HTTP_CLIENT_IP']) && !empty($HTTP_SERVER_VARS['HTTP_CLIENT_IP'])) { - $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_CLIENT_IP']; - } + if ( isset($_SERVER['HTTP_CLIENT_IP']) && !empty($_SERVER['HTTP_CLIENT_IP']) ) { + $ip_addresses[] = $_SERVER['HTTP_CLIENT_IP']; + } - if (isset($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP']) && !empty($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP'])) { - $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP']; - } + if ( isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && !empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) ) { + $ip_addresses[] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; + } - if (isset($HTTP_SERVER_VARS['HTTP_PROXY_USER']) && !empty($HTTP_SERVER_VARS['HTTP_PROXY_USER'])) { - $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_PROXY_USER']; - } + if ( isset($_SERVER['HTTP_PROXY_USER']) && !empty($_SERVER['HTTP_PROXY_USER']) ) { + $ip_addresses[] = $_SERVER['HTTP_PROXY_USER']; + } - $ip_addresses[] = $HTTP_SERVER_VARS['REMOTE_ADDR']; + if ( isset($_SERVER['REMOTE_ADDR']) && !empty($_SERVER['REMOTE_ADDR']) ) { + $ip_addresses[] = $_SERVER['REMOTE_ADDR']; + } - foreach ( $ip_addresses as $ip ) { - if (!empty($ip) && tep_validate_ip_address($ip)) { - $ip_address = $ip; - break; + foreach ( $ip_addresses as $ip ) { + if ( !empty($ip) && tep_validate_ip_address($ip) ) { + $_ip_address = $ip; + break; + } } } - return $ip_address; + return $_ip_address; } function tep_count_customer_orders($id = '', $check_session = true) { - global $customer_id, $languages_id; + $OSCOM_Db = Registry::get('Db'); if (is_numeric($id) == false) { - if (tep_session_is_registered('customer_id')) { - $id = $customer_id; + if (isset($_SESSION['customer_id'])) { + $id = $_SESSION['customer_id']; } else { return 0; } } if ($check_session == true) { - if ( (tep_session_is_registered('customer_id') == false) || ($id != $customer_id) ) { + if (!isset($_SESSION['customer_id']) || ($id != $_SESSION['customer_id'])) { return 0; } } - $orders_check_query = tep_db_query("select count(*) as total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$id . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.public_flag = '1'"); - $orders_check = tep_db_fetch_array($orders_check_query); + $Qorders = $OSCOM_Db->prepare('select count(*) as total from :table_orders o, :table_orders_status s where o.customers_id = :customers_id and o.orders_status = s.orders_status_id and s.language_id = :language_id and s.public_flag = 1'); + $Qorders->bindInt(':customers_id', $id); + $Qorders->bindInt(':language_id', $_SESSION['languages_id']); + $Qorders->execute(); + + if ($Qorders->fetch() !== false) { + return $Qorders->valueInt('total'); + } - return $orders_check['total']; + return 0; } function tep_count_customer_address_book_entries($id = '', $check_session = true) { - global $customer_id; + $OSCOM_Db = Registry::get('Db'); if (is_numeric($id) == false) { - if (tep_session_is_registered('customer_id')) { - $id = $customer_id; + if (isset($_SESSION['customer_id'])) { + $id = $_SESSION['customer_id']; } else { return 0; } } if ($check_session == true) { - if ( (tep_session_is_registered('customer_id') == false) || ($id != $customer_id) ) { + if (!isset($_SESSION['customer_id']) || ($id != $_SESSION['customer_id'])) { return 0; } } - $addresses_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$id . "'"); - $addresses = tep_db_fetch_array($addresses_query); + $Qaddresses = $OSCOM_Db->prepare('select count(*) as total from :table_address_book where customers_id = :customers_id'); + $Qaddresses->bindInt(':customers_id', $id); + $Qaddresses->execute(); - return $addresses['total']; + if ($Qaddresses->fetch() !== false) { + return $Qaddresses->valueInt('total'); + } + + return 0; } -// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) +// Convert linefeeds function tep_convert_linefeeds($from, $to, $string) { - if ((PHP_VERSION < "4.0.5") && is_array($from)) { - return preg_replace('/(' . implode('|', $from) . ')/', $to, $string); - } else { return str_replace($from, $to, $string); + } + +//// +// Creates a pull-down list of countries + function tep_get_country_list($name, $selected = '', $parameters = '') { + $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); + $countries = tep_get_countries(); + + for ($i=0, $n=sizeof($countries); $i<$n; $i++) { + $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); } + + return HTML::selectField($name, $countries_array, $selected, $parameters); } ?> diff --git a/catalog/includes/functions/gzip_compression.php b/catalog/includes/functions/gzip_compression.php index 0929de844..b02d4e6c2 100644 --- a/catalog/includes/functions/gzip_compression.php +++ b/catalog/includes/functions/gzip_compression.php @@ -5,21 +5,19 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ function tep_check_gzip() { - global $HTTP_ACCEPT_ENCODING; - if (headers_sent() || connection_aborted()) { return false; } - if (strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false) return 'x-gzip'; + if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false) return 'x-gzip'; - if (strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false) return 'gzip'; + if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) return 'gzip'; return false; } diff --git a/catalog/includes/functions/html_output.php b/catalog/includes/functions/html_output.php deleted file mode 100644 index efa70be28..000000000 --- a/catalog/includes/functions/html_output.php +++ /dev/null @@ -1,415 +0,0 @@ -


      Error!

      Unable to determine the page link!

      '); - } - - if ($connection == 'NONSSL') { - $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; - } elseif ($connection == 'SSL') { - if (ENABLE_SSL == true) { - $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; - } else { - $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; - } - } else { - die('


      Error!

      Unable to determine connection method on a link!

      Known methods: NONSSL SSL


      '); - } - - if (tep_not_null($parameters)) { - $link .= $page . '?' . tep_output_string($parameters); - $separator = '&'; - } else { - $link .= $page; - $separator = '?'; - } - - while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1); - -// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined - if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) { - if (tep_not_null($SID)) { - $_sid = $SID; - } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) { - if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { - $_sid = tep_session_name() . '=' . tep_session_id(); - } - } - } - - if (isset($_sid)) { - $link .= $separator . tep_output_string($_sid); - } - - while (strstr($link, '&&')) $link = str_replace('&&', '&', $link); - - if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) { - $link = str_replace('?', '/', $link); - $link = str_replace('&', '/', $link); - $link = str_replace('=', '/', $link); - } else { - $link = str_replace('&', '&', $link); - } - - return $link; - } - -//// -// The HTML image wrapper function - function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') { - if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { - return false; - } - -// alt is added to the img tag even if it is null to prevent browsers from outputting -// the image filename as default - $image = '' . tep_output_string($alt) . ''; - } - - return $form; - } - -//// -// Output a form input field - function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) { - global $HTTP_GET_VARS, $HTTP_POST_VARS; - - $field = ' '"', '\'' => ''', '<' => '<', '>' => '>')) . ''; - } - $field .= ''; - - if ($required == true) $field .= TEXT_FIELD_REQUIRED; - - return $field; - } - -//// -// Creates a pull-down list of countries - function tep_get_country_list($name, $selected = '', $parameters = '') { - $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT)); - $countries = tep_get_countries(); - - for ($i=0, $n=sizeof($countries); $i<$n; $i++) { - $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']); - } - - return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters); - } - -//// -// Output a jQuery UI Button - function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) { - static $button_counter = 1; - - $types = array('submit', 'button', 'reset'); - - if ( !isset($params['type']) ) { - $params['type'] = 'submit'; - } - - if ( !in_array($params['type'], $types) ) { - $params['type'] = 'submit'; - } - - if ( ($params['type'] == 'submit') && isset($link) ) { - $params['type'] = 'button'; - } - - if (!isset($priority)) { - $priority = 'secondary'; - } - - $button = ''; - - if ( ($params['type'] == 'button') && isset($link) ) { - $button .= ''; - - $button_counter++; - - return $button; - } -?> diff --git a/catalog/includes/functions/password_funcs.php b/catalog/includes/functions/password_funcs.php index 5484de908..2ae1514cb 100644 --- a/catalog/includes/functions/password_funcs.php +++ b/catalog/includes/functions/password_funcs.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ diff --git a/catalog/includes/functions/sessions.php b/catalog/includes/functions/sessions.php index aef1fda99..f81a810e0 100644 --- a/catalog/includes/functions/sessions.php +++ b/catalog/includes/functions/sessions.php @@ -5,15 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ - if ( (PHP_VERSION >= 4.3) && ((bool)ini_get('register_globals') == false) ) { - @ini_set('session.bug_compat_42', 1); - @ini_set('session.bug_compat_warn', 0); - } + use OSC\OM\OSCOM; + use OSC\OM\Registry; if (STORE_SESSIONS == 'mysql') { function _sess_open($save_path, $session_name) { @@ -25,71 +23,84 @@ function _sess_close() { } function _sess_read($key) { - $value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'"); - $value = tep_db_fetch_array($value_query); + $OSCOM_Db = Registry::get('Db'); + + $Qsession = $OSCOM_Db->prepare('select value from :table_sessions where sesskey = :sesskey'); + $Qsession->bindValue(':sesskey', $key); + $Qsession->execute(); - if (isset($value['value'])) { - return $value['value']; + if ($Qsession->fetch() !== false) { + return $Qsession->value('value'); } return ''; } function _sess_write($key, $value) { - $check_query = tep_db_query("select 1 from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'"); + $OSCOM_Db = Registry::get('Db'); + + $Qcheck = $OSCOM_Db->prepare('select 1 from :table_sessions where sesskey = :sesskey'); + $Qcheck->bindValue(':sesskey', $key); + $Qcheck->execute(); - if ( tep_db_num_rows($check_query) > 0 ) { - return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input(time()) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'"); + if ($Qcheck->fetch() !== false) { + return $OSCOM_Db->save('sessions', ['expiry' => time(), 'value' => $value], ['sesskey' => $key]); } else { - return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input(time()) . "', '" . tep_db_input($value) . "')"); + return $OSCOM_Db->save('sessions', ['sesskey' => $key, 'expiry' => time(), 'value' => $value]); } } function _sess_destroy($key) { - return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'"); + $OSCOM_Db = Registry::get('Db'); + + return $OSCOM_Db->delete('sessions', ['sesskey' => $key]); } function _sess_gc($maxlifetime) { - return tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . (time() - $maxlifetime) . "'"); + $OSCOM_Db = Registry::get('Db'); + + $Qdel = $OSCOM_Db->prepare('delete from :table_sessions where expiry < :expiry'); + $Qdel->bindValue(':expiry', time() - $maxlifetime); + $Qdel->execute(); + + return $Qdel->rowCount(); } session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc'); } function tep_session_start() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS; - $sane_session_id = true; - if ( isset($HTTP_GET_VARS[tep_session_name()]) ) { - if ( (SESSION_FORCE_COOKIE_USE == 'True') || (preg_match('/^[a-zA-Z0-9,-]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) ) { - unset($HTTP_GET_VARS[tep_session_name()]); + if ( isset($_GET[session_name()]) ) { + if ( (SESSION_FORCE_COOKIE_USE == 'True') || (preg_match('/^[a-zA-Z0-9,-]+$/', $_GET[session_name()]) == false) ) { + unset($_GET[session_name()]); $sane_session_id = false; } } - if ( isset($HTTP_POST_VARS[tep_session_name()]) ) { - if ( (SESSION_FORCE_COOKIE_USE == 'True') || (preg_match('/^[a-zA-Z0-9,-]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) ) { - unset($HTTP_POST_VARS[tep_session_name()]); + if ( isset($_POST[session_name()]) ) { + if ( (SESSION_FORCE_COOKIE_USE == 'True') || (preg_match('/^[a-zA-Z0-9,-]+$/', $_POST[session_name()]) == false) ) { + unset($_POST[session_name()]); $sane_session_id = false; } } - if ( isset($HTTP_COOKIE_VARS[tep_session_name()]) ) { - if ( preg_match('/^[a-zA-Z0-9,-]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false ) { + if ( isset($_COOKIE[session_name()]) ) { + if ( preg_match('/^[a-zA-Z0-9,-]+$/', $_COOKIE[session_name()]) == false ) { $session_data = session_get_cookie_params(); - setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']); - unset($HTTP_COOKIE_VARS[tep_session_name()]); + setcookie(session_name(), '', time()-42000, $session_data['path'], $session_data['domain']); + unset($_COOKIE[session_name()]); $sane_session_id = false; } } if ($sane_session_id == false) { - tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false)); + OSCOM::redirect('index.php', '', 'NONSSL', false); } register_shutdown_function('session_write_close'); @@ -97,98 +108,28 @@ function tep_session_start() { return session_start(); } - function tep_session_register($variable) { - global $session_started; - - if ($session_started == true) { - if (PHP_VERSION < 4.3) { - return session_register($variable); - } else { - if (!isset($GLOBALS[$variable])) { - $GLOBALS[$variable] = null; - } - - $_SESSION[$variable] =& $GLOBALS[$variable]; - } - } - - return false; - } - - function tep_session_is_registered($variable) { - if (PHP_VERSION < 4.3) { - return session_is_registered($variable); - } else { - return isset($_SESSION) && array_key_exists($variable, $_SESSION); - } - } - - function tep_session_unregister($variable) { - if (PHP_VERSION < 4.3) { - return session_unregister($variable); - } else { - unset($_SESSION[$variable]); - } - } - - function tep_session_id($sessid = '') { - if (!empty($sessid)) { - return session_id($sessid); - } else { - return session_id(); - } - } - - function tep_session_name($name = '') { - if (!empty($name)) { - return session_name($name); - } else { - return session_name(); - } - } - - function tep_session_close() { - if (PHP_VERSION >= '4.0.4') { - return session_write_close(); - } elseif (function_exists('session_close')) { - return session_close(); - } - } - function tep_session_destroy() { - global $HTTP_COOKIE_VARS; - - if ( isset($HTTP_COOKIE_VARS[tep_session_name()]) ) { + if ( isset($_COOKIE[session_name()]) ) { $session_data = session_get_cookie_params(); - setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']); - unset($HTTP_COOKIE_VARS[tep_session_name()]); + setcookie(session_name(), '', time()-42000, $session_data['path'], $session_data['domain']); + unset($_COOKIE[session_name()]); } return session_destroy(); } - function tep_session_save_path($path = '') { - if (!empty($path)) { - return session_save_path($path); - } else { - return session_save_path(); - } - } - function tep_session_recreate() { global $SID; - if (PHP_VERSION >= 5.1) { $old_id = session_id(); session_regenerate_id(true); if (!empty($SID)) { - $SID = tep_session_name() . '=' . tep_session_id(); + $SID = session_name() . '=' . session_id(); } - tep_whos_online_update_session_id($old_id, tep_session_id()); - } + tep_whos_online_update_session_id($old_id, session_id()); } ?> diff --git a/catalog/includes/functions/specials.php b/catalog/includes/functions/specials.php index a763b1454..b4164ed3b 100644 --- a/catalog/includes/functions/specials.php +++ b/catalog/includes/functions/specials.php @@ -5,25 +5,32 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2012 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + //// // Sets the status of a special product function tep_set_specials_status($specials_id, $status) { - return tep_db_query("update " . TABLE_SPECIALS . " set status = '" . (int)$status . "', date_status_change = now() where specials_id = '" . (int)$specials_id . "'"); + $OSCOM_Db = Registry::get('Db'); + + return $OSCOM_Db->save('specials', ['status' => $status, 'date_status_change' => 'now()'], ['specials_id' => $specials_id]); } //// // Auto expire products on special function tep_expire_specials() { - $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status = '1' and now() >= expires_date and expires_date > 0"); - if (tep_db_num_rows($specials_query)) { - while ($specials = tep_db_fetch_array($specials_query)) { - tep_set_specials_status($specials['specials_id'], '0'); - } + $OSCOM_Db = Registry::get('Db'); + + $Qspecials = $OSCOM_Db->query('select specials_id from :table_specials where status = 1 and now() >= expires_date and expires_date > 0'); + + if ($Qspecials->fetch() !== false) { + do { + tep_set_specials_status($Qspecials->valueInt('specials_id'), 0); + } while ($Qspecials->fetch()); } } -?> \ No newline at end of file +?> diff --git a/catalog/includes/functions/validations.php b/catalog/includes/functions/validations.php index 6b12706bb..32853d147 100644 --- a/catalog/includes/functions/validations.php +++ b/catalog/includes/functions/validations.php @@ -1,11 +1,10 @@ 255 ) { $valid_address = false; - } elseif ( function_exists('filter_var') && defined('FILTER_VALIDATE_EMAIL') ) { - $valid_address = (bool)filter_var($email, FILTER_VALIDATE_EMAIL); } else { - if ( substr_count( $email, '@' ) > 1 ) { - $valid_address = false; - } - - if ( preg_match("/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i", $email) ) { - $valid_address = true; - } else { - $valid_address = false; - } + $valid_address = (bool)filter_var($email, FILTER_VALIDATE_EMAIL); } if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') { diff --git a/catalog/includes/functions/whos_online.php b/catalog/includes/functions/whos_online.php index 6e0891e4e..33f99b4fc 100644 --- a/catalog/includes/functions/whos_online.php +++ b/catalog/includes/functions/whos_online.php @@ -5,46 +5,64 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + function tep_update_whos_online() { - global $customer_id; + $OSCOM_Db = Registry::get('Db'); - if (tep_session_is_registered('customer_id')) { - $wo_customer_id = $customer_id; + $wo_customer_id = 0; + $wo_full_name = 'Guest'; - $customer_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); - $customer = tep_db_fetch_array($customer_query); + if (isset($_SESSION['customer_id'])) { + $wo_customer_id = $_SESSION['customer_id']; - $wo_full_name = $customer['customers_firstname'] . ' ' . $customer['customers_lastname']; - } else { - $wo_customer_id = ''; - $wo_full_name = 'Guest'; + $Qcustomer = $OSCOM_Db->prepare('select customers_firstname, customers_lastname from :table_customers where customers_id = :customers_id'); + $Qcustomer->bindInt(':customers_id', $_SESSION['customer_id']); + $Qcustomer->execute(); + + $wo_full_name = $Qcustomer->value('customers_firstname') . ' ' . $Qcustomer->value('customers_lastname'); } - $wo_session_id = tep_session_id(); + $wo_session_id = session_id(); $wo_ip_address = tep_get_ip_address(); - $wo_last_page_url = tep_db_prepare_input(getenv('REQUEST_URI')); + + if (is_null($wo_ip_address)) { // database table field (ip_address) is not_null + $wo_ip_address = ''; + } + + $wo_last_page_url = ''; + + if (isset($_SERVER['REQUEST_URI']) && !empty($_SERVER['REQUEST_URI']) ) { + $wo_last_page_url = $_SERVER['REQUEST_URI']; + } $current_time = time(); $xx_mins_ago = ($current_time - 900); // remove entries that have expired - tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'"); + $Qdel = $OSCOM_Db->prepare('delete from :table_whos_online where time_last_click < :time_last_click'); + $Qdel->bindInt(':time_last_click', $xx_mins_ago); + $Qdel->execute(); - $stored_customer_query = tep_db_query("select session_id from " . TABLE_WHOS_ONLINE . " where session_id = '" . tep_db_input($wo_session_id) . "' limit 1"); + $Qsession = $OSCOM_Db->prepare('select session_id from :table_whos_online where session_id = :session_id limit 1'); + $Qsession->bindValue(':session_id', $wo_session_id); + $Qsession->execute(); - if ( tep_db_num_rows($stored_customer_query) > 0 ) { - tep_db_query("update " . TABLE_WHOS_ONLINE . " set customer_id = '" . (int)$wo_customer_id . "', full_name = '" . tep_db_input($wo_full_name) . "', ip_address = '" . tep_db_input($wo_ip_address) . "', time_last_click = '" . tep_db_input($current_time) . "', last_page_url = '" . tep_db_input($wo_last_page_url) . "' where session_id = '" . tep_db_input($wo_session_id) . "'"); + if ($Qsession->fetch() !== false) { + $OSCOM_Db->save('whos_online', ['customer_id' => $wo_customer_id, 'full_name' => $wo_full_name, 'ip_address' => $wo_ip_address, 'time_last_click' => $current_time, 'last_page_url' => $wo_last_page_url], ['session_id' => $wo_session_id]); } else { - tep_db_query("insert into " . TABLE_WHOS_ONLINE . " (customer_id, full_name, session_id, ip_address, time_entry, time_last_click, last_page_url) values ('" . (int)$wo_customer_id . "', '" . tep_db_input($wo_full_name) . "', '" . tep_db_input($wo_session_id) . "', '" . tep_db_input($wo_ip_address) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($current_time) . "', '" . tep_db_input($wo_last_page_url) . "')"); + $OSCOM_Db->save('whos_online', ['customer_id' => $wo_customer_id, 'full_name' => $wo_full_name, 'session_id' => $wo_session_id, 'ip_address' => $wo_ip_address, 'time_entry' => $current_time, 'time_last_click' => $current_time, 'last_page_url' => $wo_last_page_url]); } } function tep_whos_online_update_session_id($old_id, $new_id) { - tep_db_query("update " . TABLE_WHOS_ONLINE . " set session_id = '" . tep_db_input($new_id) . "' where session_id = '" . tep_db_input($old_id) . "'"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('whos_online', ['session_id' => $new_id], ['session_id' => $old_id]); } ?> diff --git a/catalog/includes/general.js b/catalog/includes/general.js index 0d12d45a6..808132374 100644 --- a/catalog/includes/general.js +++ b/catalog/includes/general.js @@ -4,7 +4,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ diff --git a/catalog/includes/header.php b/catalog/includes/header.php index 05dd3a435..48527b49a 100644 --- a/catalog/includes/header.php +++ b/catalog/includes/header.php @@ -5,58 +5,42 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ - - if ($messageStack->size('header') > 0) { - echo '
      ' . $messageStack->output('header') . '
      '; - } ?> -
    '; - $output .= tep_draw_hidden_field('configuration[' . $key . ']', '', 'id="ca_logo_cards"'); + $output .= HTML::hiddenField('configuration[' . $key . ']', '', 'id="ca_logo_cards"'); $drag_here_li = '
  • ' . addslashes(MODULE_BOXES_CARD_ACCEPTANCE_DRAG_HERE) . '
  • '; diff --git a/catalog/includes/modules/boxes/bm_categories.php b/catalog/includes/modules/boxes/bm_categories.php index 897659ba8..4048c0a94 100644 --- a/catalog/includes/modules/boxes/bm_categories.php +++ b/catalog/includes/modules/boxes/bm_categories.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class bm_categories { var $code = 'bm_categories'; var $group = 'boxes'; @@ -30,136 +32,16 @@ function bm_categories() { } } - function tep_show_category($counter) { - global $tree, $categories_string, $cPath_array; - - for ($i=0; $i<$tree[$counter]['level']; $i++) { - $categories_string .= "  "; - } - - $categories_string .= ''; - - if (isset($cPath_array) && in_array($counter, $cPath_array)) { - $categories_string .= ''; - } - -// display category name - $categories_string .= $tree[$counter]['name']; - - if (isset($cPath_array) && in_array($counter, $cPath_array)) { - $categories_string .= ''; - } - - if (tep_has_category_subcategories($counter)) { - $categories_string .= '->'; - } - - $categories_string .= ''; - - if (SHOW_COUNTS == 'true') { - $products_in_category = tep_count_products_in_category($counter); - if ($products_in_category > 0) { - $categories_string .= ' (' . $products_in_category . ')'; - } - } - - $categories_string .= '
    '; - - if ($tree[$counter]['next_id'] != false) { - $this->tep_show_category($tree[$counter]['next_id']); - } - } - - function getData() { - global $categories_string, $tree, $languages_id, $cPath, $cPath_array; - - $categories_string = ''; - $tree = array(); - - $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); - while ($categories = tep_db_fetch_array($categories_query)) { - $tree[$categories['categories_id']] = array('name' => $categories['categories_name'], - 'parent' => $categories['parent_id'], - 'level' => 0, - 'path' => $categories['categories_id'], - 'next_id' => false); - - if (isset($parent_id)) { - $tree[$parent_id]['next_id'] = $categories['categories_id']; - } - - $parent_id = $categories['categories_id']; - - if (!isset($first_element)) { - $first_element = $categories['categories_id']; - } - } - - if (tep_not_null($cPath)) { - $new_path = ''; - reset($cPath_array); - while (list($key, $value) = each($cPath_array)) { - unset($parent_id); - unset($first_id); - $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); - if (tep_db_num_rows($categories_query)) { - $new_path .= $value; - while ($row = tep_db_fetch_array($categories_query)) { - $tree[$row['categories_id']] = array('name' => $row['categories_name'], - 'parent' => $row['parent_id'], - 'level' => $key+1, - 'path' => $new_path . '_' . $row['categories_id'], - 'next_id' => false); - - if (isset($parent_id)) { - $tree[$parent_id]['next_id'] = $row['categories_id']; - } - - $parent_id = $row['categories_id']; - - if (!isset($first_id)) { - $first_id = $row['categories_id']; - } - - $last_id = $row['categories_id']; - } - $tree[$last_id]['next_id'] = $tree[$value]['next_id']; - $tree[$value]['next_id'] = $first_id; - $new_path .= '_'; - } else { - break; - } - } - } - - $this->tep_show_category($first_element); - - $data = '
    ' . - '
    ' . MODULE_BOXES_CATEGORIES_BOX_TITLE . '
    ' . - '
    ' . $categories_string . '
    ' . - '
    '; - - return $data; - } - function execute() { - global $SID, $oscTemplate; + global $oscTemplate, $cPath; - if ((USE_CACHE == 'true') && empty($SID)) { - $output = tep_cache_categories_box(); - } else { - $output = $this->getData(); - } + $OSCOM_CategoryTree = new category_tree(); - $oscTemplate->addBlock($output, $this->group); + ob_start(); + include('includes/modules/boxes/templates/categories.php'); + $data = ob_get_clean(); + + $oscTemplate->addBlock($data, $this->group); } function isEnabled() { @@ -171,17 +53,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Categories Module', 'MODULE_BOXES_CATEGORIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_CATEGORIES_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_CATEGORIES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Categories Module', + 'configuration_key' => 'MODULE_BOXES_CATEGORIES_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_CATEGORIES_CONTENT_PLACEMENT', + 'configuration_value' => 'Left Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_CATEGORIES_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_CATEGORIES_STATUS', 'MODULE_BOXES_CATEGORIES_CONTENT_PLACEMENT', 'MODULE_BOXES_CATEGORIES_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_currencies.php b/catalog/includes/modules/boxes/bm_currencies.php index db04046e5..c0038d3e6 100644 --- a/catalog/includes/modules/boxes/bm_currencies.php +++ b/catalog/includes/modules/boxes/bm_currencies.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_currencies { var $code = 'bm_currencies'; var $group = 'boxes'; @@ -31,31 +35,29 @@ function bm_currencies() { } function execute() { - global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate; + global $PHP_SELF, $currencies, $request_type, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (isset($currencies) && is_object($currencies) && (count($currencies->currencies) > 1)) { reset($currencies->currencies); $currencies_array = array(); - while (list($key, $value) = each($currencies->currencies)) { + foreach($currencies->currencies as $key => $value) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; - reset($HTTP_GET_VARS); - while (list($key, $value) = each($HTTP_GET_VARS)) { - if ( is_string($value) && ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { - $hidden_get_variables .= tep_draw_hidden_field($key, $value); + foreach ( $_GET as $key => $value ) { + if ( is_string($value) && ($key != 'currency') && ($key != session_name()) && ($key != 'x') && ($key != 'y') ) { + $hidden_get_variables .= HTML::hiddenField($key, $value); } } - $data = '
    ' . - '
    ' . MODULE_BOXES_CURRENCIES_BOX_TITLE . '
    ' . - '
    ' . - ' ' . tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . - ' ' . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '' . - '
    ' . - '
    '; + $form_output = HTML::form('currencies', OSCOM::link($PHP_SELF, '', $request_type, false), 'get', null, ['session_id' => true]) . HTML::selectField('currency', $currencies_array, $_SESSION['currency'], 'onchange="this.form.submit();"') . $hidden_get_variables . ''; + + ob_start(); + include('includes/modules/boxes/templates/currencies.php'); + $data = ob_get_clean(); + $oscTemplate->addBlock($data, $this->group); } @@ -71,17 +73,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Currencies Module', 'MODULE_BOXES_CURRENCIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_CURRENCIES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Currencies Module', + 'configuration_key' => 'MODULE_BOXES_CURRENCIES_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_CURRENCIES_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_CURRENCIES_STATUS', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'MODULE_BOXES_CURRENCIES_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_information.php b/catalog/includes/modules/boxes/bm_information.php index 88036261a..f7106a2f3 100644 --- a/catalog/includes/modules/boxes/bm_information.php +++ b/catalog/includes/modules/boxes/bm_information.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class bm_information { var $code = 'bm_information'; var $group = 'boxes'; @@ -33,15 +35,9 @@ function bm_information() { function execute() { global $oscTemplate; - $data = ''; + ob_start(); + include('includes/modules/boxes/templates/information.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -55,17 +51,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_INFORMATION_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_INFORMATION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Information Module', + 'configuration_key' => 'MODULE_BOXES_INFORMATION_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', + 'configuration_value' => 'Left Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_INFORMATION_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_INFORMATION_STATUS', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'MODULE_BOXES_INFORMATION_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_languages.php b/catalog/includes/modules/boxes/bm_languages.php index 3f48a6a53..7e45a090a 100644 --- a/catalog/includes/modules/boxes/bm_languages.php +++ b/catalog/includes/modules/boxes/bm_languages.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_languages { var $code = 'bm_languages'; var $group = 'boxes'; @@ -41,15 +45,13 @@ function execute() { if (count($lng->catalog_languages) > 1) { $languages_string = ''; - reset($lng->catalog_languages); - while (list($key, $value) = each($lng->catalog_languages)) { - $languages_string .= ' ' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . ' '; + foreach($lng->catalog_languages as $key => $value) { + $languages_string .= ' ' . HTML::image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name'], NULL, NULL, NULL, false) . ' '; } - $data = '
    ' . - '
    ' . MODULE_BOXES_LANGUAGES_BOX_TITLE . '
    ' . - '
    ' . $languages_string . '
    ' . - '
    '; + ob_start(); + include('includes/modules/boxes/templates/languages.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -65,17 +67,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Languages Module', 'MODULE_BOXES_LANGUAGES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_LANGUAGES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Languages Module', + 'configuration_key' => 'MODULE_BOXES_LANGUAGES_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_LANGUAGES_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_LANGUAGES_STATUS', 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT', 'MODULE_BOXES_LANGUAGES_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_manufacturer_info.php b/catalog/includes/modules/boxes/bm_manufacturer_info.php index 5b4fceb49..6d934e736 100644 --- a/catalog/includes/modules/boxes/bm_manufacturer_info.php +++ b/catalog/includes/modules/boxes/bm_manufacturer_info.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_manufacturer_info { var $code = 'bm_manufacturer_info'; var $group = 'boxes'; @@ -31,23 +35,30 @@ function bm_manufacturer_info() { } function execute() { - global $HTTP_GET_VARS, $languages_id, $oscTemplate; + global $oscTemplate; + + $OSCOM_Db = Registry::get('Db'); + + if (isset($_GET['products_id'])) { + $Qmanufacturer = $OSCOM_Db->prepare('select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from :table_manufacturers m left join :table_manufacturers_info mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = :languages_id), :table_products p where p.products_id = :products_id and p.manufacturers_id = m.manufacturers_id'); + $Qmanufacturer->bindInt(':languages_id', $_SESSION['languages_id']); + $Qmanufacturer->bindInt(':products_id', $_GET['products_id']); + $Qmanufacturer->execute(); - if (isset($HTTP_GET_VARS['products_id'])) { - $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); - if (tep_db_num_rows($manufacturer_query)) { - $manufacturer = tep_db_fetch_array($manufacturer_query); + if ($Qmanufacturer->fetch() !== false) { + $manufacturer_info_string = null; - $manufacturer_info_string = ''; - if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= ''; - if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= ''; - $manufacturer_info_string .= '' . - '
    ' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '
    ' . sprintf(MODULE_BOXES_MANUFACTURER_INFO_BOX_HOMEPAGE, $manufacturer['manufacturers_name']) . '
    ' . MODULE_BOXES_MANUFACTURER_INFO_BOX_OTHER_PRODUCTS . '
    '; + if (!empty($Qmanufacturer->value('manufacturers_image'))) { + $manufacturer_info_string .= '
    ' . HTML::image(DIR_WS_IMAGES . $Qmanufacturer->value('manufacturers_image'), $Qmanufacturer->value('manufacturers_name')) . '
    '; + } - $data = '
    ' . - '
    ' . MODULE_BOXES_MANUFACTURER_INFO_BOX_TITLE . '
    ' . - ' ' . $manufacturer_info_string . - '
    '; + if (!empty($Qmanufacturer->value('manufacturers_url'))) { + $manufacturer_info_string .= ''; + } + + ob_start(); + include('includes/modules/boxes/templates/manufacturer_info.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -63,17 +74,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Manufacturer Info Module', 'MODULE_BOXES_MANUFACTURER_INFO_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_MANUFACTURER_INFO_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_MANUFACTURER_INFO_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Manufacturer Info Module', + 'configuration_key' => 'MODULE_BOXES_MANUFACTURER_INFO_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_MANUFACTURER_INFO_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_MANUFACTURER_INFO_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_MANUFACTURER_INFO_STATUS', 'MODULE_BOXES_MANUFACTURER_INFO_CONTENT_PLACEMENT', 'MODULE_BOXES_MANUFACTURER_INFO_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_manufacturers.php b/catalog/includes/modules/boxes/bm_manufacturers.php index 4f62909dd..ec66c2b31 100644 --- a/catalog/includes/modules/boxes/bm_manufacturers.php +++ b/catalog/includes/modules/boxes/bm_manufacturers.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_manufacturers { var $code = 'bm_manufacturers'; var $group = 'boxes'; @@ -31,46 +35,53 @@ function bm_manufacturers() { } function getData() { - global $HTTP_GET_VARS, $request_type, $oscTemplate; + global $request_type, $oscTemplate; + + $OSCOM_Db = Registry::get('Db'); $data = ''; - $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); - if ($number_of_rows = tep_db_num_rows($manufacturers_query)) { - if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) { + $Qmanufacturers = $OSCOM_Db->query('select manufacturers_id, manufacturers_name from :table_manufacturers order by manufacturers_name'); + + $manufacturers = $Qmanufacturers->fetchAll(); + + if (!empty($manufacturers)) { + if (count($manufacturers) <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) { // Display a list - $manufacturers_list = '
      '; - while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { - $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); - if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '' . $manufacturers_name .''; - $manufacturers_list .= '
    • ' . $manufacturers_name . '
    • '; + $manufacturers_list = ''; - $content = $manufacturers_list; + $data = $manufacturers_list; } else { // Display a drop-down $manufacturers_array = array(); + if (MAX_MANUFACTURERS_LIST < 2) { $manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); } - while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { - $manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']); - $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], + foreach ($manufacturers as $m) { + $manufacturers_name = ((strlen($m['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($m['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $m['manufacturers_name']); + + $manufacturers_array[] = array('id' => $m['manufacturers_id'], 'text' => $manufacturers_name); } - $content = tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', $request_type, false), 'get') . - tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onchange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id() . - ''; + $data = HTML::form('manufacturers', OSCOM::link('index.php', '', $request_type, false), 'get', null, ['session_id' => true]) . + HTML::selectField('manufacturers_id', $manufacturers_array, (isset($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : ''), 'onchange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '"') . + ''; } - - $data = '
      ' . - '
      ' . MODULE_BOXES_MANUFACTURERS_BOX_TITLE . '
      ' . - '
      ' . $content . '
      ' . - '
      '; } return $data; @@ -85,7 +96,11 @@ function execute() { $output = $this->getData(); } - $oscTemplate->addBlock($output, $this->group); + ob_start(); + include('includes/modules/boxes/templates/manufacturers.php'); + $data = ob_get_clean(); + + $oscTemplate->addBlock($data, $this->group); } function isEnabled() { @@ -97,17 +112,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Manufacturers Module', 'MODULE_BOXES_MANUFACTURERS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_MANUFACTURERS_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_MANUFACTURERS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Manufacturers Module', + 'configuration_key' => 'MODULE_BOXES_MANUFACTURERS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_MANUFACTURERS_CONTENT_PLACEMENT', + 'configuration_value' => 'Left Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_MANUFACTURERS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_MANUFACTURERS_STATUS', 'MODULE_BOXES_MANUFACTURERS_CONTENT_PLACEMENT', 'MODULE_BOXES_MANUFACTURERS_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_order_history.php b/catalog/includes/modules/boxes/bm_order_history.php index e359e601a..48172effc 100644 --- a/catalog/includes/modules/boxes/bm_order_history.php +++ b/catalog/includes/modules/boxes/bm_order_history.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_order_history { var $code = 'bm_order_history'; var $group = 'boxes'; @@ -31,32 +34,37 @@ function bm_order_history() { } function execute() { - global $customer_id, $languages_id, $PHP_SELF, $oscTemplate; + global $PHP_SELF, $oscTemplate; + + $OSCOM_Db = Registry::get('Db'); - if (tep_session_is_registered('customer_id')) { + if (isset($_SESSION['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 = ''; - $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 .= ' ' . - ' ' . - ' ' . - ' '; + $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', $_SESSION['languages_id']); + $Qproducts->execute(); + + while ($Qproducts->fetch()) { + $customer_orders_string .= '
    • ' . $Qproducts->value('products_name') . '
    • '; } - $customer_orders_string .= '
      ' . $products['products_name'] . '' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '
      '; - $data = '
      ' . - '
      ' . MODULE_BOXES_ORDER_HISTORY_BOX_TITLE . '
      ' . - ' ' . $customer_orders_string . - '
      '; + ob_start(); + include('includes/modules/boxes/templates/order_history.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -72,17 +80,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Order History Module', 'MODULE_BOXES_ORDER_HISTORY_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_ORDER_HISTORY_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_ORDER_HISTORY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Order History Module', + 'configuration_key' => 'MODULE_BOXES_ORDER_HISTORY_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_ORDER_HISTORY_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_ORDER_HISTORY_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_ORDER_HISTORY_STATUS', 'MODULE_BOXES_ORDER_HISTORY_CONTENT_PLACEMENT', 'MODULE_BOXES_ORDER_HISTORY_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_product_notifications.php b/catalog/includes/modules/boxes/bm_product_notifications.php index e4a8b0ebc..2f90a5235 100644 --- a/catalog/includes/modules/boxes/bm_product_notifications.php +++ b/catalog/includes/modules/boxes/bm_product_notifications.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_product_notifications { var $code = 'bm_product_notifications'; var $group = 'boxes'; @@ -31,14 +34,13 @@ function bm_product_notifications() { } function execute() { - global $HTTP_GET_VARS, $customer_id, $PHP_SELF, $request_type, $oscTemplate; + global $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); + 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 = (($check['count'] > 0) ? true : false); + $notification_exists = ($Qcheck->fetch() !== false); } else { $notification_exists = false; } @@ -46,15 +48,14 @@ function execute() { $notif_contents = ''; if ($notification_exists == true) { - $notif_contents = '
      ' . tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'
      '; + $notif_contents = ' ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY_REMOVE, tep_get_products_name($_GET['products_id'])) .''; } else { - $notif_contents = '
      ' . tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'
      '; + $notif_contents = ' ' . sprintf(MODULE_BOXES_PRODUCT_NOTIFICATIONS_BOX_NOTIFY, tep_get_products_name($_GET['products_id'])) .''; } - $data = '
      ' . - ' ' . - ' ' . $notif_contents . - '
      '; + ob_start(); + include('includes/modules/boxes/templates/product_notifications.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -69,17 +70,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Product Notifications Module', 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Product Notifications Module', + 'configuration_key' => 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_PRODUCT_NOTIFICATIONS_STATUS', 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_CONTENT_PLACEMENT', 'MODULE_BOXES_PRODUCT_NOTIFICATIONS_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_product_social_bookmarks.php b/catalog/includes/modules/boxes/bm_product_social_bookmarks.php index b8efbbc24..2e1c2816d 100644 --- a/catalog/includes/modules/boxes/bm_product_social_bookmarks.php +++ b/catalog/includes/modules/boxes/bm_product_social_bookmarks.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class bm_product_social_bookmarks { var $code = 'bm_product_social_bookmarks'; var $group = 'boxes'; @@ -31,19 +33,19 @@ function bm_product_social_bookmarks() { } function execute() { - global $HTTP_GET_VARS, $language, $oscTemplate; + global $oscTemplate; - if ( isset($HTTP_GET_VARS['products_id']) && defined('MODULE_SOCIAL_BOOKMARKS_INSTALLED') && tep_not_null(MODULE_SOCIAL_BOOKMARKS_INSTALLED) ) { + if ( isset($_GET['products_id']) && defined('MODULE_SOCIAL_BOOKMARKS_INSTALLED') && tep_not_null(MODULE_SOCIAL_BOOKMARKS_INSTALLED) ) { $sbm_array = explode(';', MODULE_SOCIAL_BOOKMARKS_INSTALLED); $social_bookmarks = array(); foreach ( $sbm_array as $sbm ) { - $class = substr($sbm, 0, strrpos($sbm, '.')); + $class = basename($sbm, '.php'); if ( !class_exists($class) ) { - include(DIR_WS_LANGUAGES . $language . '/modules/social_bookmarks/' . $sbm); - include(DIR_WS_MODULES . 'social_bookmarks/' . $class . '.php'); + include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/social_bookmarks/' . $sbm); + include('includes/modules/social_bookmarks/' . $class . '.php'); } $sb = new $class(); @@ -54,10 +56,9 @@ function execute() { } if ( !empty($social_bookmarks) ) { - $data = '
      ' . - '
      ' . MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_BOX_TITLE . '
      ' . - '
      ' . implode(' ', $social_bookmarks) . '
      ' . - '
      '; + ob_start(); + include('includes/modules/boxes/templates/product_social_bookmarks.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -73,17 +74,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Product Social Bookmarks Module', 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Product Social Bookmarks Module', + 'configuration_key' => 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_STATUS', 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_CONTENT_PLACEMENT', 'MODULE_BOXES_PRODUCT_SOCIAL_BOOKMARKS_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_reviews.php b/catalog/includes/modules/boxes/bm_reviews.php index 0c6f71608..c867e4d88 100644 --- a/catalog/includes/modules/boxes/bm_reviews.php +++ b/catalog/includes/modules/boxes/bm_reviews.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_reviews { var $code = 'bm_reviews'; var $group = 'boxes'; @@ -31,37 +35,56 @@ function bm_reviews() { } function execute() { - global $languages_id, $HTTP_GET_VARS, $currencies, $oscTemplate; + global $currencies, $oscTemplate; - $random_select = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and r.reviews_status = 1"; - if (isset($HTTP_GET_VARS['products_id'])) { - $random_select .= " and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"; - } - $random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS; - $random_product = tep_random_select($random_select); + $OSCOM_Db = Registry::get('Db'); $reviews_box_contents = ''; - if ($random_product) { -// display random review box - $rand_review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'"); - $rand_review = tep_db_fetch_array($rand_review_query); + $sql_query = 'select r.reviews_id from :table_reviews r, :table_reviews_description rd, :table_products p, :table_products_description pd where r.reviews_status = 1 and r.products_id = p.products_id and p.products_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = :languages_id and p.products_id = pd.products_id and pd.language_id = rd.languages_id'; + + if (isset($_GET['products_id'])) { + $sql_query .= ' and p.products_id = :products_id'; + } + + $sql_query .= ' order by r.reviews_id desc limit ' . (int)MAX_RANDOM_SELECT_REVIEWS; - $rand_review_text = tep_break_string(tep_output_string_protected($rand_review['reviews_text']), 15, '-
      '); + $Qcheck = $OSCOM_Db->prepare($sql_query); + $Qcheck->bindInt(':languages_id', $_SESSION['languages_id']); + + if (isset($_GET['products_id'])) { + $Qcheck->bindInt(':products_id', $_GET['products_id']); + } - $reviews_box_contents .= '
      ' . $rand_review_text . ' ..
      ' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif' , sprintf(MODULE_BOXES_REVIEWS_BOX_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '
      '; - } elseif (isset($HTTP_GET_VARS['products_id'])) { + $Qcheck->execute(); + + $result = $Qcheck->fetchAll(); + + if (count($result) > 0) { + $result = $result[mt_rand(0, count($result)-1)]; + + $Qreview = $OSCOM_Db->prepare('select r.reviews_id, r.reviews_rating, substring(rd.reviews_text, 1, 60) as reviews_text, p.products_id, p.products_image, pd.products_name from :table_reviews r, :table_reviews_description rd, :table_products p, :table_products_description pd where r.reviews_id = :reviews_id and r.reviews_id = rd.reviews_id and rd.languages_id = :languages_id and r.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = rd.languages_id'); + $Qreview->bindInt(':reviews_id', $result['reviews_id']); + $Qreview->bindInt(':languages_id', $_SESSION['languages_id']); + $Qreview->execute(); + + if ($Qreview->fetch() !== false) { +// display random review box + $rand_review_text = tep_break_string($Qreview->valueProtected('reviews_text'), 15, '-
      '); + + $reviews_box_contents = '
      ' . HTML::stars($Qreview->valueInt('reviews_rating')) . '
      '; + } + } elseif (isset($_GET['products_id'])) { // display 'write a review' box - $reviews_box_contents .= '
      ' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '' . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW .'
      '; + $reviews_box_contents = ' ' . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW .''; } else { // display 'no reviews' box - $reviews_box_contents .= '
      ' . MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '
      '; + $reviews_box_contents = '

      ' . MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '

      '; } - $data = '
      ' . - ' ' . - ' ' . $reviews_box_contents . - '
      '; + ob_start(); + include('includes/modules/boxes/templates/reviews.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -75,17 +98,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Reviews Module', 'MODULE_BOXES_REVIEWS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_REVIEWS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_REVIEWS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Reviews Module', + 'configuration_key' => 'MODULE_BOXES_REVIEWS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_REVIEWS_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_REVIEWS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_REVIEWS_STATUS', 'MODULE_BOXES_REVIEWS_CONTENT_PLACEMENT', 'MODULE_BOXES_REVIEWS_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_search.php b/catalog/includes/modules/boxes/bm_search.php index 173940a50..52db5cc91 100644 --- a/catalog/includes/modules/boxes/bm_search.php +++ b/catalog/includes/modules/boxes/bm_search.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_search { var $code = 'bm_search'; var $group = 'boxes'; @@ -33,14 +37,14 @@ function bm_search() { function execute() { global $request_type, $oscTemplate; - $data = '
      ' . - '
      ' . MODULE_BOXES_SEARCH_BOX_TITLE . '
      ' . - '
      ' . - ' ' . tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', $request_type, false), 'get') . - ' ' . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 75%"') . ' ' . tep_draw_hidden_field('search_in_description', '1') . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', MODULE_BOXES_SEARCH_BOX_TITLE) . '
      ' . MODULE_BOXES_SEARCH_BOX_TEXT . '
      ' . MODULE_BOXES_SEARCH_BOX_ADVANCED_SEARCH . '' . - ' ' . - '
      ' . - '
      '; + $form_output = HTML::form('quick_find', OSCOM::link('advanced_search_result.php', '', $request_type, false), 'get', null, ['session_id' => true]) . + '
      ' . HTML::inputField('keywords', '', 'required aria-required="true" placeholder="' . TEXT_SEARCH_PLACEHOLDER . '"', 'search') . '
      ' . + HTML::hiddenField('search_in_description', '0') . + ''; + + ob_start(); + include('includes/modules/boxes/templates/search.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -54,17 +58,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Search Module', 'MODULE_BOXES_SEARCH_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SEARCH_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SEARCH_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Search Module', + 'configuration_key' => 'MODULE_BOXES_SEARCH_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_SEARCH_CONTENT_PLACEMENT', + 'configuration_value' => 'Left Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_SEARCH_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_SEARCH_STATUS', 'MODULE_BOXES_SEARCH_CONTENT_PLACEMENT', 'MODULE_BOXES_SEARCH_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_shopping_cart.php b/catalog/includes/modules/boxes/bm_shopping_cart.php index cdb44413d..b9d6e2e08 100644 --- a/catalog/includes/modules/boxes/bm_shopping_cart.php +++ b/catalog/includes/modules/boxes/bm_shopping_cart.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class bm_shopping_cart { var $code = 'bm_shopping_cart'; var $group = 'boxes'; @@ -31,56 +34,44 @@ function bm_shopping_cart() { } function execute() { - global $cart, $new_products_id_in_cart, $currencies, $oscTemplate; + global $new_products_id_in_cart, $currencies, $oscTemplate; $cart_contents_string = ''; - if ($cart->count_contents() > 0) { - $cart_contents_string = ''; - $products = $cart->get_products(); + if ($_SESSION['cart']->count_contents() > 0) { + $cart_contents_string = '
        '; + $products = $_SESSION['cart']->get_products(); for ($i=0, $n=sizeof($products); $i<$n; $i++) { - $cart_contents_string .= '
      '; + $cart_contents_string .= ''; - if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { - tep_session_unregister('new_products_id_in_cart'); + if ((isset($_SESSION['new_products_id_in_cart'])) && ($new_products_id_in_cart == $products[$i]['id'])) { + unset($_SESSION['new_products_id_in_cart']); } } - $cart_contents_string .= '' . - '' . - '
      '; - if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { - $cart_contents_string .= ''; + $cart_contents_string .= ''; - - if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { - $cart_contents_string .= ''; - } + $cart_contents_string .= ''; $cart_contents_string .= $products[$i]['name']; - if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) { - $cart_contents_string .= ''; - } - - $cart_contents_string .= '
      ' . tep_draw_separator() . '
      ' . $currencies->format($cart->show_total()) . '
      '; + $cart_contents_string .= '
    '; + $cart_footer_string = ''; } else { - $cart_contents_string .= '
    ' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '
    '; + $cart_contents_string .= '

    ' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '

    '; + $cart_footer_string = NULL; } - $data = '
    ' . - ' ' . - ' ' . $cart_contents_string . - '
    '; + ob_start(); + include('includes/modules/boxes/templates/shopping_cart.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -94,17 +85,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Shopping Cart Module', 'MODULE_BOXES_SHOPPING_CART_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SHOPPING_CART_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SHOPPING_CART_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Shopping Cart Module', + 'configuration_key' => 'MODULE_BOXES_SHOPPING_CART_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_SHOPPING_CART_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_SHOPPING_CART_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_SHOPPING_CART_STATUS', 'MODULE_BOXES_SHOPPING_CART_CONTENT_PLACEMENT', 'MODULE_BOXES_SHOPPING_CART_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_specials.php b/catalog/includes/modules/boxes/bm_specials.php index 441284840..14152c28d 100644 --- a/catalog/includes/modules/boxes/bm_specials.php +++ b/catalog/includes/modules/boxes/bm_specials.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class bm_specials { var $code = 'bm_specials'; var $group = 'boxes'; @@ -31,16 +33,32 @@ function bm_specials() { } function execute() { - global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate; + global $currencies, $oscTemplate; + + $OSCOM_Db = Registry::get('Db'); + + if (!isset($_GET['products_id'])) { + $Qcheck = $OSCOM_Db->prepare('select p.products_id from :table_specials s, :table_products p, :table_products_description pd where s.status = 1 and s.products_id = p.products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id order by s.specials_date_added desc limit ' . (int)MAX_RANDOM_SELECT_SPECIALS); + $Qcheck->bindInt(':language_id', $_SESSION['languages_id']); + $Qcheck->execute(); + + $result = $Qcheck->fetchAll(); + + if (count($result) > 0) { + $result = $result[mt_rand(0, count($result)-1)]; - if (!isset($HTTP_GET_VARS['products_id'])) { - if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) { - $data = '
    ' . - ' ' . - '
    ' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '
    ' . $random_product['products_name'] . '
    ' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '
    ' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '
    ' . - '
    '; + $Qproduct = $OSCOM_Db->prepare('select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from :table_products p, :table_products_description pd, :table_specials s where p.products_id = :products_id and p.products_id = s.products_id and p.products_id = pd.products_id and pd.language_id = :language_id'); + $Qproduct->bindInt(':products_id', $result['products_id']); + $Qproduct->bindInt(':language_id', $_SESSION['languages_id']); + $Qproduct->execute(); - $oscTemplate->addBlock($data, $this->group); + if (($random_product = $Qproduct->fetch()) !== false) { + ob_start(); + include('includes/modules/boxes/templates/specials.php'); + $data = ob_get_clean(); + + $oscTemplate->addBlock($data, $this->group); + } } } } @@ -54,17 +72,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Specials Module', 'MODULE_BOXES_SPECIALS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SPECIALS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Specials Module', + 'configuration_key' => 'MODULE_BOXES_SPECIALS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', + 'configuration_value' => 'Right Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_SPECIALS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_SPECIALS_STATUS', 'MODULE_BOXES_SPECIALS_CONTENT_PLACEMENT', 'MODULE_BOXES_SPECIALS_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/bm_whats_new.php b/catalog/includes/modules/boxes/bm_whats_new.php index a92e0cb48..c22f67c25 100644 --- a/catalog/includes/modules/boxes/bm_whats_new.php +++ b/catalog/includes/modules/boxes/bm_whats_new.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class bm_whats_new { var $code = 'bm_whats_new'; var $group = 'boxes'; @@ -33,7 +35,15 @@ function bm_whats_new() { 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)) { + $OSCOM_Db = Registry::get('Db'); + + $Qcheck = $OSCOM_Db->query('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 ' . (int)MAX_RANDOM_SELECT_NEW); + + $result = $Qcheck->fetchAll(); + + if (count($result) > 0) { + $random_product = $result[mt_rand(0, count($result)-1)]; + $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']); @@ -43,11 +53,10 @@ function execute() { } else { $whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])); } - - $data = ''; + + ob_start(); + include('includes/modules/boxes/templates/whats_new.php'); + $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } @@ -62,17 +71,47 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable What\'s New Module', 'MODULE_BOXES_WHATS_NEW_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_WHATS_NEW_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_WHATS_NEW_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable What\'s New Module', + 'configuration_key' => 'MODULE_BOXES_WHATS_NEW_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to add the module to your shop?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Placement', + 'configuration_key' => 'MODULE_BOXES_WHATS_NEW_CONTENT_PLACEMENT', + 'configuration_value' => 'Left Column', + 'configuration_description' => 'Should the module be loaded in the left or right column?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_BOXES_WHATS_NEW_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { return array('MODULE_BOXES_WHATS_NEW_STATUS', 'MODULE_BOXES_WHATS_NEW_CONTENT_PLACEMENT', 'MODULE_BOXES_WHATS_NEW_SORT_ORDER'); } } -?> + diff --git a/catalog/includes/modules/boxes/templates/best_sellers.php b/catalog/includes/modules/boxes/templates/best_sellers.php new file mode 100644 index 000000000..4d2c7e2ba --- /dev/null +++ b/catalog/includes/modules/boxes/templates/best_sellers.php @@ -0,0 +1,8 @@ +
    +
    +
    +
      + +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/card_acceptance.php b/catalog/includes/modules/boxes/templates/card_acceptance.php new file mode 100644 index 000000000..b6f36dd5b --- /dev/null +++ b/catalog/includes/modules/boxes/templates/card_acceptance.php @@ -0,0 +1,4 @@ +
    +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/categories.php b/catalog/includes/modules/boxes/templates/categories.php new file mode 100644 index 000000000..3f66ed47e --- /dev/null +++ b/catalog/includes/modules/boxes/templates/categories.php @@ -0,0 +1,12 @@ +setCategoryPath($cPath, '', ''); +$OSCOM_CategoryTree->setSpacerString('  ', 1); + +$OSCOM_CategoryTree->setParentGroupString('', true); + +$category_tree = $OSCOM_CategoryTree->getTree(); +?> +
    +
    + +
    diff --git a/catalog/includes/modules/boxes/templates/currencies.php b/catalog/includes/modules/boxes/templates/currencies.php new file mode 100644 index 000000000..ea1834597 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/currencies.php @@ -0,0 +1,4 @@ +
    +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/information.php b/catalog/includes/modules/boxes/templates/information.php new file mode 100644 index 000000000..6eb740aa4 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/information.php @@ -0,0 +1,12 @@ + +
    +
    + +
    diff --git a/catalog/includes/modules/boxes/templates/languages.php b/catalog/includes/modules/boxes/templates/languages.php new file mode 100644 index 000000000..2c36058d7 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/languages.php @@ -0,0 +1,4 @@ +
    +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/manufacturer_info.php b/catalog/includes/modules/boxes/templates/manufacturer_info.php new file mode 100644 index 000000000..cb1eac9ad --- /dev/null +++ b/catalog/includes/modules/boxes/templates/manufacturer_info.php @@ -0,0 +1,8 @@ + +
    +
    +
    + +
    diff --git a/catalog/includes/modules/boxes/templates/manufacturers.php b/catalog/includes/modules/boxes/templates/manufacturers.php new file mode 100644 index 000000000..15325074c --- /dev/null +++ b/catalog/includes/modules/boxes/templates/manufacturers.php @@ -0,0 +1,4 @@ +
    +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/order_history.php b/catalog/includes/modules/boxes/templates/order_history.php new file mode 100644 index 000000000..97fb4c1d8 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/order_history.php @@ -0,0 +1,8 @@ +
    +
    +
    +
      + +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/product_notifications.php b/catalog/includes/modules/boxes/templates/product_notifications.php new file mode 100644 index 000000000..5450e91e5 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/product_notifications.php @@ -0,0 +1,7 @@ + +
    +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/product_social_bookmarks.php b/catalog/includes/modules/boxes/templates/product_social_bookmarks.php new file mode 100644 index 000000000..00bef9555 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/product_social_bookmarks.php @@ -0,0 +1,4 @@ +
    +
    +
    +
    diff --git a/catalog/includes/modules/boxes/templates/reviews.php b/catalog/includes/modules/boxes/templates/reviews.php new file mode 100644 index 000000000..7f9521c9b --- /dev/null +++ b/catalog/includes/modules/boxes/templates/reviews.php @@ -0,0 +1,8 @@ + +
    +
    +
    +
    + diff --git a/catalog/includes/modules/boxes/templates/search.php b/catalog/includes/modules/boxes/templates/search.php new file mode 100644 index 000000000..8c0188bb8 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/search.php @@ -0,0 +1,8 @@ + +
    +
    +
    + +
    diff --git a/catalog/includes/modules/boxes/templates/shopping_cart.php b/catalog/includes/modules/boxes/templates/shopping_cart.php new file mode 100644 index 000000000..e42311a27 --- /dev/null +++ b/catalog/includes/modules/boxes/templates/shopping_cart.php @@ -0,0 +1,12 @@ + +
    +
    +
    +
      + +
    +
    + +
    diff --git a/catalog/includes/modules/boxes/templates/specials.php b/catalog/includes/modules/boxes/templates/specials.php new file mode 100644 index 000000000..64a2e1e8b --- /dev/null +++ b/catalog/includes/modules/boxes/templates/specials.php @@ -0,0 +1,12 @@ + +
    +
    + ' . MODULE_BOXES_SPECIALS_BOX_TITLE . ''; ?> +
    +
    + ' . HTML::image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '
    ' . $random_product['products_name'] . '
    ' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '
    ' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . ''; ?> +
    +
    diff --git a/catalog/includes/modules/boxes/templates/whats_new.php b/catalog/includes/modules/boxes/templates/whats_new.php new file mode 100644 index 000000000..2a08676ee --- /dev/null +++ b/catalog/includes/modules/boxes/templates/whats_new.php @@ -0,0 +1,9 @@ + +
    +
    +
    + ' . HTML::image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '
    ' . $random_product['products_name'] . '
    ' . $whats_new_price . '
    '; ?> +
    diff --git a/catalog/includes/modules/checkout_new_address.php b/catalog/includes/modules/checkout_new_address.php index b4a798573..62c200444 100644 --- a/catalog/includes/modules/checkout_new_address.php +++ b/catalog/includes/modules/checkout_new_address.php @@ -5,17 +5,18 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + if (!isset($process)) $process = false; ?>
    - - + - - - - +
    + +
    + + + ' . ENTRY_GENDER_TEXT . ''; ?> +
    +
    - - - - - - - - +
    + +
    + +
    +
    +
    + +
    + +
    +
    - - - - +
    + +
    + +
    +
    - - - - +
    + +
    + +
    +
    - - - - +
    + +
    + +
    +
    - - - - - - - - +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + - - - - + ?> + + - - - - -
    ' . ENTRY_GENDER_TEXT . '': ''); ?>
    ' . ENTRY_FIRST_NAME_TEXT . '': ''); ?>
    ' . ENTRY_LAST_NAME_TEXT . '': ''); ?>
    ' . ENTRY_COMPANY_TEXT . '': ''); ?>
    ' . ENTRY_STREET_ADDRESS_TEXT . '': ''); ?>
    ' . ENTRY_SUBURB_TEXT . '': ''); ?>
    ' . ENTRY_POST_CODE_TEXT . '': ''); ?>
    ' . ENTRY_CITY_TEXT . '': ''); ?>
    - - $zones_values['zone_name'], 'text' => $zones_values['zone_name']); +
    + +
    + get('zones', 'zone_name', ['zone_country_id' => $country], 'zone_name'); + while ($Qzones->fetch()) { + $zones_array[] = array('id' => $Qzones->value('zone_name'), 'text' => $Qzones->value('zone_name')); + } + echo HTML::selectField('state', $zones_array, 0, 'id="inputState"'); + } else { + echo HTML::inputField('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE_TEXT . '"'); + } + } else { + echo HTML::inputField('state', NULL, 'id="inputState" placeholder="' . ENTRY_STATE_TEXT . '"'); } - echo tep_draw_pull_down_menu('state', $zones_array); - } else { - echo tep_draw_input_field('state'); - } - } else { - echo tep_draw_input_field('state'); - } - - if (tep_not_null(ENTRY_STATE_TEXT)) echo ' ' . ENTRY_STATE_TEXT . ''; -?> - -
    ' . ENTRY_COUNTRY_TEXT . '': ''); ?>
    +
    + +
    + ' . ENTRY_COUNTRY_TEXT . ''; + ?> +
    +
    diff --git a/catalog/includes/modules/content/account/cm_account_braintree_cards.php b/catalog/includes/modules/content/account/cm_account_braintree_cards.php index dcfd9415e..92c682a00 100644 --- a/catalog/includes/modules/content/account/cm_account_braintree_cards.php +++ b/catalog/includes/modules/content/account/cm_account_braintree_cards.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class cm_account_braintree_cards { var $code; var $group; @@ -19,8 +22,6 @@ class cm_account_braintree_cards { var $enabled = false; function cm_account_braintree_cards() { - global $language; - $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); @@ -38,7 +39,7 @@ function cm_account_braintree_cards() { if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('braintree_cc.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { if ( !class_exists('braintree_cc') ) { - include(DIR_FS_CATALOG . 'includes/languages/' . $language . '/modules/payment/braintree_cc.php'); + include(DIR_FS_CATALOG . 'includes/languages/' . $_SESSION['language'] . '/modules/payment/braintree_cc.php'); include(DIR_FS_CATALOG . 'includes/modules/payment/braintree_cc.php'); } @@ -65,7 +66,7 @@ function execute() { global $oscTemplate; $oscTemplate->_data['account']['account']['links']['braintree_cards'] = array('title' => $this->public_title, - 'link' => tep_href_link('ext/modules/content/account/braintree/cards.php', '', 'SSL'), + 'link' => OSCOM::link('ext/modules/content/account/braintree/cards.php', '', 'SSL'), 'icon' => 'newwin'); } @@ -78,12 +79,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Braintree Card Management', 'MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_STATUS', 'True', 'Do you want to enable the Braintree Card Management module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Braintree Card Management', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Braintree Card Management module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/account/cm_account_sage_pay_cards.php b/catalog/includes/modules/content/account/cm_account_sage_pay_cards.php index e4fb126db..d848a0837 100644 --- a/catalog/includes/modules/content/account/cm_account_sage_pay_cards.php +++ b/catalog/includes/modules/content/account/cm_account_sage_pay_cards.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class cm_account_sage_pay_cards { var $code; var $group; @@ -19,8 +22,6 @@ class cm_account_sage_pay_cards { var $enabled = false; function cm_account_sage_pay_cards() { - global $language; - $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); @@ -38,7 +39,7 @@ function cm_account_sage_pay_cards() { if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('sage_pay_direct.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { if ( !class_exists('sage_pay_direct') ) { - include(DIR_FS_CATALOG . 'includes/languages/' . $language . '/modules/payment/sage_pay_direct.php'); + include(DIR_FS_CATALOG . 'includes/languages/' . $_SESSION['language'] . '/modules/payment/sage_pay_direct.php'); include(DIR_FS_CATALOG . 'includes/modules/payment/sage_pay_direct.php'); } @@ -65,7 +66,7 @@ function execute() { global $oscTemplate; $oscTemplate->_data['account']['account']['links']['sage_pay_cards'] = array('title' => $this->public_title, - 'link' => tep_href_link('ext/modules/content/account/sage_pay/cards.php', '', 'SSL'), + 'link' => OSCOM::link('ext/modules/content/account/sage_pay/cards.php', '', 'SSL'), 'icon' => 'newwin'); } @@ -78,12 +79,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Sage Pay Card Management', 'MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_STATUS', 'True', 'Do you want to enable the Sage Pay Card Management module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Sage Pay Card Management', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Sage Pay Card Management module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_SAGE_PAY_CARDS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/account/cm_account_set_password.php b/catalog/includes/modules/content/account/cm_account_set_password.php index 9cdd4c596..4213866e3 100644 --- a/catalog/includes/modules/content/account/cm_account_set_password.php +++ b/catalog/includes/modules/content/account/cm_account_set_password.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class cm_account_set_password { var $code; var $group; @@ -32,13 +35,14 @@ function cm_account_set_password() { } function execute() { - global $customer_id, $oscTemplate; + global $oscTemplate; + + $OSCOM_Db = Registry::get('Db'); - if ( tep_session_is_registered('customer_id') ) { - $check_query = tep_db_query("select customers_password from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); - $check = tep_db_fetch_array($check_query); + if ( isset($_SESSION['customer_id']) ) { + $Qcheck = $OSCOM_Db->get('customers', 'customers_password', ['customers_id' => $_SESSION['customer_id']]); - if ( empty($check['customers_password']) ) { + if ( empty($Qcheck->value('customers_password')) ) { $counter = 0; foreach ( array_keys($oscTemplate->_data['account']['account']['links']) as $key ) { @@ -56,7 +60,7 @@ function execute() { if ( MODULE_CONTENT_ACCOUNT_SET_PASSWORD_ALLOW_PASSWORD == 'True' ) { $oscTemplate->_data['account']['account']['links'] += array('set_password' => array('title' => MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SET_PASSWORD_LINK_TITLE, - 'link' => tep_href_link('ext/modules/content/account/set_password.php', '', 'SSL'), + 'link' => OSCOM::link('ext/modules/content/account/set_password.php', '', 'SSL'), 'icon' => 'key')); } @@ -74,13 +78,43 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Set Account Password', 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS', 'True', 'Do you want to enable the Set Account Password module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Local Passwords', 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_ALLOW_PASSWORD', 'True', 'Allow local account passwords to be set.', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Set Account Password', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Set Account Password module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Allow Local Passwords', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_ALLOW_PASSWORD', + 'configuration_value' => 'True', + 'configuration_description' => 'Allow local account passwords to be set.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/account/cm_account_stripe_cards.php b/catalog/includes/modules/content/account/cm_account_stripe_cards.php deleted file mode 100644 index c17d1b4dd..000000000 --- a/catalog/includes/modules/content/account/cm_account_stripe_cards.php +++ /dev/null @@ -1,93 +0,0 @@ -code = get_class($this); - $this->group = basename(dirname(__FILE__)); - - $this->title = MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_TITLE; - $this->description = MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_DESCRIPTION; - - if ( defined('MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_STATUS') ) { - $this->sort_order = MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_SORT_ORDER; - $this->enabled = (MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_STATUS == 'True'); - } - - $this->public_title = MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_LINK_TITLE; - - $stripe_enabled = false; - - if ( defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && in_array('stripe.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { - if ( !class_exists('stripe') ) { - include(DIR_FS_CATALOG . 'includes/languages/' . $language . '/modules/payment/stripe.php'); - include(DIR_FS_CATALOG . 'includes/modules/payment/stripe.php'); - } - - $stripe = new stripe(); - - if ( $stripe->enabled ) { - $stripe_enabled = true; - - if ( MODULE_PAYMENT_STRIPE_TRANSACTION_SERVER == 'Test' ) { - $this->title .= ' [Test]'; - $this->public_title .= ' (' . $stripe->code . '; Test)'; - } - } - } - - if ( $stripe_enabled !== true ) { - $this->enabled = false; - - $this->description = '
    ' . MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_ERROR_MAIN_MODULE . '
    ' . $this->description; - } - } - - function execute() { - global $oscTemplate; - - $oscTemplate->_data['account']['account']['links']['stripe_cards'] = array('title' => $this->public_title, - 'link' => tep_href_link('ext/modules/content/account/stripe/cards.php', '', 'SSL'), - 'icon' => 'newwin'); - } - - function isEnabled() { - return $this->enabled; - } - - function check() { - return defined('MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_STATUS'); - } - - function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Stripe Card Management', 'MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_STATUS', 'True', 'Do you want to enable the Stripe Card Management module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_STATUS', 'MODULE_CONTENT_ACCOUNT_STRIPE_CARDS_SORT_ORDER'); - } - } -?> diff --git a/catalog/includes/modules/content/checkout_success/cm_cs_downloads.php b/catalog/includes/modules/content/checkout_success/cm_cs_downloads.php index 0b779b0ae..f104d6150 100644 --- a/catalog/includes/modules/content/checkout_success/cm_cs_downloads.php +++ b/catalog/includes/modules/content/checkout_success/cm_cs_downloads.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class cm_cs_downloads { var $code; var $group; @@ -53,12 +55,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Product Downloads Module', 'MODULE_CONTENT_CHECKOUT_SUCCESS_DOWNLOADS_STATUS', 'True', 'Should ordered product download links be shown on the checkout success page?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_CHECKOUT_SUCCESS_DOWNLOADS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Product Downloads Module', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_DOWNLOADS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Should ordered product download links be shown on the checkout success page?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_DOWNLOADS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/checkout_success/cm_cs_product_notifications.php b/catalog/includes/modules/content/checkout_success/cm_cs_product_notifications.php index 8aa4302b6..130484ff7 100644 --- a/catalog/includes/modules/content/checkout_success/cm_cs_product_notifications.php +++ b/catalog/includes/modules/content/checkout_success/cm_cs_product_notifications.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\Registry; + class cm_cs_product_notifications { var $code; var $group; @@ -32,23 +35,28 @@ function cm_cs_product_notifications() { } function execute() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $oscTemplate, $customer_id, $order_id; + global $oscTemplate, $order_id; + + $OSCOM_Db = Registry::get('Db'); - if ( tep_session_is_registered('customer_id') ) { - $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'"); - $global = tep_db_fetch_array($global_query); + if ( isset($_SESSION['customer_id']) ) { + $Qglobal = $OSCOM_Db->get('customers_info', 'global_product_notifications', ['customers_info_id' => $_SESSION['customer_id']]); - if ( $global['global_product_notifications'] != '1' ) { - if ( isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update') ) { - if ( isset($HTTP_POST_VARS['notify']) && is_array($HTTP_POST_VARS['notify']) && !empty($HTTP_POST_VARS['notify']) ) { - $notify = array_unique($HTTP_POST_VARS['notify']); + if ( $Qglobal->valueInt('global_product_notifications') !== 1 ) { + if ( isset($_GET['action']) && ($_GET['action'] == 'update') ) { + if ( isset($_POST['notify']) && is_array($_POST['notify']) && !empty($_POST['notify']) ) { + $notify = array_unique($_POST['notify']); foreach ( $notify as $n ) { if ( is_numeric($n) && ($n > 0) ) { - $check_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$n . "' and customers_id = '" . (int)$customer_id . "' limit 1"); - - if ( !tep_db_num_rows($check_query) ) { - tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . (int)$n . "', '" . (int)$customer_id . "', now())"); + $Qcheck = $OSCOM_Db->get('products_notifications', 'products_id', ['products_id' => $n, 'customers_id' => $_SESSION['customer_id']], null, 1); + + if ( $Qcheck->fetch() === false ) { + $OSCOM_Db->save('products_notifications', [ + 'products_id' => $n, + 'customers_id' => $_SESSION['customer_id'], + 'date_added' => 'now()' + ]); } } } @@ -57,10 +65,18 @@ function execute() { $products_displayed = array(); - $products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "' order by products_name"); - while ($products = tep_db_fetch_array($products_query)) { - if ( !isset($products_displayed[$products['products_id']]) ) { - $products_displayed[$products['products_id']] = tep_draw_checkbox_field('notify[]', $products['products_id']) . ' ' . $products['products_name']; + $Qproducts = $OSCOM_Db->get('orders_products', ['products_id', 'products_name'], ['orders_id' => $order_id], 'products_name'); + + while ($Qproducts->fetch()) { + if ( !isset($products_displayed[$Qproducts->valueInt('products_id')]) ) { + $products_displayed[$Qproducts->valueInt('products_id')] = '
    ' . + ' ' . + '
    ' . + '
    ' . + ' ' . + '
    ' . + '
    ' . + '
    '; } } @@ -84,12 +100,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Product Notifications Module', 'MODULE_CONTENT_CHECKOUT_SUCCESS_PRODUCT_NOTIFICATIONS_STATUS', 'True', 'Should the product notifications block be shown on the checkout success page?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_CHECKOUT_SUCCESS_PRODUCT_NOTIFICATIONS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '3', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Product Notifications Module', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_PRODUCT_NOTIFICATIONS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Should the product notifications block be shown on the checkout success page?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_PRODUCT_NOTIFICATIONS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/checkout_success/cm_cs_redirect_old_order.php b/catalog/includes/modules/content/checkout_success/cm_cs_redirect_old_order.php index a8a42d169..289c49634 100644 --- a/catalog/includes/modules/content/checkout_success/cm_cs_redirect_old_order.php +++ b/catalog/includes/modules/content/checkout_success/cm_cs_redirect_old_order.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class cm_cs_redirect_old_order { var $code; var $group; @@ -34,11 +37,16 @@ function cm_cs_redirect_old_order() { function execute() { global $order_id; + $OSCOM_Db = Registry::get('Db'); + if ( (int)MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES > 0 ) { - $check_query = tep_db_query("select 1 from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "' and date_purchased < date_sub(now(), interval '" . (int)MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES . "' minute)"); + $Qcheck = $OSCOM_Db->prepare('select 1 from :table_orders where orders_id = :orders_id and date_purchased < date_sub(now(), interval :limit_minutes minute) limit 1'); + $Qcheck->bindInt(':orders_id', $order_id); + $Qcheck->bindInt(':limit_minutes', MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES); + $Qcheck->execute(); - if ( tep_db_num_rows($check_query) ) { - tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL')); + if ($Qcheck->fetch() !== false) { + OSCOM::redirect('account.php', '', 'SSL'); } } } @@ -52,13 +60,42 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Redirect Old Order Module', 'MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_STATUS', 'True', 'Should customers be redirected when viewing old checkout success orders?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Redirect Minutes', 'MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES', '60', 'Redirect customers to the My Account page after an order older than this amount is viewed.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Redirect Old Order Module', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Should customers be redirected when viewing old checkout success orders?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Redirect Minutes', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES', + 'configuration_value' => '60', + 'configuration_description' => 'Redirect customers to the My Account page after an order older than this amount is viewed.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/checkout_success/cm_cs_thank_you.php b/catalog/includes/modules/content/checkout_success/cm_cs_thank_you.php index 1636508e1..82aef22a8 100644 --- a/catalog/includes/modules/content/checkout_success/cm_cs_thank_you.php +++ b/catalog/includes/modules/content/checkout_success/cm_cs_thank_you.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class cm_cs_thank_you { var $code; var $group; @@ -50,12 +52,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Thank You Module', 'MODULE_CONTENT_CHECKOUT_SUCCESS_THANK_YOU_STATUS', 'True', 'Should the thank you block be shown on the checkout success page?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_CHECKOUT_SUCCESS_THANK_YOU_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Thank You Module', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_THANK_YOU_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Should the thank you block be shown on the checkout success page?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_CHECKOUT_SUCCESS_THANK_YOU_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/checkout_success/templates/thank_you.php b/catalog/includes/modules/content/checkout_success/templates/thank_you.php index 026c33cb5..15c4a50e0 100644 --- a/catalog/includes/modules/content/checkout_success/templates/thank_you.php +++ b/catalog/includes/modules/content/checkout_success/templates/thank_you.php @@ -1,11 +1,20 @@ +
    - +
    + +
    -
    ' . sprintf(MODULE_CONTENT_CHECKOUT_SUCCESS_TEXT_CONTACT_STORE_OWNER, tep_href_link(FILENAME_CONTACT_US)); ?> +
    +
    ' . sprintf(MODULE_CONTENT_CHECKOUT_SUCCESS_TEXT_CONTACT_STORE_OWNER, OSCOM::link('contact_us.php')); ?> +
    -

    +
    diff --git a/catalog/includes/modules/content/footer/cm_footer_account.php b/catalog/includes/modules/content/footer/cm_footer_account.php new file mode 100644 index 000000000..345319d26 --- /dev/null +++ b/catalog/includes/modules/content/footer/cm_footer_account.php @@ -0,0 +1,112 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_FOOTER_ACCOUNT_TITLE; + $this->description = MODULE_CONTENT_FOOTER_ACCOUNT_DESCRIPTION; + + if ( defined('MODULE_CONTENT_FOOTER_ACCOUNT_STATUS') ) { + $this->sort_order = MODULE_CONTENT_FOOTER_ACCOUNT_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_FOOTER_ACCOUNT_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_FOOTER_ACCOUNT_CONTENT_WIDTH; + + if ( isset($_SESSION['customer_id']) ) { + $account_content = '
  • ' . MODULE_CONTENT_FOOTER_ACCOUNT_BOX_ACCOUNT . '
  • ' . + '
  • ' . MODULE_CONTENT_FOOTER_ACCOUNT_BOX_ADDRESS_BOOK . '
  • ' . + '
  • ' . MODULE_CONTENT_FOOTER_ACCOUNT_BOX_ORDER_HISTORY . '
  • ' . + '

  • ' . MODULE_CONTENT_FOOTER_ACCOUNT_BOX_LOGOFF . '
  • '; + } + else { + $account_content = '
  • ' . MODULE_CONTENT_FOOTER_ACCOUNT_BOX_CREATE_ACCOUNT . '
  • ' . + '

  • ' . MODULE_CONTENT_FOOTER_ACCOUNT_BOX_LOGIN . '
  • '; + } + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/account.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_FOOTER_ACCOUNT_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Account Footer Module', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_ACCOUNT_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Account content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_ACCOUNT_CONTENT_WIDTH', + 'configuration_value' => '3', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_ACCOUNT_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_FOOTER_ACCOUNT_STATUS', 'MODULE_CONTENT_FOOTER_ACCOUNT_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_ACCOUNT_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/footer/cm_footer_contact_us.php b/catalog/includes/modules/content/footer/cm_footer_contact_us.php new file mode 100644 index 000000000..8328acdce --- /dev/null +++ b/catalog/includes/modules/content/footer/cm_footer_contact_us.php @@ -0,0 +1,100 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_FOOTER_CONTACT_US_TITLE; + $this->description = MODULE_CONTENT_FOOTER_CONTACT_US_DESCRIPTION; + + if ( defined('MODULE_CONTENT_FOOTER_CONTACT_US_STATUS') ) { + $this->sort_order = MODULE_CONTENT_FOOTER_CONTACT_US_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_FOOTER_CONTACT_US_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_FOOTER_CONTACT_US_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/contact_us.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_FOOTER_CONTACT_US_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Contact Us Footer Module', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_CONTACT_US_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Contact Us content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_CONTACT_US_CONTENT_WIDTH', + 'configuration_value' => '3', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_CONTACT_US_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_FOOTER_CONTACT_US_STATUS', 'MODULE_CONTENT_FOOTER_CONTACT_US_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_CONTACT_US_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/footer/cm_footer_information_links.php b/catalog/includes/modules/content/footer/cm_footer_information_links.php new file mode 100644 index 000000000..e7a20065c --- /dev/null +++ b/catalog/includes/modules/content/footer/cm_footer_information_links.php @@ -0,0 +1,100 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_FOOTER_INFORMATION_TITLE; + $this->description = MODULE_CONTENT_FOOTER_INFORMATION_DESCRIPTION; + + if ( defined('MODULE_CONTENT_FOOTER_INFORMATION_STATUS') ) { + $this->sort_order = MODULE_CONTENT_FOOTER_INFORMATION_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_FOOTER_INFORMATION_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_FOOTER_INFORMATION_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/links.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_FOOTER_INFORMATION_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Information Links Footer Module', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_INFORMATION_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Information Links content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_INFORMATION_CONTENT_WIDTH', + 'configuration_value' => '3', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_INFORMATION_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_FOOTER_INFORMATION_STATUS', 'MODULE_CONTENT_FOOTER_INFORMATION_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_INFORMATION_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/footer/cm_footer_text.php b/catalog/includes/modules/content/footer/cm_footer_text.php new file mode 100644 index 000000000..673992fbb --- /dev/null +++ b/catalog/includes/modules/content/footer/cm_footer_text.php @@ -0,0 +1,100 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_FOOTER_TEXT_TITLE; + $this->description = MODULE_CONTENT_FOOTER_TEXT_DESCRIPTION; + + if ( defined('MODULE_CONTENT_FOOTER_TEXT_STATUS') ) { + $this->sort_order = MODULE_CONTENT_FOOTER_TEXT_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_FOOTER_TEXT_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_FOOTER_TEXT_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/text.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_FOOTER_TEXT_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Generic Text Footer Module', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_TEXT_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Generic Text content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_TEXT_CONTENT_WIDTH', + 'configuration_value' => '3', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_TEXT_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_FOOTER_TEXT_STATUS', 'MODULE_CONTENT_FOOTER_TEXT_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_TEXT_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/footer/templates/account.php b/catalog/includes/modules/content/footer/templates/account.php new file mode 100644 index 000000000..106aaff5c --- /dev/null +++ b/catalog/includes/modules/content/footer/templates/account.php @@ -0,0 +1,10 @@ +
    + +
    diff --git a/catalog/includes/modules/content/footer/templates/contact_us.php b/catalog/includes/modules/content/footer/templates/contact_us.php new file mode 100644 index 000000000..4c23913c7 --- /dev/null +++ b/catalog/includes/modules/content/footer/templates/contact_us.php @@ -0,0 +1,17 @@ + +
    +
    +

    +
    +
    +
    + P:
    + E: +
    +
      +
    • +
    +
    +
    diff --git a/catalog/includes/modules/content/footer/templates/links.php b/catalog/includes/modules/content/footer/templates/links.php new file mode 100644 index 000000000..3fba115ca --- /dev/null +++ b/catalog/includes/modules/content/footer/templates/links.php @@ -0,0 +1,14 @@ + +
    +
    +

    +
      +
    • +
    • +
    • +
    • +
    +
    +
    diff --git a/catalog/includes/modules/content/footer/templates/text.php b/catalog/includes/modules/content/footer/templates/text.php new file mode 100644 index 000000000..3958c7f51 --- /dev/null +++ b/catalog/includes/modules/content/footer/templates/text.php @@ -0,0 +1,6 @@ +
    +
    +

    + +
    +
    diff --git a/catalog/includes/modules/content/footer_suffix/cm_footer_extra_copyright.php b/catalog/includes/modules/content/footer_suffix/cm_footer_extra_copyright.php new file mode 100644 index 000000000..9e3b9600a --- /dev/null +++ b/catalog/includes/modules/content/footer_suffix/cm_footer_extra_copyright.php @@ -0,0 +1,100 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_TITLE; + $this->description = MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_DESCRIPTION; + + if ( defined('MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_STATUS') ) { + $this->sort_order = MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/copyright.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Contact Us Footer Module', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Copyright content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_CONTENT_WIDTH', + 'configuration_value' => '6', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_STATUS', 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/footer_suffix/cm_footer_extra_icons.php b/catalog/includes/modules/content/footer_suffix/cm_footer_extra_icons.php new file mode 100644 index 000000000..c817221a1 --- /dev/null +++ b/catalog/includes/modules/content/footer_suffix/cm_footer_extra_icons.php @@ -0,0 +1,100 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_FOOTER_EXTRA_ICONS_TITLE; + $this->description = MODULE_CONTENT_FOOTER_EXTRA_ICONS_DESCRIPTION; + + if ( defined('MODULE_CONTENT_FOOTER_EXTRA_ICONS_STATUS') ) { + $this->sort_order = MODULE_CONTENT_FOOTER_EXTRA_ICONS_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_FOOTER_EXTRA_ICONS_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_FOOTER_EXTRA_ICONS_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/icons.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_FOOTER_EXTRA_ICONS_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Extra Icons Footer Module', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Payment Icons content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_CONTENT_WIDTH', + 'configuration_value' => '6', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_FOOTER_EXTRA_ICONS_STATUS', 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_CONTENT_WIDTH', 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/footer_suffix/templates/copyright.php b/catalog/includes/modules/content/footer_suffix/templates/copyright.php new file mode 100644 index 000000000..b0bd07749 --- /dev/null +++ b/catalog/includes/modules/content/footer_suffix/templates/copyright.php @@ -0,0 +1,3 @@ +
    + +
    diff --git a/catalog/includes/modules/content/footer_suffix/templates/icons.php b/catalog/includes/modules/content/footer_suffix/templates/icons.php new file mode 100644 index 000000000..03fa4c85b --- /dev/null +++ b/catalog/includes/modules/content/footer_suffix/templates/icons.php @@ -0,0 +1,3 @@ +
    + +
    diff --git a/catalog/includes/modules/content/header/cm_header_breadcrumb.php b/catalog/includes/modules/content/header/cm_header_breadcrumb.php new file mode 100644 index 000000000..88e6d6653 --- /dev/null +++ b/catalog/includes/modules/content/header/cm_header_breadcrumb.php @@ -0,0 +1,101 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_HEADER_BREADCRUMB_TITLE; + $this->description = MODULE_CONTENT_HEADER_BREADCRUMB_DESCRIPTION; + if (defined('MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION')) $this->description .= '
    ' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '
    '; + + if ( defined('MODULE_CONTENT_HEADER_BREADCRUMB_STATUS') ) { + $this->sort_order = MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_HEADER_BREADCRUMB_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate, $breadcrumb; + + $content_width = (int)MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/breadcrumb.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_HEADER_BREADCRUMB_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Header Breadcrumb Module', + 'configuration_key' => 'MODULE_CONTENT_HEADER_BREADCRUMB_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Breadcrumb content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH', + 'configuration_value' => '12', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_HEADER_BREADCRUMB_STATUS', 'MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH', 'MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/header/cm_header_buttons.php b/catalog/includes/modules/content/header/cm_header_buttons.php new file mode 100644 index 000000000..39476b3ee --- /dev/null +++ b/catalog/includes/modules/content/header/cm_header_buttons.php @@ -0,0 +1,101 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_HEADER_BUTTONS_TITLE; + $this->description = MODULE_CONTENT_HEADER_BUTTONS_DESCRIPTION; + if (defined('MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION')) $this->description .= '
    ' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '
    '; + + if ( defined('MODULE_CONTENT_HEADER_BUTTONS_STATUS') ) { + $this->sort_order = MODULE_CONTENT_HEADER_BUTTONS_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_HEADER_BUTTONS_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_HEADER_BUTTONS_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/buttons.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_HEADER_BUTTONS_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Header Buttons Module', + 'configuration_key' => 'MODULE_CONTENT_HEADER_BUTTONS_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Buttons content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_HEADER_BUTTONS_CONTENT_WIDTH', + 'configuration_value' => '4', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_HEADER_BUTTONS_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_HEADER_BUTTONS_STATUS', 'MODULE_CONTENT_HEADER_BUTTONS_CONTENT_WIDTH', 'MODULE_CONTENT_HEADER_BUTTONS_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/header/cm_header_logo.php b/catalog/includes/modules/content/header/cm_header_logo.php new file mode 100644 index 000000000..9a2fc7947 --- /dev/null +++ b/catalog/includes/modules/content/header/cm_header_logo.php @@ -0,0 +1,101 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_HEADER_LOGO_TITLE; + $this->description = MODULE_CONTENT_HEADER_LOGO_DESCRIPTION; + if (defined('MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION')) $this->description .= '
    ' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '
    '; + + if ( defined('MODULE_CONTENT_HEADER_LOGO_STATUS') ) { + $this->sort_order = MODULE_CONTENT_HEADER_LOGO_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_HEADER_LOGO_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate; + + $content_width = (int)MODULE_CONTENT_HEADER_LOGO_CONTENT_WIDTH; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/logo.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_HEADER_LOGO_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Header Logo Module', + 'configuration_key' => 'MODULE_CONTENT_HEADER_LOGO_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Logo content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_HEADER_LOGO_CONTENT_WIDTH', + 'configuration_value' => '4', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_HEADER_LOGO_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_HEADER_LOGO_STATUS', 'MODULE_CONTENT_HEADER_LOGO_CONTENT_WIDTH', 'MODULE_CONTENT_HEADER_LOGO_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/header/cm_header_messagestack.php b/catalog/includes/modules/content/header/cm_header_messagestack.php new file mode 100644 index 000000000..0512829aa --- /dev/null +++ b/catalog/includes/modules/content/header/cm_header_messagestack.php @@ -0,0 +1,91 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_HEADER_MESSAGESTACK_TITLE; + $this->description = MODULE_CONTENT_HEADER_MESSAGESTACK_DESCRIPTION; + + if ( defined('MODULE_CONTENT_HEADER_MESSAGESTACK_STATUS') ) { + $this->sort_order = MODULE_CONTENT_HEADER_MESSAGESTACK_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_HEADER_MESSAGESTACK_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate, $messageStack; + + if ($messageStack->size('header') > 0) { + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/messagestack.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + + } + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_HEADER_MESSAGESTACK_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Message Stack Notifications Module', + 'configuration_key' => 'MODULE_CONTENT_HEADER_MESSAGESTACK_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Should the Message Stack Notifications be shown in the header when needed?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_HEADER_MESSAGESTACK_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_HEADER_MESSAGESTACK_STATUS', 'MODULE_CONTENT_HEADER_MESSAGESTACK_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/header/cm_header_search.php b/catalog/includes/modules/content/header/cm_header_search.php new file mode 100644 index 000000000..e7dc6450a --- /dev/null +++ b/catalog/includes/modules/content/header/cm_header_search.php @@ -0,0 +1,111 @@ +code = get_class($this); + $this->group = basename(dirname(__FILE__)); + + $this->title = MODULE_CONTENT_HEADER_SEARCH_TITLE; + $this->description = MODULE_CONTENT_HEADER_SEARCH_DESCRIPTION; + if (defined('MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION')) $this->description .= '
    ' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '
    '; + + if ( defined('MODULE_CONTENT_HEADER_SEARCH_STATUS') ) { + $this->sort_order = MODULE_CONTENT_HEADER_SEARCH_SORT_ORDER; + $this->enabled = (MODULE_CONTENT_HEADER_SEARCH_STATUS == 'True'); + } + } + + function execute() { + global $oscTemplate, $request_type; + + $content_width = MODULE_CONTENT_HEADER_SEARCH_CONTENT_WIDTH; + + $search_box = '
    '; + $search_box .= HTML::form('quick_find', OSCOM::link('advanced_search_result.php', '', $request_type, false), 'get', 'class="form-horizontal"', ['session_id' => true]); + $search_box .= '
    ' . + HTML::inputField('keywords', '', 'required placeholder="' . TEXT_SEARCH_PLACEHOLDER . '"', 'search') . '' . + '
    '; + $search_box .= ''; + $search_box .= '
    '; + + ob_start(); + include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/search.php'); + $template = ob_get_clean(); + + $oscTemplate->addContent($template, $this->group); + } + + function isEnabled() { + return $this->enabled; + } + + function check() { + return defined('MODULE_CONTENT_HEADER_SEARCH_STATUS'); + } + + function install() { + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Search Box Module', + 'configuration_key' => 'MODULE_CONTENT_HEADER_SEARCH_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the Search Box content module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_HEADER_SEARCH_CONTENT_WIDTH', + 'configuration_value' => '4', + 'configuration_description' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_HEADER_SEARCH_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + } + + function remove() { + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); + } + + function keys() { + return array('MODULE_CONTENT_HEADER_SEARCH_STATUS', 'MODULE_CONTENT_HEADER_SEARCH_CONTENT_WIDTH', 'MODULE_CONTENT_HEADER_SEARCH_SORT_ORDER'); + } + } + diff --git a/catalog/includes/modules/content/header/templates/breadcrumb.php b/catalog/includes/modules/content/header/templates/breadcrumb.php new file mode 100644 index 000000000..b313c8167 --- /dev/null +++ b/catalog/includes/modules/content/header/templates/breadcrumb.php @@ -0,0 +1,4 @@ +
    + trail(' » '); ?> +
    + diff --git a/catalog/includes/modules/content/header/templates/buttons.php b/catalog/includes/modules/content/header/templates/buttons.php new file mode 100644 index 000000000..f4eb0ab60 --- /dev/null +++ b/catalog/includes/modules/content/header/templates/buttons.php @@ -0,0 +1,18 @@ + +
    +
    +count_contents() > 0 ? ' (' . $_SESSION['cart']->count_contents() . ')' : ''), 'glyphicon glyphicon-shopping-cart', OSCOM::link('shopping_cart.php')) . + HTML::button(MODULE_CONTENT_HEADER_BUTTONS_TITLE_CHECKOUT, 'glyphicon glyphicon-credit-card', OSCOM::link('checkout_shipping.php', '', 'SSL')) . + HTML::button(MODULE_CONTENT_HEADER_BUTTONS_TITLE_MY_ACCOUNT, 'glyphicon glyphicon-user', OSCOM::link('account.php', '', 'SSL')); + + if (isset($_SESSION['customer_id'])) { + echo HTML::button(MODULE_CONTENT_HEADER_BUTTONS_TITLE_LOGOFF, 'glyphicon glyphicon-log-out', OSCOM::link('logoff.php', '', 'SSL')); + } +?> +
    +
    + diff --git a/catalog/includes/modules/content/header/templates/logo.php b/catalog/includes/modules/content/header/templates/logo.php new file mode 100644 index 000000000..81bd03d67 --- /dev/null +++ b/catalog/includes/modules/content/header/templates/logo.php @@ -0,0 +1,8 @@ + + + diff --git a/catalog/includes/modules/content/header/templates/messagestack.php b/catalog/includes/modules/content/header/templates/messagestack.php new file mode 100644 index 000000000..e67840c0b --- /dev/null +++ b/catalog/includes/modules/content/header/templates/messagestack.php @@ -0,0 +1,3 @@ +
    + output('header'); ?> +
    diff --git a/catalog/includes/modules/content/header/templates/search.php b/catalog/includes/modules/content/header/templates/search.php new file mode 100644 index 000000000..83a52bc7d --- /dev/null +++ b/catalog/includes/modules/content/header/templates/search.php @@ -0,0 +1,4 @@ +
    + +
    + diff --git a/catalog/includes/modules/content/login/cm_create_account_link.php b/catalog/includes/modules/content/login/cm_create_account_link.php index 996d3d647..1b8c6ed90 100644 --- a/catalog/includes/modules/content/login/cm_create_account_link.php +++ b/catalog/includes/modules/content/login/cm_create_account_link.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Registry; + class cm_create_account_link { var $code; var $group; @@ -50,13 +52,43 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable New User Module', 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_STATUS', 'True', 'Do you want to enable the new user module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_CONTENT_WIDTH', 'Half', 'Should the content be shown in a full or half width container?', '6', '1', 'tep_cfg_select_option(array(\'Full\', \'Half\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable New User Module', + 'configuration_key' => 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the new user module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_CONTENT_WIDTH', + 'configuration_value' => 'Half', + 'configuration_description' => 'Should the content be shown in a full or half width container?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Full\', \'Half\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/login/cm_login_form.php b/catalog/includes/modules/content/login/cm_login_form.php index 96a9c522f..23f83a38b 100644 --- a/catalog/includes/modules/content/login/cm_login_form.php +++ b/catalog/includes/modules/content/login/cm_login_form.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\Registry; + class cm_login_form { var $code; var $group; @@ -32,31 +35,32 @@ function cm_login_form() { } function execute() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $sessiontoken, $login_customer_id, $messageStack, $oscTemplate; + global $login_customer_id, $messageStack, $oscTemplate; + + $OSCOM_Db = Registry::get('Db'); $error = false; - if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) { - $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); - $password = tep_db_prepare_input($HTTP_POST_VARS['password']); + if (isset($_GET['action']) && ($_GET['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $_SESSION['sessiontoken'])) { + $email_address = HTML::sanitize($_POST['email_address']); + $password = HTML::sanitize($_POST['password']); // Check if email exists - $customer_query = tep_db_query("select customers_id, customers_password from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1"); - if (!tep_db_num_rows($customer_query)) { + $Qcustomer = $OSCOM_Db->get('customers', ['customers_id', 'customers_password'], ['customers_email_address' => $email_address], null, 1); + + if ($Qcustomer->fetch() === false) { $error = true; } else { - $customer = tep_db_fetch_array($customer_query); - // Check that password is good - if (!tep_validate_password($password, $customer['customers_password'])) { + if (!tep_validate_password($password, $Qcustomer->value('customers_password'))) { $error = true; } else { // set $login_customer_id globally and perform post login code in catalog/login.php - $login_customer_id = (int)$customer['customers_id']; + $login_customer_id = $Qcustomer->valueInt('customers_id'); // migrate old hashed password to new phpass password - if (tep_password_type($customer['customers_password']) != 'phpass') { - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password) . "' where customers_id = '" . (int)$login_customer_id . "'"); + if (tep_password_type($Qcustomer->value('customers_password')) != 'phpass') { + $OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password)], ['customers_id' => $login_customer_id]); } } } @@ -82,13 +86,43 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Login Form Module', 'MODULE_CONTENT_LOGIN_FORM_STATUS', 'True', 'Do you want to enable the login form module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_LOGIN_FORM_CONTENT_WIDTH', 'Half', 'Should the content be shown in a full or half width container?', '6', '1', 'tep_cfg_select_option(array(\'Full\', \'Half\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_LOGIN_FORM_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Login Form Module', + 'configuration_key' => 'MODULE_CONTENT_LOGIN_FORM_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to enable the login form module?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Content Width', + 'configuration_key' => 'MODULE_CONTENT_LOGIN_FORM_CONTENT_WIDTH', + 'configuration_value' => 'Half', + 'configuration_description' => 'Should the content be shown in a full or half width container?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Full\', \'Half\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_CONTENT_LOGIN_FORM_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/content/login/cm_paypal_login.php b/catalog/includes/modules/content/login/cm_paypal_login.php deleted file mode 100644 index 0256bf379..000000000 --- a/catalog/includes/modules/content/login/cm_paypal_login.php +++ /dev/null @@ -1,751 +0,0 @@ -signature = 'paypal|paypal_login|1.0|2.3'; - - $this->code = get_class($this); - $this->group = basename(dirname(__FILE__)); - - $this->title = MODULE_CONTENT_PAYPAL_LOGIN_TITLE; - $this->description = MODULE_CONTENT_PAYPAL_LOGIN_DESCRIPTION; - - if ( defined('MODULE_CONTENT_PAYPAL_LOGIN_STATUS') ) { - $this->sort_order = MODULE_CONTENT_PAYPAL_LOGIN_SORT_ORDER; - $this->enabled = (MODULE_CONTENT_PAYPAL_LOGIN_STATUS == 'True'); - - if ( basename($GLOBALS['PHP_SELF']) == 'modules_content.php' ) { - $this->description .= $this->getTestLinkInfo(); - - $this->description .= $this->getShowUrlsInfo(); - - if ( MODULE_CONTENT_PAYPAL_LOGIN_SERVER_TYPE == 'Sandbox' ) { - $this->title .= ' [Sandbox]'; - } - - if ( !function_exists('curl_init') ) { - $this->description = '
    ' . MODULE_CONTENT_PAYPAL_LOGIN_ERROR_ADMIN_CURL . '
    ' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_CONTENT_PAYPAL_LOGIN_CLIENT_ID) || !tep_not_null(MODULE_CONTENT_PAYPAL_LOGIN_SECRET) ) { - $this->description = '
    ' . MODULE_CONTENT_PAYPAL_LOGIN_ERROR_ADMIN_CONFIGURATION . '
    ' . $this->description; - } - } - } - } - - if ( defined('FILENAME_MODULES') && ($PHP_SELF == 'modules_content.php') && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function execute() { - global $HTTP_GET_VARS, $oscTemplate; - - if ( tep_not_null(MODULE_CONTENT_PAYPAL_LOGIN_CLIENT_ID) && tep_not_null(MODULE_CONTENT_PAYPAL_LOGIN_SECRET) ) { - if ( isset($HTTP_GET_VARS['action']) ) { - if ( $HTTP_GET_VARS['action'] == 'paypal_login' ) { - $this->preLogin(); - } elseif ( $HTTP_GET_VARS['action'] == 'paypal_login_process' ) { - $this->postLogin(); - } - } - - $scopes = cm_paypal_login_get_attributes(); - $use_scopes = array('openid'); - - foreach ( explode(';', MODULE_CONTENT_PAYPAL_LOGIN_ATTRIBUTES) as $a ) { - foreach ( $scopes as $group => $attributes ) { - foreach ( $attributes as $attribute => $scope ) { - if ( $a == $attribute ) { - if ( !in_array($scope, $use_scopes) ) { - $use_scopes[] = $scope; - } - } - } - } - } - - ob_start(); - include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/paypal_login.php'); - $template = ob_get_clean(); - - $oscTemplate->addContent($template, $this->group); - } - } - - function preLogin() { - global $HTTP_GET_VARS, $paypal_login_access_token, $paypal_login_customer_id, $sendto, $billto; - - $return_url = tep_href_link(FILENAME_LOGIN, '', 'SSL'); - - if ( isset($HTTP_GET_VARS['code']) ) { - $paypal_login_customer_id = false; - - $params = array('code' => $HTTP_GET_VARS['code']); - - $response_token = $this->getToken($params); - - if ( !isset($response_token['access_token']) && isset($response_token['refresh_token']) ) { - $params = array('refresh_token' => $response_token['refresh_token']); - - $response_token = $this->getRefreshToken($params); - } - - if ( isset($response_token['access_token']) ) { - $params = array('access_token' => $response_token['access_token']); - - $response = $this->getUserInfo($params); - - if ( isset($response['email']) ) { - $paypal_login_access_token = $response_token['access_token']; - tep_session_register('paypal_login_access_token'); - - $force_login = false; - -// check if e-mail address exists in database and login or create customer account - if ( !tep_session_is_registered('customer_id') ) { - $customer_id = 0; - $customer_default_address_id = 0; - - $force_login = true; - - $email_address = tep_db_prepare_input($response['email']); - - $check_query = tep_db_query("select customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - - $customer_id = (int)$check['customers_id']; - } else { - $customers_firstname = tep_db_prepare_input($response['given_name']); - $customers_lastname = tep_db_prepare_input($response['family_name']); - - $sql_data_array = array('customers_firstname' => $customers_firstname, - 'customers_lastname' => $customers_lastname, - 'customers_email_address' => $email_address, - 'customers_telephone' => '', - 'customers_fax' => '', - 'customers_newsletter' => '0', - 'customers_password' => ''); - - if ($this->hasAttribute('phone') && isset($response['phone_number']) && tep_not_null($response['phone_number'])) { - $customers_telephone = tep_db_prepare_input($response['phone_number']); - - $sql_data_array['customers_telephone'] = $customers_telephone; - } - - tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); - - $customer_id = (int)tep_db_insert_id(); - - tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); - } - } - -// check if paypal shipping address exists in the address book - $ship_firstname = tep_db_prepare_input($response['given_name']); - $ship_lastname = tep_db_prepare_input($response['family_name']); - $ship_address = tep_db_prepare_input($response['address']['street_address']); - $ship_city = tep_db_prepare_input($response['address']['locality']); - $ship_zone = tep_db_prepare_input($response['address']['region']); - $ship_zone_id = 0; - $ship_postcode = tep_db_prepare_input($response['address']['postal_code']); - $ship_country = tep_db_prepare_input($response['address']['country']); - $ship_country_id = 0; - $ship_address_format_id = 1; - - $country_query = tep_db_query("select countries_id, address_format_id from " . TABLE_COUNTRIES . " where countries_iso_code_2 = '" . tep_db_input($ship_country) . "' limit 1"); - if (tep_db_num_rows($country_query)) { - $country = tep_db_fetch_array($country_query); - - $ship_country_id = $country['countries_id']; - $ship_address_format_id = $country['address_format_id']; - } - - if ($ship_country_id > 0) { - $zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$ship_country_id . "' and (zone_name = '" . tep_db_input($ship_zone) . "' or zone_code = '" . tep_db_input($ship_zone) . "') limit 1"); - if (tep_db_num_rows($zone_query)) { - $zone = tep_db_fetch_array($zone_query); - - $ship_zone_id = $zone['zone_id']; - } - } - - $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - - $sendto = $check['address_book_id']; - } else { - $sql_data_array = array('customers_id' => $customer_id, - 'entry_firstname' => $ship_firstname, - 'entry_lastname' => $ship_lastname, - 'entry_street_address' => $ship_address, - 'entry_postcode' => $ship_postcode, - 'entry_city' => $ship_city, - 'entry_country_id' => $ship_country_id); - - if (ACCOUNT_STATE == 'true') { - if ($ship_zone_id > 0) { - $sql_data_array['entry_zone_id'] = $ship_zone_id; - $sql_data_array['entry_state'] = ''; - } else { - $sql_data_array['entry_zone_id'] = '0'; - $sql_data_array['entry_state'] = $ship_zone; - } - } - - tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); - - $address_id = tep_db_insert_id(); - - $sendto = $address_id; - - if ($customer_default_address_id < 1) { - tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); - $customer_default_address_id = $address_id; - } - } - - if ($force_login == true) { - $paypal_login_customer_id = $customer_id; - } else { - $paypal_login_customer_id = false; - } - - if ( !tep_session_is_registered('paypal_login_customer_id') ) { - tep_session_register('paypal_login_customer_id'); - } - - $billto = $sendto; - - if ( !tep_session_is_registered('sendto') ) { - tep_session_register('sendto'); - } - - if ( !tep_session_is_registered('billto') ) { - tep_session_register('billto'); - } - - $return_url = tep_href_link(FILENAME_LOGIN, 'action=paypal_login_process', 'SSL'); - } - } - } - - echo ''; - - exit; - } - - function postLogin() { - global $paypal_login_customer_id, $login_customer_id, $language, $payment; - - if ( tep_session_is_registered('paypal_login_customer_id') ) { - if ( $paypal_login_customer_id !== false ) { - $login_customer_id = $paypal_login_customer_id; - } - - tep_session_unregister('paypal_login_customer_id'); - } - -// Register PayPal Express Checkout as the default payment method - if ( !tep_session_is_registered('payment') || ($payment != 'paypal_express') ) { - if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) { - if ( in_array('paypal_express.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) { - if ( !class_exists('paypal_express') ) { - include(DIR_WS_LANGUAGES . $language . '/modules/payment/paypal_express.php'); - include(DIR_WS_MODULES . 'payment/paypal_express.php'); - } - - $ppe = new paypal_express(); - - if ( $ppe->enabled ) { - $payment = 'paypal_express'; - tep_session_register('payment'); - } - } - } - } - } - - function isEnabled() { - return $this->enabled; - } - - function check() { - return defined('MODULE_CONTENT_PAYPAL_LOGIN_STATUS'); - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - $params = array('MODULE_CONTENT_PAYPAL_LOGIN_STATUS' => array('title' => 'Enable Log In with PayPal', - 'desc' => 'Do you want to enable the Log In with PayPal module?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_CONTENT_PAYPAL_LOGIN_CLIENT_ID' => array('title' => 'Client ID', - 'desc' => 'Your PayPal Application Client ID.'), - 'MODULE_CONTENT_PAYPAL_LOGIN_SECRET' => array('title' => 'Secret', - 'desc' => 'Your PayPal Application Secret.'), - 'MODULE_CONTENT_PAYPAL_LOGIN_THEME' => array('title' => 'Theme', - 'desc' => 'Which theme should be used for the button?', - 'value' => 'Blue', - 'set_func' => 'tep_cfg_select_option(array(\'Blue\', \'Neutral\'), '), - 'MODULE_CONTENT_PAYPAL_LOGIN_ATTRIBUTES' => array('title' => 'Information Requested From Customers', - 'desc' => 'The attributes the customer must share with you.', - 'value' => implode(';', $this->get_default_attributes()), - 'use_func' => 'cm_paypal_login_show_attributes', - 'set_func' => 'cm_paypal_login_edit_attributes('), - 'MODULE_CONTENT_PAYPAL_LOGIN_SERVER_TYPE' => array('title' => 'Server Type', - 'desc' => 'Which server should be used? Live for production or Sandbox for testing.', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_CONTENT_PAYPAL_LOGIN_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_CONTENT_PAYPAL_LOGIN_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_CONTENT_PAYPAL_LOGIN_CONTENT_WIDTH' => array('title' => 'Content Width', - 'desc' => 'Should the content be shown in a full or half width container?', - 'value' => 'Full', - 'set_func' => 'tep_cfg_select_option(array(\'Full\', \'Half\'), '), - 'MODULE_CONTENT_PAYPAL_LOGIN_SORT_ORDER' => array('title' => 'Sort order of display', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendRequest($url, $parameters = null) { - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - curl_setopt($curl, CURLOPT_ENCODING, ''); - - if ( MODULE_CONTENT_PAYPAL_LOGIN_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_CONTENT_PAYPAL_LOGIN_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_CONTENT_PAYPAL_LOGIN_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - - function getToken($params) { - if ( MODULE_CONTENT_PAYPAL_LOGIN_SERVER_TYPE == 'Live' ) { - $api_server = 'api.paypal.com'; - } else { - $api_server = 'api.sandbox.paypal.com'; - } - - $parameters = array('client_id' => MODULE_CONTENT_PAYPAL_LOGIN_CLIENT_ID, - 'client_secret' => MODULE_CONTENT_PAYPAL_LOGIN_SECRET, - 'grant_type' => 'authorization_code', - 'code' => $params['code'], - 'redirect_uri' => str_replace('&', '&', tep_href_link(FILENAME_LOGIN, 'action=paypal_login', 'SSL'))); - - $post_string = ''; - - foreach ($parameters as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $result = $this->sendRequest('https://' . $api_server . '/v1/identity/openidconnect/tokenservice', $post_string); - - $result_array = json_decode($result, true); - - return $result_array; - } - - function getRefreshToken($params) { - if ( MODULE_CONTENT_PAYPAL_LOGIN_SERVER_TYPE == 'Live' ) { - $api_server = 'api.paypal.com'; - } else { - $api_server = 'api.sandbox.paypal.com'; - } - - $parameters = array('client_id' => MODULE_CONTENT_PAYPAL_LOGIN_CLIENT_ID, - 'client_secret' => MODULE_CONTENT_PAYPAL_LOGIN_SECRET, - 'grant_type' => 'refresh_token', - 'refresh_token' => $params['refresh_token']); - - $post_string = ''; - - foreach ($parameters as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $result = $this->sendRequest('https://' . $api_server . '/v1/identity/openidconnect/tokenservice', $post_string); - - $result_array = json_decode($result, true); - - return $result_array; - } - - function getUserInfo($params) { - if ( MODULE_CONTENT_PAYPAL_LOGIN_SERVER_TYPE == 'Live' ) { - $api_server = 'api.paypal.com'; - } else { - $api_server = 'api.sandbox.paypal.com'; - } - - $result = $this->sendRequest('https://' . $api_server . '/v1/identity/openidconnect/userinfo/?schema=openid&access_token=' . $params['access_token']); - - $result_array = json_decode($result, true); - - return $result_array; - } - - function getTestLinkInfo() { - $dialog_title = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link('modules_content.php', 'module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -$(function() { - $('#tcdprogressbar').progressbar({ - value: false - }); -}); - -function openTestConnectionDialog() { - var d = $('
    ').html($('#testConnectionDialog').html()).dialog({ - modal: true, - title: '{$dialog_title}', - buttons: { - '{$dialog_button_close}': function () { - $(this).dialog('destroy'); - } - } - }); - - var timeStart = new Date().getTime(); - - $.ajax({ - url: '{$test_url}' - }).done(function(data) { - if ( data == '1' ) { - d.find('#testConnectionDialogProgress').html('

    {$dialog_success}

    '); - } else { - d.find('#testConnectionDialogProgress').html('

    {$dialog_failed}

    '); - } - }).fail(function() { - d.find('#testConnectionDialogProgress').html('

    {$dialog_error}

    '); - }).always(function() { - var timeEnd = new Date().getTime(); - var timeTook = new Date(0, 0, 0, 0, 0, 0, timeEnd-timeStart); - - d.find('#testConnectionDialogProgress').append('

    {$dialog_connection_time} ' + timeTook.getSeconds() + '.' + timeTook.getMilliseconds() + 's

    '); - }); -} - -EOD; - - $info = '

     ' . MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_CONNECTION_LINK_TITLE . '

    ' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - $params = array('code' => 'oscom2_conn_test'); - - $response = $this->getToken($params); - - if ( is_array($response) && isset($response['error']) ) { - return 1; - } - - return -1; - } - - function getShowUrlsInfo() { - $dialog_title = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_URLS_TITLE; - $dialog_button_close = MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_URLS_BUTTON_CLOSE; - - $js = << -function openShowUrlsDialog() { - var d = $('
    ').html($('#showUrlsDialog').html()).dialog({ - autoOpen: false, - modal: true, - title: '{$dialog_title}', - buttons: { - '{$dialog_button_close}': function () { - $(this).dialog('destroy'); - } - }, - width: 600 - }); - - d.dialog('open'); -} - -EOD; - - $info = '

     ' . MODULE_CONTENT_PAYPAL_LOGIN_DIALOG_URLS_LINK_TITLE . '

    ' . - '' . - $js; - - return $info; - } - - function hasAttribute($attribute) { - return in_array($attribute, explode(';', MODULE_CONTENT_PAYPAL_LOGIN_ATTRIBUTES)); - } - - function get_default_attributes() { - $data = array(); - - foreach ( cm_paypal_login_get_attributes() as $group => $attributes ) { - foreach ( $attributes as $attribute => $scope ) { - $data[] = $attribute; - } - } - - return $data; - } - } - - function cm_paypal_login_get_attributes() { - return array('personal' => array('full_name' => 'profile', - 'date_of_birth' => 'profile', - 'age_range' => 'https://uri.paypal.com/services/paypalattributes', - 'gender' => 'profile'), - 'address' => array('email_address' => 'email', - 'street_address' => 'address', - 'city' => 'address', - 'state' => 'address', - 'country' => 'address', - 'zip_code' => 'address', - 'phone' => 'phone'), - 'account' => array('account_status' => 'https://uri.paypal.com/services/paypalattributes', - 'account_type' => 'https://uri.paypal.com/services/paypalattributes', - 'account_creation_date' => 'https://uri.paypal.com/services/paypalattributes', - 'time_zone' => 'profile', - 'locale' => 'profile', - 'language' => 'profile'), - 'checkout' => array('seamless_checkout' => 'https://uri.paypal.com/services/expresscheckout')); - } - - function cm_paypal_login_get_required_attributes() { - return array('full_name', - 'email_address', - 'street_address', - 'city', - 'state', - 'country', - 'zip_code'); - } - - function cm_paypal_login_show_attributes($text) { - $active = explode(';', $text); - - $output = ''; - - foreach ( cm_paypal_login_get_attributes() as $group => $attributes ) { - foreach ( $attributes as $attribute => $scope ) { - if ( in_array($attribute, $active) ) { - $output .= constant('MODULE_CONTENT_PAYPAL_LOGIN_ATTR_' . $attribute) . '
    '; - } - } - } - - if ( !empty($output) ) { - $output = substr($output, 0, -6); - } - - return $output; - } - - function cm_paypal_login_edit_attributes($values, $key) { - $values_array = explode(';', $values); - - $required_array = cm_paypal_login_get_required_attributes(); - - $output = ''; - - foreach ( cm_paypal_login_get_attributes() as $group => $attributes ) { - $output .= '' . constant('MODULE_CONTENT_PAYPAL_LOGIN_ATTR_GROUP_' . $group) . '
    '; - - foreach ( $attributes as $attribute => $scope ) { - if ( in_array($attribute, $required_array) ) { - $output .= tep_draw_radio_field('cm_paypal_login_attributes_tmp_' . $attribute, $attribute, true) . ' '; - } else { - $output .= tep_draw_checkbox_field('cm_paypal_login_attributes[]', $attribute, in_array($attribute, $values_array)) . ' '; - } - - $output .= constant('MODULE_CONTENT_PAYPAL_LOGIN_ATTR_' . $attribute) . '
    '; - } - } - - if (!empty($output)) { - $output = '
    ' . substr($output, 0, -6); - } - - $output .= tep_draw_hidden_field('configuration[' . $key . ']', '', 'id="cmpl_attributes"'); - - $output .= ''; - - return $output; - } -?> diff --git a/catalog/includes/modules/content/login/templates/create_account_link.php b/catalog/includes/modules/content/login/templates/create_account_link.php index 13dc15061..fd43d4909 100644 --- a/catalog/includes/modules/content/login/templates/create_account_link.php +++ b/catalog/includes/modules/content/login/templates/create_account_link.php @@ -1,10 +1,16 @@ -
' . - '
'; + } + + $output .= '
'; $oscTemplate->addContent($output, $this->group); } diff --git a/catalog/includes/modules/payment/authorizenet_cc_aim.php b/catalog/includes/modules/payment/authorizenet_cc_aim.php deleted file mode 100644 index 8d44ccfa4..000000000 --- a/catalog/includes/modules/payment/authorizenet_cc_aim.php +++ /dev/null @@ -1,818 +0,0 @@ -signature = 'authorizenet|authorizenet_cc_aim|2.1|2.3'; - $this->api_version = '3.1'; - - $this->code = 'authorizenet_cc_aim'; - $this->title = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_SORT_ORDER') ? MODULE_PAYMENT_AUTHORIZENET_CC_AIM_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS') && (MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS') ) { - if ( (MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_SERVER == 'Test') || (MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_MODE == 'Test') ) { - $this->title .= ' [Test]'; - $this->public_title .= ' (' . $this->code . '; Test)'; - } - - $this->description .= $this->getTestLinkInfo(); - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID) || !tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY) ) { - $this->description = '
' . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - return false; - } - - function confirmation() { - global $order; - - for ($i=1; $i<13; $i++) { - $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i)); - } - - $today = getdate(); - for ($i=$today['year']; $i < $today['year']+10; $i++) { - $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); - } - - $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_OWNER_FIRSTNAME, - 'field' => tep_draw_input_field('cc_owner_firstname', $order->billing['firstname'])), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_OWNER_LASTNAME, - 'field' => tep_draw_input_field('cc_owner_lastname', $order->billing['lastname'])), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_NUMBER, - 'field' => tep_draw_input_field('cc_number_nh-dns')), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_EXPIRES, - 'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_CREDIT_CARD_CCV, - 'field' => tep_draw_input_field('cc_ccv_nh-dns', '', 'size="5" maxlength="4"')))); - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $HTTP_POST_VARS, $customer_id, $order, $sendto, $currency, $response; - - $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID, 0, 20), - 'x_tran_key' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY, 0, 16), - 'x_version' => $this->api_version, - 'x_type' => ((MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_METHOD == 'Capture') ? 'AUTH_CAPTURE' : 'AUTH_ONLY'), - 'x_method' => 'CC', - 'x_amount' => substr($this->format_raw($order->info['total']), 0, 15), - 'x_currency_code' => substr($currency, 0, 3), - 'x_card_num' => substr(preg_replace('/[^0-9]/', '', $HTTP_POST_VARS['cc_number_nh-dns']), 0, 22), - 'x_exp_date' => $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year'], - 'x_card_code' => substr($HTTP_POST_VARS['cc_ccv_nh-dns'], 0, 4), - 'x_description' => substr(STORE_NAME, 0, 255), - 'x_first_name' => substr($order->billing['firstname'], 0, 50), - 'x_last_name' => substr($order->billing['lastname'], 0, 50), - 'x_company' => substr($order->billing['company'], 0, 50), - 'x_address' => substr($order->billing['street_address'], 0, 60), - 'x_city' => substr($order->billing['city'], 0, 40), - 'x_state' => substr($order->billing['state'], 0, 40), - 'x_zip' => substr($order->billing['postcode'], 0, 20), - 'x_country' => substr($order->billing['country']['title'], 0, 60), - 'x_phone' => substr($order->customer['telephone'], 0, 25), - 'x_email' => substr($order->customer['email_address'], 0, 255), - 'x_cust_id' => substr($customer_id, 0, 20), - 'x_customer_ip' => tep_get_ip_address(), - 'x_relay_response' => 'FALSE', - 'x_delim_data' => 'TRUE', - 'x_delim_char' => ',', - 'x_encap_char' => '|'); - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['x_ship_to_first_name'] = substr($order->delivery['firstname'], 0, 50); - $params['x_ship_to_last_name'] = substr($order->delivery['lastname'], 0, 50); - $params['x_ship_to_company'] = substr($order->delivery['company'], 0, 50); - $params['x_ship_to_address'] = substr($order->delivery['street_address'], 0, 60); - $params['x_ship_to_city'] = substr($order->delivery['city'], 0, 40); - $params['x_ship_to_state'] = substr($order->delivery['state'], 0, 40); - $params['x_ship_to_zip'] = substr($order->delivery['postcode'], 0, 20); - $params['x_ship_to_country'] = substr($order->delivery['country']['title'], 0, 60); - } - - if (MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_MODE == 'Test') { - $params['x_test_request'] = 'TRUE'; - } - - $tax_value = 0; - - foreach ($order->info['tax_groups'] as $key => $value) { - if ($value > 0) { - $tax_value += $this->format_raw($value); - } - } - - if ($tax_value > 0) { - $params['x_tax'] = $this->format_raw($tax_value); - } - - $params['x_freight'] = $this->format_raw($order->info['shipping_cost']); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(trim($value)) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $post_string .= '&x_line_item=' . urlencode($i+1) . '<|>' . urlencode(substr($order->products[$i]['name'], 0, 31)) . '<|>' . urlencode(substr($order->products[$i]['name'], 0, 255)) . '<|>' . urlencode($order->products[$i]['qty']) . '<|>' . urlencode($this->format_raw($order->products[$i]['final_price'])) . '<|>' . urlencode($order->products[$i]['tax'] > 0 ? 'YES' : 'NO'); - } - - if ( MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_SERVER == 'Live' ) { - $gateway_url = 'https://secure.authorize.net/gateway/transact.dll'; - } else { - $gateway_url = 'https://test.authorize.net/gateway/transact.dll'; - } - - $transaction_response = $this->sendTransactionToGateway($gateway_url, $post_string); - - $response = array('x_response_code' => '-1', - 'x_response_subcode' => '-1', - 'x_response_reason_code' => '-1'); - - if ( !empty($transaction_response) ) { - $raw = explode('|,|', substr($transaction_response, 1, -1)); - - if ( count($raw) > 54 ) { - $response = array('x_response_code' => $raw[0], - 'x_response_subcode' => $raw[1], - 'x_response_reason_code' => $raw[2], - 'x_response_reason_text' => $raw[3], - 'x_auth_code' => $raw[4], - 'x_avs_code' => $raw[5], - 'x_trans_id' => $raw[6], - 'x_invoice_num' => $raw[7], - 'x_description' => $raw[8], - 'x_amount' => $raw[9], - 'x_method' => $raw[10], - 'x_type' => $raw[11], - 'x_cust_id' => $raw[12], - 'x_first_name' => $raw[13], - 'x_last_name' => $raw[14], - 'x_company' => $raw[15], - 'x_address' => $raw[16], - 'x_city' => $raw[17], - 'x_state' => $raw[18], - 'x_zip' => $raw[19], - 'x_country' => $raw[20], - 'x_phone' => $raw[21], - 'x_fax' => $raw[22], - 'x_email' => $raw[23], - 'x_ship_to_first_name' => $raw[24], - 'x_ship_to_last_name' => $raw[25], - 'x_ship_to_company' => $raw[26], - 'x_ship_to_address' => $raw[27], - 'x_ship_to_city' => $raw[28], - 'x_ship_to_state' => $raw[29], - 'x_ship_to_zip' => $raw[30], - 'x_ship_to_country' => $raw[31], - 'x_tax' => $raw[32], - 'x_duty' => $raw[33], - 'x_freight' => $raw[34], - 'x_tax_exempt' => $raw[35], - 'x_po_num' => $raw[36], - 'x_MD5_Hash' => $raw[37], - 'x_cvv2_resp_code' => $raw[38], - 'x_cavv_response' => $raw[39], - 'x_account_number' => $raw[50], - 'x_card_type' => $raw[51], - 'x_split_tender_id' => $raw[52], - 'x_prepaid_requested_amount' => $raw[53], - 'x_prepaid_balance_on_card' => $raw[54]); - - unset($raw); - } - } - - $error = false; - - if ( ($response['x_response_code'] == '1') || ($response['x_response_code'] == '4') ) { - if ( (tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_MD5_HASH) && (strtoupper($response['x_MD5_Hash']) != strtoupper(md5(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_MD5_HASH . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID . $response['x_trans_id'] . $this->format_raw($order->info['total']))))) || ($response['x_amount'] != $this->format_raw($order->info['total'])) ) { - if ( MODULE_PAYMENT_AUTHORIZENET_CC_AIM_REVIEW_ORDER_STATUS_ID > 0 ) { - $order->info['order_status'] = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_REVIEW_ORDER_STATUS_ID; - } - } - - if ( $response['x_response_code'] == '4' ) { - if ( MODULE_PAYMENT_AUTHORIZENET_CC_AIM_REVIEW_ORDER_STATUS_ID > 0 ) { - $order->info['order_status'] = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_REVIEW_ORDER_STATUS_ID; - } - } - } elseif ($response['x_response_code'] == '2') { - $error = 'declined'; - } else { - $error = 'general'; - } - - if ( $error !== false ) { - switch ($response['x_response_reason_code']) { - case '7': - $error = 'invalid_expiration_date'; - break; - - case '8': - $error = 'expired'; - break; - - case '13': - $error = 'merchant_account'; - break; - - case '6': - case '17': - case '28': - $error = 'declined'; - break; - - case '39': - $error = 'currency'; - break; - - case '78': - $error = 'ccv'; - break; - } - } - - if ($error !== false) { - $this->sendDebugEmail($response); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . $error, 'SSL')); - } - } - - function after_process() { - global $response, $order, $insert_id; - - $status = array(); - - if ( tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_MD5_HASH) ) { - if ( strtoupper($response['x_MD5_Hash']) == strtoupper(md5(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_MD5_HASH . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID . $response['x_trans_id'] . $this->format_raw($order->info['total']))) ) { - $status[] = 'MD5 Hash: Match'; - } else { - $status[] = '*** MD5 Hash Does Not Match ***'; - } - } - - if ( $response['x_amount'] != $this->format_raw($order->info['total']) ) { - $status[] = '*** Order Total Does Not Match Transaction Total ***'; - } - - $status[] = 'Response: ' . tep_db_prepare_input($response['x_response_reason_text']) . ' (' . tep_db_prepare_input($response['x_response_reason_code']) . ')'; - $status[] = 'Transaction ID: ' . tep_db_prepare_input($response['x_trans_id']); - - $avs_response = '?'; - - if ( !empty($response['x_avs_code']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_AVS_' . $response['x_avs_code']) ) { - $avs_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_AVS_' . $response['x_avs_code']) . ' (' . $response['x_avs_code'] . ')'; - } else { - $avs_response = $response['x_avs_code']; - } - } - - $status[] = 'AVS: ' . tep_db_prepare_input($avs_response); - - $cvv2_response = '?'; - - if ( !empty($response['x_cvv2_resp_code']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_CVV2_' . $response['x_cvv2_resp_code']) ) { - $cvv2_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_CVV2_' . $response['x_cvv2_resp_code']) . ' (' . $response['x_cvv2_resp_code'] . ')'; - } else { - $cvv2_response = $response['x_cvv2_resp_code']; - } - } - - $status[] = 'Card Code: ' . tep_db_prepare_input($cvv2_response); - - $cavv_response = '?'; - - if ( !empty($response['x_cavv_response']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_CAVV_' . $response['x_cavv_response']) ) { - $cavv_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TEXT_CAVV_' . $response['x_cavv_response']) . ' (' . $response['x_cavv_response'] . ')'; - } else { - $cavv_response = $response['x_cavv_response']; - } - } - - $status[] = 'Card Holder: ' . tep_db_prepare_input($cavv_response); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => implode("\n", $status)); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - - function get_error() { - global $HTTP_GET_VARS; - - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_GENERAL; - - switch ($HTTP_GET_VARS['error']) { - case 'invalid_expiration_date': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_INVALID_EXP_DATE; - break; - - case 'expired': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_EXPIRED; - break; - - case 'declined': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_DECLINED; - break; - - case 'ccv': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_CCV; - break; - - case 'merchant_account': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_MERCHANT_ACCOUNT; - break; - - case 'currency': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_CURRENCY; - break; - - default: - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_GENERAL; - break; - } - - $error = array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ERROR_TITLE, - 'error' => $error_message); - - return $error; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Authorize.net [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Authorize.net [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_AUTHORIZENET_CC_AIM_STATUS' => array('title' => 'Enable Authorize.net Advanced Integration Method', - 'desc' => 'Do you want to accept Authorize.net Advanced Integration Method payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID' => array('title' => 'API Login ID', - 'desc' => 'The API Login ID used for the Authorize.net service'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY' => array('title' => 'API Transaction Key', - 'desc' => 'The API Transaction Key used for the Authorize.net service'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_MD5_HASH' => array('title' => 'MD5 Hash', - 'desc' => 'The MD5 Hash value to verify transactions with'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Authorization', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Capture\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_REVIEW_ORDER_STATUS_ID' => array('title' => 'Review Order Status', - 'desc' => 'Set the status of orders flagged as being under review to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', - 'desc' => 'Include transaction information in this order status level', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_zone_classes(', - 'use_func' => 'tep_get_zone_class_title'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Perform transactions on the live or test server. The test server should only be used by developers with Authorize.net test accounts.', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_MODE' => array('title' => 'Transaction Mode', - 'desc' => 'Transaction mode used for processing orders', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify transaction server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_AIM_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function _hmac($key, $data) { - if (function_exists('hash_hmac')) { - return hash_hmac('md5', $data, $key); - } elseif (function_exists('mhash') && defined('MHASH_MD5')) { - return bin2hex(mhash(MHASH_MD5, $data, $key)); - } - -// RFC 2104 HMAC implementation for php. -// Creates an md5 HMAC. -// Eliminates the need to install mhash to compute a HMAC -// Hacked by Lance Rushing - - $b = 64; // byte length for md5 - if (strlen($key) > $b) { - $key = pack("H*",md5($key)); - } - - $key = str_pad($key, $b, chr(0x00)); - $ipad = str_pad('', $b, chr(0x36)); - $opad = str_pad('', $b, chr(0x5c)); - $k_ipad = $key ^ $ipad ; - $k_opad = $key ^ $opad; - - return md5($k_opad . pack("H*",md5($k_ipad . $data))); - } - - function sendTransactionToGateway($url, $parameters) { - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_AUTHORIZENET_CC_AIM_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/authorizenet/authorize.net.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/authorizenet/authorize.net.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_AUTHORIZENET_CC_AIM_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - if ( MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_SERVER == 'Live' ) { - $api_url = 'https://secure.authorize.net/gateway/transact.dll'; - } else { - $api_url = 'https://test.authorize.net/gateway/transact.dll'; - } - - $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_LOGIN_ID, 0, 20), - 'x_tran_key' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_TRANSACTION_KEY, 0, 16), - 'x_version' => $this->api_version, - 'x_customer_ip' => tep_get_ip_address(), - 'x_relay_response' => 'FALSE', - 'x_delim_data' => 'TRUE', - 'x_delim_char' => ',', - 'x_encap_char' => '|'); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(trim($value)) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $result = $this->sendTransactionToGateway($api_url, $post_string); - - $response = array('x_response_code' => '-1'); - - if ( !empty($result) ) { - $raw = explode('|,|', substr($result, 1, -1)); - - if ( count($raw) > 54 ) { - $response['x_response_code'] = $raw[0]; - } - } - - if ( $response['x_response_code'] != '-1' ) { - return 1; - } - - return -1; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - if (isset($HTTP_POST_VARS['cc_number_nh-dns'])) { - $HTTP_POST_VARS['cc_number_nh-dns'] = 'XXXX' . substr($HTTP_POST_VARS['cc_number_nh-dns'], -4); - } - - if (isset($HTTP_POST_VARS['cc_ccv_nh-dns'])) { - $HTTP_POST_VARS['cc_ccv_nh-dns'] = 'XXX'; - } - - if (isset($HTTP_POST_VARS['cc_expires_month'])) { - $HTTP_POST_VARS['cc_expires_month'] = 'XX'; - } - - if (isset($HTTP_POST_VARS['cc_expires_year'])) { - $HTTP_POST_VARS['cc_expires_year'] = 'XX'; - } - - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_AUTHORIZENET_CC_AIM_DEBUG_EMAIL, 'Authorize.net AIM Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/authorizenet_cc_dpm.php b/catalog/includes/modules/payment/authorizenet_cc_dpm.php deleted file mode 100644 index 9bbedf9c0..000000000 --- a/catalog/includes/modules/payment/authorizenet_cc_dpm.php +++ /dev/null @@ -1,585 +0,0 @@ -signature = 'authorizenet|authorizenet_cc_dpm|1.1|2.3'; - $this->api_version = '3.1'; - - $this->code = 'authorizenet_cc_dpm'; - $this->title = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_SORT_ORDER') ? MODULE_PAYMENT_AUTHORIZENET_CC_DPM_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_STATUS') && (MODULE_PAYMENT_AUTHORIZENET_CC_DPM_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_STATUS') ) { - if ( (MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_SERVER == 'Test') || (MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_MODE == 'Test') ) { - $this->title .= ' [Test]'; - $this->public_title .= ' (' . $this->code . '; Test)'; - } - - if ( MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_SERVER == 'Live' ) { - $this->form_action_url = 'https://secure.authorize.net/gateway/transact.dll'; - } else { - $this->form_action_url = 'https://test.authorize.net/gateway/transact.dll'; - } - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_LOGIN_ID) || !tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_KEY) ) { - $this->description = '
' . MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - return false; - } - - function confirmation() { - global $order; - - $expiry_field = ' ' . tep_draw_hidden_field('x_exp_date'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); -} - - - -EOD; - - $expiry_field .= $js; - - $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_CREDIT_CARD_OWNER_FIRSTNAME, - 'field' => tep_draw_input_field('x_first_name', $order->billing['firstname'])), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_CREDIT_CARD_OWNER_LASTNAME, - 'field' => tep_draw_input_field('x_last_name', $order->billing['lastname'])), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_CREDIT_CARD_NUMBER, - 'field' => tep_draw_input_field('x_card_num')), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_CREDIT_CARD_EXPIRES, - 'field' => $expiry_field), - array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_CREDIT_CARD_CCV, - 'field' => tep_draw_input_field('x_card_code', '', 'size="5" maxlength="4"')))); - - return $confirmation; - } - - function process_button() { - global $customer_id, $order, $sendto, $currency; - - $tstamp = time(); - $sequence = rand(1, 1000); - - $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_LOGIN_ID, 0, 20), - 'x_version' => $this->api_version, - 'x_show_form' => 'PAYMENT_FORM', - 'x_delim_data' => 'FALSE', - 'x_relay_response' => 'TRUE', - 'x_relay_url' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false), - 'x_company' => substr($order->billing['company'], 0, 50), - 'x_address' => substr($order->billing['street_address'], 0, 60), - 'x_city' => substr($order->billing['city'], 0, 40), - 'x_state' => substr($order->billing['state'], 0, 40), - 'x_zip' => substr($order->billing['postcode'], 0, 20), - 'x_country' => substr($order->billing['country']['title'], 0, 60), - 'x_phone' => substr(preg_replace('/[^0-9]/', '', $order->customer['telephone']), 0, 25), - 'x_cust_id' => substr($customer_id, 0, 20), - 'x_customer_ip' => tep_get_ip_address(), - 'x_email' => substr($order->customer['email_address'], 0, 255), - 'x_description' => substr(STORE_NAME, 0, 255), - 'x_amount' => $this->format_raw($order->info['total']), - 'x_currency_code' => substr($currency, 0, 3), - 'x_method' => 'CC', - 'x_type' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_METHOD == 'Capture' ? 'AUTH_CAPTURE' : 'AUTH_ONLY', - 'x_freight' => $this->format_raw($order->info['shipping_cost']), - 'x_fp_sequence' => $sequence, - 'x_fp_timestamp' => $tstamp, - 'x_fp_hash' => $this->_hmac(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_KEY, MODULE_PAYMENT_AUTHORIZENET_CC_DPM_LOGIN_ID . '^' . $sequence . '^' . $tstamp . '^' . $this->format_raw($order->info['total']) . '^' . $currency), - 'x_cancel_url' => tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'), - 'x_cancel_url_text' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_RETURN_BUTTON); - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['x_ship_to_first_name'] = substr($order->delivery['firstname'], 0, 50); - $params['x_ship_to_last_name'] = substr($order->delivery['lastname'], 0, 50); - $params['x_ship_to_company'] = substr($order->delivery['company'], 0, 50); - $params['x_ship_to_address'] = substr($order->delivery['street_address'], 0, 60); - $params['x_ship_to_city'] = substr($order->delivery['city'], 0, 40); - $params['x_ship_to_state'] = substr($order->delivery['state'], 0, 40); - $params['x_ship_to_zip'] = substr($order->delivery['postcode'], 0, 20); - $params['x_ship_to_country'] = substr($order->delivery['country']['title'], 0, 60); - } - - if (MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_MODE == 'Test') { - $params['x_test_request'] = 'TRUE'; - } - - $tax_value = 0; - - foreach ( $order->info['tax_groups'] as $value ) { - if ($value > 0) { - $tax_value += $this->format_raw($value); - } - } - - if ($tax_value > 0) { - $params['x_tax'] = $this->format_raw($tax_value); - } - - $process_button_string = ''; - - foreach ( $params as $key => $value ) { - $process_button_string .= tep_draw_hidden_field($key, $value); - } - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $process_button_string .= tep_draw_hidden_field('x_line_item', ($i+1) . '<|>' . substr($order->products[$i]['name'], 0, 31) . '<|><|>' . $order->products[$i]['qty'] . '<|>' . $this->format_raw($order->products[$i]['final_price']) . '<|>' . ($order->products[$i]['tax'] > 0 ? 'YES' : 'NO')); - } - - $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id()); - - return $process_button_string; - } - - function before_process() { - global $HTTP_POST_VARS, $order, $authorizenet_cc_dpm_error; - - $error = false; - $authorizenet_cc_dpm_error = false; - - $check_array = array('x_response_code', - 'x_response_reason_text', - 'x_trans_id', - 'x_amount'); - - foreach ( $check_array as $check ) { - if ( !isset($HTTP_POST_VARS[$check]) || !is_string($HTTP_POST_VARS[$check]) || (strlen($HTTP_POST_VARS[$check]) < 1) ) { - $error = 'general'; - break; - } - } - - if ( $error === false ) { - if ( ($HTTP_POST_VARS['x_response_code'] == '1') || ($HTTP_POST_VARS['x_response_code'] == '4') ) { - if ( tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_MD5_HASH) && (!isset($HTTP_POST_VARS['x_MD5_Hash']) || (strtoupper($HTTP_POST_VARS['x_MD5_Hash']) != strtoupper(md5(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_MD5_HASH . MODULE_PAYMENT_AUTHORIZENET_CC_DPM_LOGIN_ID . $HTTP_POST_VARS['x_trans_id'] . $this->format_raw($order->info['total']))))) ) { - $error = 'verification'; - } elseif ($HTTP_POST_VARS['x_amount'] != $this->format_raw($order->info['total'])) { - $error = 'verification'; - } - - if ( ($error === false) && ($HTTP_POST_VARS['x_response_code'] == '4') ) { - if ( MODULE_PAYMENT_AUTHORIZENET_CC_DPM_REVIEW_ORDER_STATUS_ID > 0 ) { - $order->info['order_status'] = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_REVIEW_ORDER_STATUS_ID; - } - } - } elseif ($HTTP_POST_VARS['x_response_code'] == '2') { - $error = 'declined'; - } else { - $error = 'general'; - } - } - - if ( $error !== false ) { - $this->sendDebugEmail(); - - $authorizenet_cc_dpm_error = $HTTP_POST_VARS['x_response_reason_text']; - tep_session_register('authorizenet_cc_dpm_error'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . $error, 'SSL')); - } - - if ( tep_session_is_registered('authorizenet_cc_dpm_error') ) { - tep_session_unregister('authorizenet_cc_dpm_error'); - } - } - - function after_process() { - global $HTTP_POST_VARS, $insert_id; - - $response = array('Response: ' . tep_db_prepare_input($HTTP_POST_VARS['x_response_reason_text']) . ' (' . tep_db_prepare_input($HTTP_POST_VARS['x_response_reason_code']) . ')', - 'Transaction ID: ' . tep_db_prepare_input($HTTP_POST_VARS['x_trans_id'])); - - $avs_response = '?'; - - if ( isset($HTTP_POST_VARS['x_avs_code']) && is_string($HTTP_POST_VARS['x_avs_code']) && !empty($HTTP_POST_VARS['x_avs_code']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_AVS_' . $HTTP_POST_VARS['x_avs_code']) ) { - $avs_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_AVS_' . $HTTP_POST_VARS['x_avs_code']) . ' (' . $HTTP_POST_VARS['x_avs_code'] . ')'; - } else { - $avs_response = $HTTP_POST_VARS['x_avs_code']; - } - } - - $response[] = 'AVS: ' . tep_db_prepare_input($avs_response); - - $cvv2_response = '?'; - - if ( isset($HTTP_POST_VARS['x_cvv2_resp_code']) && is_string($HTTP_POST_VARS['x_cvv2_resp_code']) && !empty($HTTP_POST_VARS['x_cvv2_resp_code']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_CVV2_' . $HTTP_POST_VARS['x_cvv2_resp_code']) ) { - $cvv2_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_CVV2_' . $HTTP_POST_VARS['x_cvv2_resp_code']) . ' (' . $HTTP_POST_VARS['x_cvv2_resp_code'] . ')'; - } else { - $cvv2_response = $HTTP_POST_VARS['x_cvv2_resp_code']; - } - } - - $response[] = 'Card Code: ' . tep_db_prepare_input($cvv2_response); - - $cavv_response = '?'; - - if ( isset($HTTP_POST_VARS['x_cavv_response']) && is_string($HTTP_POST_VARS['x_cavv_response']) && !empty($HTTP_POST_VARS['x_cavv_response']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_CAVV_' . $HTTP_POST_VARS['x_cavv_response']) ) { - $cavv_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TEXT_CAVV_' . $HTTP_POST_VARS['x_cavv_response']) . ' (' . $HTTP_POST_VARS['x_cavv_response'] . ')'; - } else { - $cavv_response = $HTTP_POST_VARS['x_cavv_response']; - } - } - - $response[] = 'Card Holder: ' . tep_db_prepare_input($cavv_response); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => implode("\n", $response)); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - - if ( ENABLE_SSL != true ) { - global $cart; - - $cart->reset(true); - -// unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); - - $redirect_url = tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'); - - echo << - - - -EOD; - - exit; - } - } - - function get_error() { - global $HTTP_GET_VARS, $authorizenet_cc_dpm_error; - - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ERROR_GENERAL; - - switch ($HTTP_GET_VARS['error']) { - case 'verification': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ERROR_VERIFICATION; - break; - - case 'declined': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ERROR_DECLINED; - break; - - default: - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ERROR_GENERAL; - break; - } - - if ( ($HTTP_GET_VARS['error'] != 'verification') && tep_session_is_registered('authorizenet_cc_dpm_error') ) { - $error_message = $authorizenet_cc_dpm_error; - - tep_session_unregister('authorizenet_cc_dpm_error'); - } - - $error = array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ERROR_TITLE, - 'error' => $error_message); - - return $error; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Authorize.net [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Authorize.net [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_AUTHORIZENET_CC_DPM_STATUS' => array('title' => 'Enable Authorize.net Direct Post Method', - 'desc' => 'Do you want to accept Authorize.net Direct Post Method payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_LOGIN_ID' => array('title' => 'API Login ID', - 'desc' => 'The API Login ID used for the Authorize.net service'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_KEY' => array('title' => 'API Transaction Key', - 'desc' => 'The API Transaction Key used for the Authorize.net service'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_MD5_HASH' => array('title' => 'MD5 Hash', - 'desc' => 'The MD5 Hash value to verify transactions with'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Authorization', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Capture\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_REVIEW_ORDER_STATUS_ID' => array('title' => 'Review Order Status', - 'desc' => 'Set the status of orders flagged as being under review to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', - 'desc' => 'Include transaction information in this order status level', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_zone_classes(', - 'use_func' => 'tep_get_zone_class_title'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Perform transactions on the live or test server. The test server should only be used by developers with Authorize.net test accounts.', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_TRANSACTION_MODE' => array('title' => 'Transaction Mode', - 'desc' => 'Transaction mode used for processing orders', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_DPM_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function _hmac($key, $data) { - if (function_exists('hash_hmac')) { - return hash_hmac('md5', $data, $key); - } elseif (function_exists('mhash') && defined('MHASH_MD5')) { - return bin2hex(mhash(MHASH_MD5, $data, $key)); - } - -// RFC 2104 HMAC implementation for php. -// Creates an md5 HMAC. -// Eliminates the need to install mhash to compute a HMAC -// Hacked by Lance Rushing - - $b = 64; // byte length for md5 - if (strlen($key) > $b) { - $key = pack("H*",md5($key)); - } - - $key = str_pad($key, $b, chr(0x00)); - $ipad = str_pad('', $b, chr(0x36)); - $opad = str_pad('', $b, chr(0x5c)); - $k_ipad = $key ^ $ipad ; - $k_opad = $key ^ $opad; - - return md5($k_opad . pack("H*",md5($k_ipad . $data))); - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_DPM_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_AUTHORIZENET_CC_DPM_DEBUG_EMAIL, 'Authorize.net DPM Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/authorizenet_cc_sim.php b/catalog/includes/modules/payment/authorizenet_cc_sim.php deleted file mode 100644 index 0e471fab0..000000000 --- a/catalog/includes/modules/payment/authorizenet_cc_sim.php +++ /dev/null @@ -1,541 +0,0 @@ -signature = 'authorizenet|authorizenet_cc_sim|2.0|2.3'; - $this->api_version = '3.1'; - - $this->code = 'authorizenet_cc_sim'; - $this->title = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_SORT_ORDER') ? MODULE_PAYMENT_AUTHORIZENET_CC_SIM_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_STATUS') && (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_STATUS') ) { - if ( (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_SERVER == 'Test') || (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_MODE == 'Test') ) { - $this->title .= ' [Test]'; - $this->public_title .= ' (' . $this->code . '; Test)'; - } - - if ( MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_SERVER == 'Live' ) { - $this->form_action_url = 'https://secure.authorize.net/gateway/transact.dll'; - } else { - $this->form_action_url = 'https://test.authorize.net/gateway/transact.dll'; - } - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID) || !tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_KEY) ) { - $this->description = '
' . MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - return false; - } - - function confirmation() { - return false; - } - - function process_button() { - global $customer_id, $order, $sendto, $currency; - - $tstamp = time(); - $sequence = rand(1, 1000); - - $params = array('x_login' => substr(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID, 0, 20), - 'x_version' => $this->api_version, - 'x_show_form' => 'PAYMENT_FORM', - 'x_delim_data' => 'FALSE', - 'x_relay_response' => 'TRUE', - 'x_relay_url' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false), - 'x_first_name' => substr($order->billing['firstname'], 0, 50), - 'x_last_name' => substr($order->billing['lastname'], 0, 50), - 'x_company' => substr($order->billing['company'], 0, 50), - 'x_address' => substr($order->billing['street_address'], 0, 60), - 'x_city' => substr($order->billing['city'], 0, 40), - 'x_state' => substr($order->billing['state'], 0, 40), - 'x_zip' => substr($order->billing['postcode'], 0, 20), - 'x_country' => substr($order->billing['country']['title'], 0, 60), - 'x_phone' => substr(preg_replace('/[^0-9]/', '', $order->customer['telephone']), 0, 25), - 'x_cust_id' => substr($customer_id, 0, 20), - 'x_customer_ip' => tep_get_ip_address(), - 'x_email' => substr($order->customer['email_address'], 0, 255), - 'x_description' => substr(STORE_NAME, 0, 255), - 'x_amount' => $this->format_raw($order->info['total']), - 'x_currency_code' => substr($currency, 0, 3), - 'x_method' => 'CC', - 'x_type' => MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_METHOD == 'Capture' ? 'AUTH_CAPTURE' : 'AUTH_ONLY', - 'x_freight' => $this->format_raw($order->info['shipping_cost']), - 'x_fp_sequence' => $sequence, - 'x_fp_timestamp' => $tstamp, - 'x_fp_hash' => $this->_hmac(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_KEY, MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID . '^' . $sequence . '^' . $tstamp . '^' . $this->format_raw($order->info['total']) . '^' . $currency), - 'x_cancel_url' => tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'), - 'x_cancel_url_text' => MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_RETURN_BUTTON); - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['x_ship_to_first_name'] = substr($order->delivery['firstname'], 0, 50); - $params['x_ship_to_last_name'] = substr($order->delivery['lastname'], 0, 50); - $params['x_ship_to_company'] = substr($order->delivery['company'], 0, 50); - $params['x_ship_to_address'] = substr($order->delivery['street_address'], 0, 60); - $params['x_ship_to_city'] = substr($order->delivery['city'], 0, 40); - $params['x_ship_to_state'] = substr($order->delivery['state'], 0, 40); - $params['x_ship_to_zip'] = substr($order->delivery['postcode'], 0, 20); - $params['x_ship_to_country'] = substr($order->delivery['country']['title'], 0, 60); - } - - if (MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_MODE == 'Test') { - $params['x_test_request'] = 'TRUE'; - } - - $tax_value = 0; - - foreach ( $order->info['tax_groups'] as $value ) { - if ($value > 0) { - $tax_value += $this->format_raw($value); - } - } - - if ($tax_value > 0) { - $params['x_tax'] = $this->format_raw($tax_value); - } - - $process_button_string = ''; - - foreach ( $params as $key => $value ) { - $process_button_string .= tep_draw_hidden_field($key, $value); - } - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $process_button_string .= tep_draw_hidden_field('x_line_item', ($i+1) . '<|>' . substr($order->products[$i]['name'], 0, 31) . '<|><|>' . $order->products[$i]['qty'] . '<|>' . $this->format_raw($order->products[$i]['final_price']) . '<|>' . ($order->products[$i]['tax'] > 0 ? 'YES' : 'NO')); - } - - $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id()); - - return $process_button_string; - } - - function before_process() { - global $HTTP_POST_VARS, $order, $authorizenet_cc_sim_error; - - $error = false; - $authorizenet_cc_sim_error = false; - - $check_array = array('x_response_code', - 'x_response_reason_text', - 'x_trans_id', - 'x_amount'); - - foreach ( $check_array as $check ) { - if ( !isset($HTTP_POST_VARS[$check]) || !is_string($HTTP_POST_VARS[$check]) || (strlen($HTTP_POST_VARS[$check]) < 1) ) { - $error = 'general'; - break; - } - } - - if ( $error === false ) { - if ( ($HTTP_POST_VARS['x_response_code'] == '1') || ($HTTP_POST_VARS['x_response_code'] == '4') ) { - if ( tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_MD5_HASH) && (!isset($HTTP_POST_VARS['x_MD5_Hash']) || (strtoupper($HTTP_POST_VARS['x_MD5_Hash']) != strtoupper(md5(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_MD5_HASH . MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID . $HTTP_POST_VARS['x_trans_id'] . $this->format_raw($order->info['total']))))) ) { - $error = 'verification'; - } elseif ($HTTP_POST_VARS['x_amount'] != $this->format_raw($order->info['total'])) { - $error = 'verification'; - } - - if ( ($error === false) && ($HTTP_POST_VARS['x_response_code'] == '4') ) { - if ( MODULE_PAYMENT_AUTHORIZENET_CC_SIM_REVIEW_ORDER_STATUS_ID > 0 ) { - $order->info['order_status'] = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_REVIEW_ORDER_STATUS_ID; - } - } - } elseif ($HTTP_POST_VARS['x_response_code'] == '2') { - $error = 'declined'; - } else { - $error = 'general'; - } - } - - if ( $error !== false ) { - $this->sendDebugEmail(); - - $authorizenet_cc_sim_error = $HTTP_POST_VARS['x_response_reason_text']; - tep_session_register('authorizenet_cc_sim_error'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . $error, 'SSL')); - } - - if ( tep_session_is_registered('authorizenet_cc_sim_error') ) { - tep_session_unregister('authorizenet_cc_sim_error'); - } - } - - function after_process() { - global $HTTP_POST_VARS, $insert_id; - - $response = array('Response: ' . tep_db_prepare_input($HTTP_POST_VARS['x_response_reason_text']) . ' (' . tep_db_prepare_input($HTTP_POST_VARS['x_response_reason_code']) . ')', - 'Transaction ID: ' . tep_db_prepare_input($HTTP_POST_VARS['x_trans_id'])); - - $avs_response = '?'; - - if ( isset($HTTP_POST_VARS['x_avs_code']) && is_string($HTTP_POST_VARS['x_avs_code']) && !empty($HTTP_POST_VARS['x_avs_code']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_AVS_' . $HTTP_POST_VARS['x_avs_code']) ) { - $avs_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_AVS_' . $HTTP_POST_VARS['x_avs_code']) . ' (' . $HTTP_POST_VARS['x_avs_code'] . ')'; - } else { - $avs_response = $HTTP_POST_VARS['x_avs_code']; - } - } - - $response[] = 'AVS: ' . tep_db_prepare_input($avs_response); - - $cvv2_response = '?'; - - if ( isset($HTTP_POST_VARS['x_cvv2_resp_code']) && is_string($HTTP_POST_VARS['x_cvv2_resp_code']) && !empty($HTTP_POST_VARS['x_cvv2_resp_code']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_CVV2_' . $HTTP_POST_VARS['x_cvv2_resp_code']) ) { - $cvv2_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_CVV2_' . $HTTP_POST_VARS['x_cvv2_resp_code']) . ' (' . $HTTP_POST_VARS['x_cvv2_resp_code'] . ')'; - } else { - $cvv2_response = $HTTP_POST_VARS['x_cvv2_resp_code']; - } - } - - $response[] = 'Card Code: ' . tep_db_prepare_input($cvv2_response); - - $cavv_response = '?'; - - if ( isset($HTTP_POST_VARS['x_cavv_response']) && is_string($HTTP_POST_VARS['x_cavv_response']) && !empty($HTTP_POST_VARS['x_cavv_response']) ) { - if ( defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_CAVV_' . $HTTP_POST_VARS['x_cavv_response']) ) { - $cavv_response = constant('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TEXT_CAVV_' . $HTTP_POST_VARS['x_cavv_response']) . ' (' . $HTTP_POST_VARS['x_cavv_response'] . ')'; - } else { - $cavv_response = $HTTP_POST_VARS['x_cavv_response']; - } - } - - $response[] = 'Card Holder: ' . tep_db_prepare_input($cavv_response); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => implode("\n", $response)); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - - if ( ENABLE_SSL != true ) { - global $cart; - - $cart->reset(true); - -// unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); - - $redirect_url = tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'); - - echo << - - - -EOD; - - exit; - } - } - - function get_error() { - global $HTTP_GET_VARS, $authorizenet_cc_sim_error; - - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ERROR_GENERAL; - - switch ($HTTP_GET_VARS['error']) { - case 'verification': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ERROR_VERIFICATION; - break; - - case 'declined': - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ERROR_DECLINED; - break; - - default: - $error_message = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ERROR_GENERAL; - break; - } - - if ( ($HTTP_GET_VARS['error'] != 'verification') && tep_session_is_registered('authorizenet_cc_sim_error') ) { - $error_message = $authorizenet_cc_sim_error; - - tep_session_unregister('authorizenet_cc_sim_error'); - } - - $error = array('title' => MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ERROR_TITLE, - 'error' => $error_message); - - return $error; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Authorize.net [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Authorize.net [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_AUTHORIZENET_CC_SIM_STATUS' => array('title' => 'Enable Authorize.net Server Integration Method', - 'desc' => 'Do you want to accept Authorize.net Server Integration Method payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_LOGIN_ID' => array('title' => 'API Login ID', - 'desc' => 'The API Login ID used for the Authorize.net service'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_KEY' => array('title' => 'API Transaction Key', - 'desc' => 'The API Transaction Key used for the Authorize.net service'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_MD5_HASH' => array('title' => 'MD5 Hash', - 'desc' => 'The MD5 Hash value to verify transactions with'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Authorization', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Capture\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_REVIEW_ORDER_STATUS_ID' => array('title' => 'Review Order Status', - 'desc' => 'Set the status of orders flagged as being under review to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', - 'desc' => 'Include transaction information in this order status level', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_zone_classes(', - 'use_func' => 'tep_get_zone_class_title'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Perform transactions on the live or test server. The test server should only be used by developers with Authorize.net test accounts.', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_TRANSACTION_MODE' => array('title' => 'Transaction Mode', - 'desc' => 'Transaction mode used for processing orders', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_AUTHORIZENET_CC_SIM_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function _hmac($key, $data) { - if (function_exists('hash_hmac')) { - return hash_hmac('md5', $data, $key); - } elseif (function_exists('mhash') && defined('MHASH_MD5')) { - return bin2hex(mhash(MHASH_MD5, $data, $key)); - } - -// RFC 2104 HMAC implementation for php. -// Creates an md5 HMAC. -// Eliminates the need to install mhash to compute a HMAC -// Hacked by Lance Rushing - - $b = 64; // byte length for md5 - if (strlen($key) > $b) { - $key = pack("H*",md5($key)); - } - - $key = str_pad($key, $b, chr(0x00)); - $ipad = str_pad('', $b, chr(0x36)); - $opad = str_pad('', $b, chr(0x5c)); - $k_ipad = $key ^ $ipad ; - $k_opad = $key ^ $opad; - - return md5($k_opad . pack("H*",md5($k_ipad . $data))); - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_AUTHORIZENET_CC_SIM_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_AUTHORIZENET_CC_SIM_DEBUG_EMAIL, 'Authorize.net SIM Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/braintree_cc.php b/catalog/includes/modules/payment/braintree_cc.php index 14f9ae63c..5ac8b1f31 100644 --- a/catalog/includes/modules/payment/braintree_cc.php +++ b/catalog/includes/modules/payment/braintree_cc.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class braintree_cc { var $code, $title, $description, $enabled; @@ -36,10 +40,6 @@ function braintree_cc() { $braintree_error = null; - if ( version_compare(PHP_VERSION, '5.2.1', '<') ) { - $braintree_error = sprintf(MODULE_PAYMENT_BRAINTREE_CC_ERROR_ADMIN_PHP, '5.2.1'); - } - if ( !isset($braintree_error) ) { $requiredExtensions = array('xmlwriter', 'SimpleXML', 'openssl', 'dom', 'hash', 'curl'); @@ -105,14 +105,16 @@ function braintree_cc() { function update_status() { global $order; + $OSCOM_Db = Registry::get('Db'); + if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_BRAINTREE_CC_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_BRAINTREE_CC_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_PAYMENT_BRAINTREE_CC_ZONE, 'zone_country_id' => $order->billing['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->billing['zone_id']) { $check_flag = true; break; } @@ -140,7 +142,9 @@ function pre_confirmation_check() { } function confirmation() { - global $customer_id, $order, $currencies, $currency; + global $order, $currencies; + + $OSCOM_Db = Registry::get('Db'); $months_array = array(); @@ -149,7 +153,7 @@ function confirmation() { 'text' => tep_output_string_protected(sprintf('%02d', $i))); } - $today = getdate(); + $today = getdate(); $years_array = array(); for ($i=$today['year']; $i < $today['year']+10; $i++) { @@ -159,29 +163,29 @@ function confirmation() { $content = ''; - if ( !$this->isValidCurrency($currency) ) { - $content .= sprintf(MODULE_PAYMENT_BRAINTREE_CC_CURRENCY_CHARGE, $currencies->format($order->info['total'], true, DEFAULT_CURRENCY), DEFAULT_CURRENCY, $currency); + if ( !$this->isValidCurrency($_SESSION['currency']) ) { + $content .= sprintf(MODULE_PAYMENT_BRAINTREE_CC_CURRENCY_CHARGE, $currencies->format($order->info['total'], true, DEFAULT_CURRENCY), DEFAULT_CURRENCY, $_SESSION['currency']); } if ( MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True' ) { - $tokens_query = tep_db_query("select id, card_type, number_filtered, expiry_date from customers_braintree_tokens where customers_id = '" . (int)$customer_id . "' order by date_added"); + $Qtokens = $OSCOM_Db->get('customers_braintree_tokens', ['id', 'card_type', 'number_filtered', 'expiry_date'], ['customers_id' => $_SESSION['customer_id']], 'date_added'); - if ( tep_db_num_rows($tokens_query) > 0 ) { + if ($Qtokens->fetch() !== false) { $content .= ''; - while ( $tokens = tep_db_fetch_array($tokens_query) ) { - $content .= '' . - ' ' . - ' ' . + do { + $content .= '' . + ' ' . + ' ' . ''; if ( MODULE_PAYMENT_BRAINTREE_CC_VERIFY_WITH_CVV == 'True' ) { - $content .= '' . + $content .= '' . ' ' . - ' ' . + ' ' . ''; } - } + } while ($Qtokens->fetch()); $content .= '' . ' ' . @@ -194,7 +198,7 @@ function confirmation() { $content .= '
' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_LAST_4 . ' ' . tep_output_string_protected($tokens['number_filtered']) . '  ' . tep_output_string_protected(substr($tokens['expiry_date'], 0, 2) . '/' . substr($tokens['expiry_date'], 2)) . '  ' . tep_output_string_protected($tokens['card_type']) . '
' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_LAST_4 . ' ' . $Qtokens->valueProtected('number_filtered') . '  ' . tep_output_string_protected(substr($Qtokens->value('expiry_date'), 0, 2) . '/' . substr($Qtokens->value('expiry_date'), 2)) . '  ' . $Qtokens->valueProtected('card_type') . '
 ' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_CVV . ' ' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_CVV . ' 
' . '' . ' ' . - ' ' . + ' ' . '' . '' . ' ' . @@ -202,7 +206,7 @@ function confirmation() { '' . '' . ' ' . - ' ' . + ' ' . ''; if ( MODULE_PAYMENT_BRAINTREE_CC_VERIFY_WITH_CVV == 'True' ) { @@ -215,7 +219,7 @@ function confirmation() { if ( MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True' ) { $content .= '' . ' ' . - ' ' . + ' ' . ''; } @@ -235,29 +239,28 @@ function process_button() { } function before_process() { - global $customer_id, $order, $HTTP_POST_VARS, $braintree_result, $braintree_token, $braintree_error; + global $order, $braintree_result, $braintree_token; + + $OSCOM_Db = Registry::get('Db'); $braintree_token = null; $braintree_token_cvv = null; $braintree_error = null; if ( MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True' ) { - if ( isset($HTTP_POST_VARS['braintree_card']) && is_numeric($HTTP_POST_VARS['braintree_card']) && ($HTTP_POST_VARS['braintree_card'] > 0) ) { - $token_query = tep_db_query("select braintree_token from customers_braintree_tokens where id = '" . (int)$HTTP_POST_VARS['braintree_card'] . "' and customers_id = '" . (int)$customer_id . "'"); + if ( isset($_POST['braintree_card']) && is_numeric($_POST['braintree_card']) && ($_POST['braintree_card'] > 0) ) { + $Qtoken = $OSCOM_Db->get('customers_braintree_tokens', 'braintree_token', ['id' => (int)$_POST['braintree_card'], 'customers_id' => $_SESSION['customer_id']]); - if ( tep_db_num_rows($token_query) == 1 ) { - $token = tep_db_fetch_array($token_query); - - $braintree_token = $token['braintree_token']; + if ($Qtoken->fetch() !== false) { + $braintree_token = $Qtoken->value('braintree_token'); if ( MODULE_PAYMENT_BRAINTREE_CC_VERIFY_WITH_CVV == 'True' ) { - - if ( isset($HTTP_POST_VARS['token_cvv']) && is_array($HTTP_POST_VARS['token_cvv']) && isset($HTTP_POST_VARS['token_cvv'][$HTTP_POST_VARS['braintree_card']]) ) { - $braintree_token_cvv = $HTTP_POST_VARS['token_cvv'][$HTTP_POST_VARS['braintree_card']]; + if ( isset($_POST['token_cvv']) && is_array($_POST['token_cvv']) && isset($_POST['token_cvv'][$_POST['braintree_card']]) ) { + $braintree_token_cvv = $_POST['token_cvv'][$_POST['braintree_card']]; } if ( !isset($braintree_token_cvv) || empty($braintree_token_cvv) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardcvv', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardcvv', 'SSL'); } } } @@ -265,13 +268,13 @@ function before_process() { } if ( !isset($braintree_token) ) { - $cc_owner = isset($HTTP_POST_VARS['name']) ? $HTTP_POST_VARS['name'] : null; - $cc_number = isset($HTTP_POST_VARS['number']) ? $HTTP_POST_VARS['number'] : null; - $cc_expires_month = isset($HTTP_POST_VARS['month']) ? $HTTP_POST_VARS['month'] : null; - $cc_expires_year = isset($HTTP_POST_VARS['year']) ? $HTTP_POST_VARS['year'] : null; + $cc_owner = isset($_POST['name']) ? $_POST['name'] : null; + $cc_number = isset($_POST['number']) ? $_POST['number'] : null; + $cc_expires_month = isset($_POST['month']) ? $_POST['month'] : null; + $cc_expires_year = isset($_POST['year']) ? $_POST['year'] : null; if ( MODULE_PAYMENT_BRAINTREE_CC_VERIFY_WITH_CVV == 'True' ) { - $cc_cvv = isset($HTTP_POST_VARS['cvv']) ? $HTTP_POST_VARS['cvv'] : null; + $cc_cvv = isset($_POST['cvv']) ? $_POST['cvv'] : null; } $months_array = array(); @@ -280,7 +283,7 @@ function before_process() { $months_array[] = sprintf('%02d', $i); } - $today = getdate(); + $today = getdate(); $years_array = array(); for ($i=$today['year']; $i < $today['year']+10; $i++) { @@ -288,28 +291,28 @@ function before_process() { } if ( !isset($cc_owner) || empty($cc_owner) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardowner', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardowner', 'SSL'); } if ( !isset($cc_number) || empty($cc_number) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardnumber', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardnumber', 'SSL'); } if ( !isset($cc_expires_month) || !in_array($cc_expires_month, $months_array) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardexpires', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardexpires', 'SSL'); } if ( !isset($cc_expires_year) || !in_array($cc_expires_year, $years_array) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardexpires', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardexpires', 'SSL'); } if ( ($cc_expires_year == date('Y')) && ($cc_expires_month < date('m')) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardexpires', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardexpires', 'SSL'); } if ( MODULE_PAYMENT_BRAINTREE_CC_VERIFY_WITH_CVV == 'True' ) { if ( !isset($cc_cvv) || empty($cc_cvv) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardcvv', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardcvv', 'SSL'); } } } @@ -367,7 +370,7 @@ function before_process() { $data['creditCard']['cvv'] = $cc_cvv; } - if ( (MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True') && isset($HTTP_POST_VARS['cc_save']) && ($HTTP_POST_VARS['cc_save'] == 'true') ) { + if ( (MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True') && isset($_POST['cc_save']) && ($_POST['cc_save'] == 'true') ) { $data['options']['storeInVaultOnSuccess'] = true; } } else { @@ -392,10 +395,6 @@ function before_process() { if ( $braintree_result->transaction ) { $braintree_error = $braintree_result->message; - - if ( !empty($braintree_error) ) { - tep_session_register('braintree_error'); - } } else { $braintree_error = ''; @@ -408,36 +407,39 @@ function before_process() { $braintree_error = substr($braintree_error, 0, -1); } } + } - if ( !empty($braintree_error) ) { - tep_session_register('braintree_error'); - } + if (!empty($braintree_error)) { + $_SESSION['braintree_error'] = $braintree_error; } - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code, 'SSL'); } function after_process() { - global $HTTP_POST_VARS, $customer_id, $insert_id, $braintree_result, $braintree_token; + global $insert_id, $braintree_result, $braintree_token; + + $OSCOM_Db = Registry::get('Db'); $status_comment = array('Transaction ID: ' . $braintree_result->transaction->id); - if ( (MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True') && isset($HTTP_POST_VARS['cc_save']) && ($HTTP_POST_VARS['cc_save'] == 'true') && !isset($braintree_token) && isset($braintree_result->transaction->creditCard['token']) ) { - $token = tep_db_prepare_input($braintree_result->transaction->creditCard['token']); - $type = tep_db_prepare_input($braintree_result->transaction->creditCard['cardType']); - $number = tep_db_prepare_input($braintree_result->transaction->creditCard['last4']); - $expiry = tep_db_prepare_input($braintree_result->transaction->creditCard['expirationMonth'] . $braintree_result->transaction->creditCard['expirationYear']); + if ( (MODULE_PAYMENT_BRAINTREE_CC_TOKENS == 'True') && isset($_POST['cc_save']) && ($_POST['cc_save'] == 'true') && !isset($braintree_token) && isset($braintree_result->transaction->creditCard['token']) ) { + $token = $braintree_result->transaction->creditCard['token']; + $type = $braintree_result->transaction->creditCard['cardType']; + $number = $braintree_result->transaction->creditCard['last4']; + $expiry = $braintree_result->transaction->creditCard['expirationMonth'] . $braintree_result->transaction->creditCard['expirationYear']; + + $Qcheck = $OSCOM_Db->get('customers_braintree_tokens', 'id', ['customers_id' => $_SESSION['customer_id'], 'braintree_token' => $token], null, 1); - $check_query = tep_db_query("select id from customers_braintree_tokens where customers_id = '" . (int)$customer_id . "' and braintree_token = '" . tep_db_input($token) . "' limit 1"); - if ( tep_db_num_rows($check_query) < 1 ) { - $sql_data_array = array('customers_id' => (int)$customer_id, + if ($Qcheck->fetch() === false) { + $sql_data_array = array('customers_id' => (int)$_SESSION['customer_id'], 'braintree_token' => $token, 'card_type' => $type, 'number_filtered' => $number, 'expiry_date' => $expiry, 'date_added' => 'now()'); - tep_db_perform('customers_braintree_tokens', $sql_data_array); + $OSCOM_Db->save('customers_braintree_tokens', $sql_data_array); } $status_comment[] = 'Token Created: Yes'; @@ -451,16 +453,14 @@ function after_process() { 'customer_notified' => '0', 'comments' => implode("\n", $status_comment)); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); + $OSCOM_Db->save('orders_status_history', $sql_data_array); } function get_error() { - global $HTTP_GET_VARS, $braintree_error; - $message = MODULE_PAYMENT_BRAINTREE_CC_ERROR_GENERAL; - if ( isset($HTTP_GET_VARS['error']) && !empty($HTTP_GET_VARS['error']) ) { - switch ($HTTP_GET_VARS['error']) { + if ( isset($_GET['error']) && !empty($_GET['error']) ) { + switch ($_GET['error']) { case 'cardowner': $message = MODULE_PAYMENT_BRAINTREE_CC_ERROR_CARDOWNER; break; @@ -477,10 +477,10 @@ function get_error() { $message = MODULE_PAYMENT_BRAINTREE_CC_ERROR_CARDCVV; break; } - } elseif ( tep_session_is_registered('braintree_error') ) { - $message = $braintree_error . ' ' . $message; + } elseif ( isset($_SESSION['braintree_error']) ) { + $message = $_SESSION['braintree_error'] . ' ' . $message; - tep_session_unregister('braintree_error'); + unset($_SESSION['braintree_error']); } $error = array('title' => MODULE_PAYMENT_BRAINTREE_CC_ERROR_TITLE, @@ -490,14 +490,12 @@ function get_error() { } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_BRAINTREE_CC_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_PAYMENT_BRAINTREE_CC_STATUS'); } function install($parameter = null) { + $OSCOM_Db = Registry::get('Db'); + $params = $this->getParams(); if (isset($parameter)) { @@ -525,12 +523,12 @@ function install($parameter = null) { $sql_data_array['use_function'] = $data['use_func']; } - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); + $OSCOM_Db->save('configuration', $sql_data_array); } } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { @@ -548,7 +546,11 @@ function keys() { } function getParams() { - if ( tep_db_num_rows(tep_db_query("show tables like 'customers_braintree_tokens'")) != 1 ) { + $OSCOM_Db = Registry::get('Db'); + + $Qcheck = $OSCOM_Db->query('show tables like "customers_braintree_tokens"'); + + if ($Qcheck->fetch() === false) { $sql = <<exec($sql); } if (!defined('MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Braintree [Transactions]' limit 1"); + $Qcheck = $OSCOM_Db->get('orders_status', 'orders_status_id', ['orders_status_name' => 'Braintree [Transactions]'], null, 1); - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); + if ($Qcheck->fetch() === false) { + $Qstatus = $OSCOM_Db->get('orders_status', 'max(orders_status_id) as status_id'); - $status_id = $status['status_id']+1; + $status_id = $Qstatus->valueInt('status_id') + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Braintree [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); + $OSCOM_Db->save('orders_status', [ + 'orders_status_id' => $status_id, + 'language_id' => $lang['id'], + 'orders_status_name' => 'Braintree [Transactions]', + 'public_flag' => 0, + 'downloads_flag' => 0 + ]); } } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; + $status_id = $Qcheck->valueInt('orders_status_id'); } } else { $status_id = MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_ORDER_STATUS_ID; @@ -652,10 +652,10 @@ function getParams() { } function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; + global $currencies; if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; + $currency_code = $_SESSION['currency']; } if (empty($currency_value) || !is_numeric($currency_value)) { @@ -666,9 +666,7 @@ function format_raw($number, $currency_code = '', $currency_value = '') { } function getTransactionCurrency() { - global $currency; - - return $this->isValidCurrency($currency) ? $currency : DEFAULT_CURRENCY; + return $this->isValidCurrency($_SESSION['currency']) ? $_SESSION['currency'] : DEFAULT_CURRENCY; } function getMerchantAccountId($currency) { @@ -698,7 +696,7 @@ function isValidCurrency($currency) { } function deleteCard($token, $token_id) { - global $customer_id; + $OSCOM_Db = Registry::get('Db'); Braintree_Configuration::environment(MODULE_PAYMENT_BRAINTREE_CC_TRANSACTION_SERVER == 'Live' ? 'production' : 'sandbox'); Braintree_Configuration::merchantId(MODULE_PAYMENT_BRAINTREE_CC_MERCHANT_ID); @@ -710,9 +708,7 @@ function deleteCard($token, $token_id) { } catch ( Exception $e ) { } - tep_db_query("delete from customers_braintree_tokens where id = '" . (int)$token_id . "' and customers_id = '" . (int)$customer_id . "' and braintree_token = '" . tep_db_prepare_input(tep_db_input($token)) . "'"); - - return (tep_db_affected_rows() === 1); + return $OSCOM_Db->delete('customers_braintree_tokens', ['id' => $token_id, 'customers_id' => $_SESSION['customer_id'], 'braintree_token' => $token]) === 1; } function templateClassExists() { @@ -723,8 +719,8 @@ function getSubmitCardDetailsJavascript() { $braintree_client_key = MODULE_PAYMENT_BRAINTREE_CC_CLIENT_KEY; $js = << - +', 'paypal'); - } - - $order->info['payment_method'] = 'PayPal Logo'; - } - - function confirmation() { - global $comments; - - if (!isset($comments)) { - $comments = null; - } - - $confirmation = false; - - if (empty($comments)) { - $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_PAYPAL_EXPRESS_TEXT_COMMENTS, - 'field' => tep_draw_textarea_field('ppecomments', 'soft', '60', '5', $comments)))); - } - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $customer_id, $order, $sendto, $ppe_token, $ppe_payerid, $ppe_secret, $ppe_order_total_check, $HTTP_POST_VARS, $comments, $response_array; - - if (!tep_session_is_registered('ppe_token')) { - tep_redirect(tep_href_link('ext/modules/payment/paypal/express.php', '', 'SSL')); - } - - $response_array = $this->getExpressCheckoutDetails($ppe_token); - - if (($response_array['ACK'] == 'Success') || ($response_array['ACK'] == 'SuccessWithWarning')) { - if ( !tep_session_is_registered('ppe_secret') || ($response_array['PAYMENTREQUEST_0_CUSTOM'] != $ppe_secret) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } elseif ( ($response_array['PAYMENTREQUEST_0_AMT'] != $this->format_raw($order->info['total'])) && !tep_session_is_registered('ppe_order_total_check') ) { - tep_session_register('ppe_order_total_check'); - $ppe_order_total_check = true; - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL')); - } - } else { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . stripslashes($response_array['L_LONGMESSAGE0']), 'SSL')); - } - - if ( tep_session_is_registered('ppe_order_total_check') ) { - tep_session_unregister('ppe_order_total_check'); - } - - if (empty($comments)) { - if (isset($HTTP_POST_VARS['ppecomments']) && tep_not_null($HTTP_POST_VARS['ppecomments'])) { - $comments = tep_db_prepare_input($HTTP_POST_VARS['ppecomments']); - - $order->info['comments'] = $comments; - } - } - - $params = array('TOKEN' => $ppe_token, - 'PAYERID' => $ppe_payerid, - 'PAYMENTREQUEST_0_AMT' => $this->format_raw($order->info['total']), - 'PAYMENTREQUEST_0_CURRENCYCODE' => $order->info['currency']); - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['PAYMENTREQUEST_0_SHIPTONAME'] = $order->delivery['firstname'] . ' ' . $order->delivery['lastname']; - $params['PAYMENTREQUEST_0_SHIPTOSTREET'] = $order->delivery['street_address']; - $params['PAYMENTREQUEST_0_SHIPTOCITY'] = $order->delivery['city']; - $params['PAYMENTREQUEST_0_SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'] = $order->delivery['country']['iso_code_2']; - $params['PAYMENTREQUEST_0_SHIPTOZIP'] = $order->delivery['postcode']; - } - - $response_array = $this->doExpressCheckoutPayment($params); - - if (($response_array['ACK'] != 'Success') && ($response_array['ACK'] != 'SuccessWithWarning')) { - if ( $response_array['L_ERRORCODE0'] == '10486' ) { - if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') { - $paypal_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout'; - } else { - $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout'; - } - - $paypal_url .= '&token=' . $ppe_token . '&useraction=commit'; - - tep_redirect($paypal_url); - } - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . stripslashes($response_array['L_LONGMESSAGE0']), 'SSL')); - } - } - - function after_process() { - global $response_array, $insert_id, $ppe_payerstatus, $ppe_addressstatus; - - $pp_result = 'Transaction ID: ' . tep_output_string_protected($response_array['PAYMENTINFO_0_TRANSACTIONID']) . "\n" . - 'Payer Status: ' . tep_output_string_protected($ppe_payerstatus) . "\n" . - 'Address Status: ' . tep_output_string_protected($ppe_addressstatus) . "\n\n" . - 'Payment Status: ' . tep_output_string_protected($response_array['PAYMENTINFO_0_PAYMENTSTATUS']) . "\n" . - 'Payment Type: ' . tep_output_string_protected($response_array['PAYMENTINFO_0_PAYMENTTYPE']) . "\n" . - 'Pending Reason: ' . tep_output_string_protected($response_array['PAYMENTINFO_0_PENDINGREASON']) . "\n" . - 'Reversal Code: ' . tep_output_string_protected($response_array['PAYMENTINFO_0_REASONCODE']); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $pp_result); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - - tep_session_unregister('ppe_token'); - tep_session_unregister('ppe_payerid'); - tep_session_unregister('ppe_payerstatus'); - tep_session_unregister('ppe_addressstatus'); - tep_session_unregister('ppe_secret'); - } - - function get_error() { - return false; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS' => array('title' => 'Enable PayPal Express Checkout', - 'desc' => 'Do you want to accept PayPal Express Checkout payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_SELLER_ACCOUNT' => array('title' => 'Seller Account', - 'desc' => 'The email address of the seller account if no API credentials has been setup.', - 'value' => STORE_OWNER_EMAIL_ADDRESS), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME' => array('title' => 'API Username', - 'desc' => 'The username to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD' => array('title' => 'API Password', - 'desc' => 'The password to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE' => array('title' => 'API Signature', - 'desc' => 'The signature to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_ACCOUNT_OPTIONAL' => array('title' => 'PayPal Account Optional', - 'desc' => 'This must also be enabled in your PayPal account, in Profile > Website Payment Preferences.', - 'value' => 'False', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_INSTANT_UPDATE' => array('title' => 'PayPal Instant Update', - 'desc' => 'Allow PayPal to retrieve shipping rates and taxes for the order.', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_CHECKOUT_IMAGE' => array('title' => 'PayPal Checkout Image', - 'desc' => 'Use static or dynamic Express Checkout image buttons. Dynamic images are used with PayPal campaigns.', - 'value' => 'Static', - 'set_func' => 'tep_cfg_select_option(array(\'Static\', \'Dynamic\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_PAGE_STYLE' => array('title' => 'Page Style', - 'desc' => 'The page style to use for the checkout flow (defined at your PayPal Profile page)'), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Sale', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', - 'desc' => 'Include PayPal transaction information in this order status level.', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'use_func' => 'tep_get_zone_class_title', - 'set_func' => 'tep_cfg_pull_down_zone_classes('), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_PAYPAL_EXPRESS_SORT_ORDER' => array('title' => 'Sort order of display', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters) { - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_PAYPAL_EXPRESS_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_EXPRESS_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function getPalDetails() { - if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $params = array('VERSION' => $this->api_version, - 'METHOD' => 'GetPalDetails', - 'USER' => MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME, - 'PWD' => MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD, - 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - $response_array = array(); - parse_str($response, $response_array); - - if (!isset($response_array['PAL'])) { - $this->sendDebugEmail($response_array); - } - - return $response_array; - } - - function setExpressCheckout($parameters) { - if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $params = array('VERSION' => $this->api_version, - 'METHOD' => 'SetExpressCheckout', - 'PAYMENTREQUEST_0_PAYMENTACTION' => ((MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_METHOD == 'Sale') || (!tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) ? 'Sale' : 'Authorization'), - 'RETURNURL' => tep_href_link('ext/modules/payment/paypal/express.php', 'osC_Action=retrieve', 'SSL', true, false), - 'CANCELURL' => tep_href_link('ext/modules/payment/paypal/express.php', 'osC_Action=cancel', 'SSL', true, false), - 'BRANDNAME' => STORE_NAME, - 'SOLUTIONTYPE' => (MODULE_PAYMENT_PAYPAL_EXPRESS_ACCOUNT_OPTIONAL == 'True') ? 'Sole' : 'Mark'); - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) { - $params['USER'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME; - $params['PWD'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD; - $params['SIGNATURE'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE; - } else { - $params['SUBJECT'] = MODULE_PAYMENT_PAYPAL_EXPRESS_SELLER_ACCOUNT; - } - - if (is_array($parameters) && !empty($parameters)) { - $params = array_merge($params, $parameters); - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - $response_array = array(); - parse_str($response, $response_array); - - if (($response_array['ACK'] != 'Success') && ($response_array['ACK'] != 'SuccessWithWarning')) { - $this->sendDebugEmail($response_array); - } - - return $response_array; - } - - function getExpressCheckoutDetails($token) { - if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $params = array('VERSION' => $this->api_version, - 'METHOD' => 'GetExpressCheckoutDetails', - 'TOKEN' => $token); - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) { - $params['USER'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME; - $params['PWD'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD; - $params['SIGNATURE'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE; - } else { - $params['SUBJECT'] = MODULE_PAYMENT_PAYPAL_EXPRESS_SELLER_ACCOUNT; - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - $response_array = array(); - parse_str($response, $response_array); - - if (($response_array['ACK'] != 'Success') && ($response_array['ACK'] != 'SuccessWithWarning')) { - $this->sendDebugEmail($response_array); - } - - return $response_array; - } - - function doExpressCheckoutPayment($parameters) { - if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $params = array('VERSION' => $this->api_version, - 'METHOD' => 'DoExpressCheckoutPayment', - 'PAYMENTREQUEST_0_PAYMENTACTION' => ((MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_METHOD == 'Sale') || (!tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) ? 'Sale' : 'Authorization'), - 'BUTTONSOURCE' => 'OSCOM23_EC'); - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME)) { - $params['USER'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_USERNAME; - $params['PWD'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_PASSWORD; - $params['SIGNATURE'] = MODULE_PAYMENT_PAYPAL_EXPRESS_API_SIGNATURE; - } else { - $params['SUBJECT'] = MODULE_PAYMENT_PAYPAL_EXPRESS_SELLER_ACCOUNT; - } - - if (is_array($parameters) && !empty($parameters)) { - $params = array_merge($params, $parameters); - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - $response_array = array(); - parse_str($response, $response_array); - - if (($response_array['ACK'] != 'Success') && ($response_array['ACK'] != 'SuccessWithWarning')) { - $this->sendDebugEmail($response_array); - } - - return $response_array; - } - - function getProductType($id, $attributes) { - foreach ( $attributes as $a ) { - $virtual_check_query = tep_db_query("select pad.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$id . "' and pa.options_values_id = '" . (int)$a['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id limit 1"); - - if ( tep_db_num_rows($virtual_check_query) == 1 ) { - return 'Digital'; - } - } - - return 'Physical'; - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_EXPRESS_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_PAYPAL_EXPRESS_DEBUG_EMAIL, 'PayPal Express Checkout Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_PAYPAL_EXPRESS_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - $params = array('PAYMENTREQUEST_0_CURRENCYCODE' => DEFAULT_CURRENCY, - 'PAYMENTREQUEST_0_AMT' => '1.00'); - - $response_array = $this->setExpressCheckout($params); - - if ( is_array($response_array) && isset($response_array['ACK']) ) { - return 1; - } - - return -1; - } - } -?> diff --git a/catalog/includes/modules/payment/paypal_pro_dp.php b/catalog/includes/modules/payment/paypal_pro_dp.php deleted file mode 100644 index 08058d18e..000000000 --- a/catalog/includes/modules/payment/paypal_pro_dp.php +++ /dev/null @@ -1,771 +0,0 @@ -signature = 'paypal|paypal_pro_dp|3.1|2.3'; - $this->api_version = '112'; - - $this->code = 'paypal_pro_dp'; - $this->title = MODULE_PAYMENT_PAYPAL_PRO_DP_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_PAYPAL_PRO_DP_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_PAYPAL_PRO_DP_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_PAYPAL_PRO_DP_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_PRO_DP_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_PAYPAL_PRO_DP_STATUS') && (MODULE_PAYMENT_PAYPAL_PRO_DP_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_PAYPAL_PRO_DP_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_PAYPAL_PRO_DP_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_PAYPAL_PRO_DP_ORDER_STATUS_ID : 0; - - if ( !defined('MODULE_PAYMENT_INSTALLED') || !tep_not_null(MODULE_PAYMENT_INSTALLED) || !in_array('paypal_express.php', explode(';', MODULE_PAYMENT_INSTALLED)) || !defined('MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS') || (MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS != 'True') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_ERROR_EXPRESS_MODULE . '
' . $this->description; - - $this->enabled = false; - } - - if ( defined('MODULE_PAYMENT_PAYPAL_PRO_DP_STATUS') ) { - if ( MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_SERVER == 'Sandbox' ) { - $this->title .= ' [Sandbox]'; - $this->public_title .= ' (' . $this->code . '; Sandbox)'; - } - - $this->description .= $this->getTestLinkInfo(); - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_DP_API_USERNAME) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_DP_API_PASSWORD) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_DP_API_SIGNATURE) ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - - $this->cc_types = array('VISA' => 'Visa', - 'MASTERCARD' => 'MasterCard', - 'DISCOVER' => 'Discover Card', - 'AMEX' => 'American Express', - 'MAESTRO' => 'Maestro'); - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_PRO_DP_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_PRO_DP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - if ( $this->templateClassExists() ) { - $GLOBALS['oscTemplate']->addBlock($this->getSubmitCardDetailsJavascript(), 'header_tags'); - } - } - - function confirmation() { - global $order; - - $types_array = array(); - foreach ( $this->cc_types as $key => $value ) { - if ($this->isCardAccepted($key)) { - $types_array[] = array('id' => $key, - 'text' => $value); - } - } - - $today = getdate(); - - $months_array = array(); - for ($i=1; $i<13; $i++) { - $months_array[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i)); - } - - $year_valid_from_array = array(); - for ($i=$today['year']-10; $i < $today['year']+1; $i++) { - $year_valid_from_array[] = array('id' => strftime('%Y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); - } - - $year_expires_array = array(); - for ($i=$today['year']; $i < $today['year']+10; $i++) { - $year_expires_array[] = array('id' => strftime('%Y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); - } - - $content = '
' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_OWNER . '' . tep_draw_input_field('name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . '' . HTML::inputField('name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . '
' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_NUMBER . '
' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_EXPIRY . '' . tep_draw_pull_down_menu('month', $months_array) . ' / ' . tep_draw_pull_down_menu('year', $years_array) . '' . HTML::selectField('month', $months_array) . ' / ' . HTML::selectField('year', $years_array) . '
 ' . tep_draw_checkbox_field('cc_save', 'true') . ' ' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_SAVE . '' . HTML::checkboxField('cc_save', 'true') . ' ' . MODULE_PAYMENT_BRAINTREE_CC_CREDITCARD_SAVE . '
' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - ''; - - if ( (MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_MAESTRO == 'True') || (MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_AMEX == 'True') ) { - $content .= '' . - ' ' . - ' ' . - ''; - } - - $content .= '' . - ' ' . - ' ' . - ''; - - if ( MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_MAESTRO == 'True' ) { - $content .= '' . - ' ' . - ' ' . - ''; - } - - $content .= '' . - ' ' . - ' ' . - '' . - '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_TYPE . '' . tep_draw_pull_down_menu('cc_type', $types_array, '', 'id="paypal_card_type"') . '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_OWNER . '' . tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_NUMBER . '' . tep_draw_input_field('cc_number_nh-dns', '', 'id="paypal_card_num"') . '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_VALID_FROM . '' . tep_draw_pull_down_menu('cc_starts_month', $months_array, '', 'id="paypal_card_date_start"') . ' ' . tep_draw_pull_down_menu('cc_starts_year', $year_valid_from_array) . ' ' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_VALID_FROM_INFO . '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_EXPIRES . '' . tep_draw_pull_down_menu('cc_expires_month', $months_array) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $year_expires_array) . '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_ISSUE_NUMBER . '' . tep_draw_input_field('cc_issue_nh-dns', '', 'id="paypal_card_issue" size="3" maxlength="2"') . ' ' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_ISSUE_NUMBER_INFO . '
' . MODULE_PAYMENT_PAYPAL_PRO_DP_CARD_CVC . '' . tep_draw_input_field('cc_cvc_nh-dns', '', 'size="5" maxlength="4"') . '
'; - - $content .= !$this->templateClassExists() ? $this->getSubmitCardDetailsJavascript() : ''; - - $confirmation = array('title' => $content); - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $HTTP_POST_VARS, $order, $order_totals, $sendto, $response_array; - - if (isset($HTTP_POST_VARS['cc_owner']) && !empty($HTTP_POST_VARS['cc_owner']) && isset($HTTP_POST_VARS['cc_type']) && $this->isCardAccepted($HTTP_POST_VARS['cc_type']) && isset($HTTP_POST_VARS['cc_number_nh-dns']) && !empty($HTTP_POST_VARS['cc_number_nh-dns'])) { - if (MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $params = array('USER' => MODULE_PAYMENT_PAYPAL_PRO_DP_API_USERNAME, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_DP_API_PASSWORD, - 'VERSION' => $this->api_version, - 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_PRO_DP_API_SIGNATURE, - 'METHOD' => 'DoDirectPayment', - 'PAYMENTACTION' => ((MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_METHOD == 'Sale') ? 'Sale' : 'Authorization'), - 'IPADDRESS' => tep_get_ip_address(), - 'AMT' => $this->format_raw($order->info['total']), - 'CREDITCARDTYPE' => $HTTP_POST_VARS['cc_type'], - 'ACCT' => $HTTP_POST_VARS['cc_number_nh-dns'], - 'EXPDATE' => $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year'], - 'CVV2' => $HTTP_POST_VARS['cc_cvc_nh-dns'], - 'FIRSTNAME' => substr($HTTP_POST_VARS['cc_owner'], 0, strpos($HTTP_POST_VARS['cc_owner'], ' ')), - 'LASTNAME' => substr($HTTP_POST_VARS['cc_owner'], strpos($HTTP_POST_VARS['cc_owner'], ' ')+1), - 'STREET' => $order->billing['street_address'], - 'CITY' => $order->billing['city'], - 'STATE' => tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']), - 'COUNTRYCODE' => $order->billing['country']['iso_code_2'], - 'ZIP' => $order->billing['postcode'], - 'EMAIL' => $order->customer['email_address'], - 'SHIPTOPHONENUM' => $order->customer['telephone'], - 'CURRENCYCODE' => $order->info['currency'], - 'BUTTONSOURCE' => 'OSCOM23_DP'); - - if ( $HTTP_POST_VARS['cc_type'] == 'MAESTRO' ) { - $params['STARTDATE'] = $HTTP_POST_VARS['cc_starts_month'] . $HTTP_POST_VARS['cc_starts_year']; - $params['ISSUENUMBER'] = $HTTP_POST_VARS['cc_issue_nh-dns']; - } - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['SHIPTONAME'] = $order->delivery['firstname'] . ' ' . $order->delivery['lastname']; - $params['SHIPTOSTREET'] = $order->delivery['street_address']; - $params['SHIPTOCITY'] = $order->delivery['city']; - $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['SHIPTOCOUNTRYCODE'] = $order->delivery['country']['iso_code_2']; - $params['SHIPTOZIP'] = $order->delivery['postcode']; - } - - $item_params = array(); - - $line_item_no = 0; - - foreach ($order->products as $product) { - $item_params['L_NAME' . $line_item_no] = $product['name']; - $item_params['L_AMT' . $line_item_no] = $this->format_raw($product['final_price']); - $item_params['L_NUMBER' . $line_item_no] = $product['id']; - $item_params['L_QTY' . $line_item_no] = $product['qty']; - - $line_item_no++; - } - - $items_total = $this->format_raw($order->info['subtotal']); - - foreach ($order_totals as $ot) { - if ( !in_array($ot['code'], array('ot_subtotal', 'ot_shipping', 'ot_tax', 'ot_total')) ) { - $item_params['L_NAME' . $line_item_no] = $ot['title']; - $item_params['L_AMT' . $line_item_no] = $this->format_raw($ot['value']); - - $items_total += $this->format_raw($ot['value']); - - $line_item_no++; - } - } - - $item_params['ITEMAMT'] = $items_total; - $item_params['TAXAMT'] = $this->format_raw($order->info['tax']); - $item_params['SHIPPINGAMT'] = $this->format_raw($order->info['shipping_cost']); - - if ( $this->format_raw($item_params['ITEMAMT'] + $item_params['TAXAMT'] + $item_params['SHIPPINGAMT']) == $params['AMT'] ) { - $params = array_merge($params, $item_params); - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - $response_array = array(); - parse_str($response, $response_array); - - if (($response_array['ACK'] != 'Success') && ($response_array['ACK'] != 'SuccessWithWarning')) { - $this->sendDebugEmail($response_array); - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . stripslashes($response_array['L_LONGMESSAGE0']), 'SSL')); - } - } else { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . MODULE_PAYMENT_PAYPAL_PRO_DP_ERROR_ALL_FIELDS_REQUIRED, 'SSL')); - } - } - - function after_process() { - global $response_array, $insert_id; - - $result = 'Transaction ID: ' . tep_output_string_protected($response_array['TRANSACTIONID']) . "\n" . - 'AVS Code: ' . tep_output_string_protected($response_array['AVSCODE']) . "\n" . - 'CVV2 Match: ' . tep_output_string_protected($response_array['CVV2MATCH']); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $result); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - - function get_error() { - return false; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_PRO_DP_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_PAYPAL_PRO_DP_STATUS' => array('title' => 'Enable PayPal Payments Pro (Direct Payment)', - 'desc' => 'Do you want to accept PayPal Payments Pro (Direct Payment) payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_API_USERNAME' => array('title' => 'API Username', - 'desc' => 'The username to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_API_PASSWORD' => array('title' => 'API Password', - 'desc' => 'The password to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_API_SIGNATURE' => array('title' => 'API Signature', - 'desc' => 'The signature to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Sale', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', - 'desc' => 'Include PayPal transaction information in this order status level.', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_zone_classes(', - 'use_func' => 'tep_get_zone_class_title'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0'), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_VISA' => array('title' => 'Accept Visa', - 'desc' => 'Accept Visa card payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_MASTERCARD' => array('title' => 'Accept MasterCard', - 'desc' => 'Accept MasterCard card payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_DISCOVER' => array('title' => 'Accept Discover', - 'desc' => 'Accept Discover card payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_AMEX' => array('title' => 'Accept American Express', - 'desc' => 'Accept American Express card payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_MAESTRO' => array('title' => 'Accept Maestro', - 'desc' => 'Accept Maestro card payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), ')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters) { - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_PAYPAL_PRO_DP_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_DP_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_PRO_DP_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function isCardAccepted($card) { - return (isset($this->cc_types[$card]) && defined('MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_' . $card) && (constant('MODULE_PAYMENT_PAYPAL_PRO_DP_CARDTYPE_' . $card) == 'True')); - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_PAYPAL_PRO_DP_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - if (MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $params = array('USER' => MODULE_PAYMENT_PAYPAL_PRO_DP_API_USERNAME, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_DP_API_PASSWORD, - 'VERSION' => $this->api_version, - 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_PRO_DP_API_SIGNATURE, - 'METHOD' => 'DoDirectPayment', - 'PAYMENTACTION' => ((MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_METHOD == 'Sale') ? 'Sale' : 'Authorization'), - 'IPADDRESS' => tep_get_ip_address()); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - $response_array = array(); - parse_str($response, $response_array); - - if ( is_array($response_array) && isset($response_array['ACK']) ) { - return 1; - } - - return -1; - } - - function templateClassExists() { - return class_exists('oscTemplate') && isset($GLOBALS['oscTemplate']) && is_object($GLOBALS['oscTemplate']) && (get_class($GLOBALS['oscTemplate']) == 'oscTemplate'); - } - - function getSubmitCardDetailsJavascript() { - $test_visa = ''; - - if ( MODULE_PAYMENT_PAYPAL_PRO_DP_TRANSACTION_SERVER == 'Sandbox' ) { - $test_visa = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); -} - - - -EOD; - - return $js; - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_DP_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - if (isset($HTTP_POST_VARS['cc_number_nh-dns'])) { - $HTTP_POST_VARS['cc_number_nh-dns'] = 'XXXX' . substr($HTTP_POST_VARS['cc_number_nh-dns'], -4); - } - - if (isset($HTTP_POST_VARS['cc_cvc_nh-dns'])) { - $HTTP_POST_VARS['cc_cvc_nh-dns'] = 'XXX'; - } - - if (isset($HTTP_POST_VARS['cc_issue_nh-dns'])) { - $HTTP_POST_VARS['cc_issue_nh-dns'] = 'XXX'; - } - - if (isset($HTTP_POST_VARS['cc_expires_month'])) { - $HTTP_POST_VARS['cc_expires_month'] = 'XX'; - } - - if (isset($HTTP_POST_VARS['cc_expires_year'])) { - $HTTP_POST_VARS['cc_expires_year'] = 'XX'; - } - - if (isset($HTTP_POST_VARS['cc_starts_month'])) { - $HTTP_POST_VARS['cc_starts_month'] = 'XX'; - } - - if (isset($HTTP_POST_VARS['cc_starts_year'])) { - $HTTP_POST_VARS['cc_starts_year'] = 'XX'; - } - - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_PAYPAL_PRO_DP_DEBUG_EMAIL, 'PayPal Payments Pro (Direct Payment) Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/paypal_pro_hs.php b/catalog/includes/modules/payment/paypal_pro_hs.php deleted file mode 100644 index 18bd54478..000000000 --- a/catalog/includes/modules/payment/paypal_pro_hs.php +++ /dev/null @@ -1,1077 +0,0 @@ -signature = 'paypal|paypal_pro_hs|1.1|2.3'; - $this->api_version = '112'; - - $this->code = 'paypal_pro_hs'; - $this->title = MODULE_PAYMENT_PAYPAL_PRO_HS_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_PAYPAL_PRO_HS_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_PAYPAL_PRO_HS_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_PAYPAL_PRO_HS_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_PRO_HS_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_PAYPAL_PRO_HS_STATUS') && (MODULE_PAYMENT_PAYPAL_PRO_HS_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_PAYPAL_PRO_HS_STATUS') ) { - if ( MODULE_PAYMENT_PAYPAL_PRO_HS_GATEWAY_SERVER == 'Sandbox' ) { - $this->title .= ' [Sandbox]'; - $this->public_title .= ' (' . $this->code . '; Sandbox)'; - } - - if ( MODULE_PAYMENT_PAYPAL_PRO_HS_GATEWAY_SERVER == 'Live' ) { - $this->api_url = 'https://api-3t.paypal.com/nvp'; - } else { - $this->api_url = 'https://api-3t.sandbox.paypal.com/nvp'; - } - - $this->description .= $this->getTestLinkInfo(); - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_HS_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_ID) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_API_USERNAME) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_API_PASSWORD) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_API_SIGNATURE) ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_HS_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_PRO_HS_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_PRO_HS_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - global $cart_PayPal_Pro_HS_ID; - - if (tep_session_is_registered('cart_PayPal_Pro_HS_ID')) { - $order_id = substr($cart_PayPal_Pro_HS_ID, strpos($cart_PayPal_Pro_HS_ID, '-')+1); - - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - - tep_session_unregister('cart_PayPal_Pro_HS_ID'); - } - } - - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - global $cartID, $cart; - - if (empty($cart->cartID)) { - $cartID = $cart->cartID = $cart->generate_cart_id(); - } - - if (!tep_session_is_registered('cartID')) { - tep_session_register('cartID'); - } - } - - function confirmation() { - global $cartID, $cart_PayPal_Pro_HS_ID, $customer_id, $languages_id, $order, $order_total_modules, $currency, $sendto, $pphs_result, $pphs_key; - - $pphs_result = array(); - - if (tep_session_is_registered('cartID')) { - $insert_order = false; - - if (tep_session_is_registered('cart_PayPal_Pro_HS_ID')) { - $order_id = substr($cart_PayPal_Pro_HS_ID, strpos($cart_PayPal_Pro_HS_ID, '-')+1); - - $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); - $curr = tep_db_fetch_array($curr_check); - - if ( ($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_PayPal_Pro_HS_ID, 0, strlen($cartID))) ) { - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - } - - $insert_order = true; - } - } else { - $insert_order = true; - } - - if ($insert_order == true) { - $order_totals = array(); - if (is_array($order_total_modules->modules)) { - foreach ($order_total_modules->modules as $value) { - $class = substr($value, 0, strrpos($value, '.')); - if ($GLOBALS[$class]->enabled) { - for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { - if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { - $order_totals[] = array('code' => $GLOBALS[$class]->code, - 'title' => $GLOBALS[$class]->output[$i]['title'], - 'text' => $GLOBALS[$class]->output[$i]['text'], - 'value' => $GLOBALS[$class]->output[$i]['value'], - 'sort_order' => $GLOBALS[$class]->sort_order); - } - } - } - } - } - - $sql_data_array = array('customers_id' => $customer_id, - 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], - 'customers_company' => $order->customer['company'], - 'customers_street_address' => $order->customer['street_address'], - 'customers_suburb' => $order->customer['suburb'], - 'customers_city' => $order->customer['city'], - 'customers_postcode' => $order->customer['postcode'], - 'customers_state' => $order->customer['state'], - 'customers_country' => $order->customer['country']['title'], - 'customers_telephone' => $order->customer['telephone'], - 'customers_email_address' => $order->customer['email_address'], - 'customers_address_format_id' => $order->customer['format_id'], - 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], - 'delivery_company' => $order->delivery['company'], - 'delivery_street_address' => $order->delivery['street_address'], - 'delivery_suburb' => $order->delivery['suburb'], - 'delivery_city' => $order->delivery['city'], - 'delivery_postcode' => $order->delivery['postcode'], - 'delivery_state' => $order->delivery['state'], - 'delivery_country' => $order->delivery['country']['title'], - 'delivery_address_format_id' => $order->delivery['format_id'], - 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], - 'billing_company' => $order->billing['company'], - 'billing_street_address' => $order->billing['street_address'], - 'billing_suburb' => $order->billing['suburb'], - 'billing_city' => $order->billing['city'], - 'billing_postcode' => $order->billing['postcode'], - 'billing_state' => $order->billing['state'], - 'billing_country' => $order->billing['country']['title'], - 'billing_address_format_id' => $order->billing['format_id'], - 'payment_method' => $order->info['payment_method'], - 'cc_type' => $order->info['cc_type'], - 'cc_owner' => $order->info['cc_owner'], - 'cc_number' => $order->info['cc_number'], - 'cc_expires' => $order->info['cc_expires'], - 'date_purchased' => 'now()', - 'orders_status' => $order->info['order_status'], - 'currency' => $order->info['currency'], - 'currency_value' => $order->info['currency_value']); - - tep_db_perform(TABLE_ORDERS, $sql_data_array); - - $insert_id = tep_db_insert_id(); - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'title' => $order_totals[$i]['title'], - 'text' => $order_totals[$i]['text'], - 'value' => $order_totals[$i]['value'], - 'class' => $order_totals[$i]['code'], - 'sort_order' => $order_totals[$i]['sort_order']); - - tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); - } - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'products_id' => tep_get_prid($order->products[$i]['id']), - 'products_model' => $order->products[$i]['model'], - 'products_name' => $order->products[$i]['name'], - 'products_price' => $order->products[$i]['price'], - 'final_price' => $order->products[$i]['final_price'], - 'products_tax' => $order->products[$i]['tax'], - 'products_quantity' => $order->products[$i]['qty']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); - - $order_products_id = tep_db_insert_id(); - - $attributes_exist = '0'; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'products_options' => $attributes_values['products_options_name'], - 'products_options_values' => $attributes_values['products_options_values_name'], - 'options_values_price' => $attributes_values['options_values_price'], - 'price_prefix' => $attributes_values['price_prefix']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); - - if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'orders_products_filename' => $attributes_values['products_attributes_filename'], - 'download_maxdays' => $attributes_values['products_attributes_maxdays'], - 'download_count' => $attributes_values['products_attributes_maxcount']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); - } - } - } - } - - $cart_PayPal_Pro_HS_ID = $cartID . '-' . $insert_id; - tep_session_register('cart_PayPal_Pro_HS_ID'); - } - - $order_id = substr($cart_PayPal_Pro_HS_ID, strpos($cart_PayPal_Pro_HS_ID, '-')+1); - - $params = array('business' => MODULE_PAYMENT_PAYPAL_PRO_HS_ID, - 'bn' => 'OSCOM23_HS', - 'buyer_email' => $order->customer['email_address'], - 'cancel_return' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), - 'currency_code' => $currency, - 'invoice' => $order_id, - 'custom' => $customer_id, - 'paymentaction' => MODULE_PAYMENT_PAYPAL_PRO_HS_TRANSACTION_METHOD == 'Sale' ? 'sale' : 'authorization', - 'return' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'), - 'notify_url' => tep_href_link('ext/modules/payment/paypal/pro_hosted_ipn.php', '', 'SSL', false, false), - 'shipping' => $this->format_raw($order->info['shipping_cost']), - 'tax' => $this->format_raw($order->info['tax']), - 'subtotal' => $this->format_raw($order->info['total'] - $order->info['shipping_cost'] - $order->info['tax']), - 'billing_first_name' => $order->billing['firstname'], - 'billing_last_name' => $order->billing['lastname'], - 'billing_address1' => $order->billing['street_address'], - 'billing_city' => $order->billing['city'], - 'billing_state' => tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']), - 'billing_zip' => $order->billing['postcode'], - 'billing_country' => $order->billing['country']['iso_code_2'], - 'night_phone_b' => $order->customer['telephone'], - 'template' => 'templateD', - 'item_name' => STORE_NAME, - 'showBillingAddress' => 'false', - 'showShippingAddress' => 'false', - 'showHostedThankyouPage' => 'false'); - - if ( is_numeric($sendto) && ($sendto > 0) ) { - $params['address_override'] = 'true'; - $params['first_name'] = $order->delivery['firstname']; - $params['last_name'] = $order->delivery['lastname']; - $params['address1'] = $order->delivery['street_address']; - $params['city'] = $order->delivery['city']; - $params['state'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['zip'] = $order->delivery['postcode']; - $params['country'] = $order->delivery['country']['iso_code_2']; - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_TEXT_PAYPAL_RETURN_BUTTON) && (strlen(MODULE_PAYMENT_PAYPAL_PRO_HS_TEXT_PAYPAL_RETURN_BUTTON) <= 60) ) { - $params['cbt'] = MODULE_PAYMENT_PAYPAL_PRO_HS_TEXT_PAYPAL_RETURN_BUTTON; - } - - $counter = 0; - $params_string = 'USER=' . urlencode(utf8_encode(trim(MODULE_PAYMENT_PAYPAL_PRO_HS_API_USERNAME))) . '&PWD=' . urlencode(utf8_encode(trim(MODULE_PAYMENT_PAYPAL_PRO_HS_API_PASSWORD))) . '&SIGNATURE=' . urlencode(utf8_encode(trim(MODULE_PAYMENT_PAYPAL_PRO_HS_API_SIGNATURE))) . '&VERSION=' . $this->api_version . '&METHOD=BMCreateButton&BUTTONCODE=TOKEN&BUTTONTYPE=PAYMENT&'; - - foreach ( $params as $key => $value ) { - $params_string .= 'L_BUTTONVAR' . $counter . '=' . $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - - $counter++; - } - - $params_string = substr($params_string, 0, -1); - - $response = $this->sendTransactionToGateway($this->api_url, $params_string); - - $pphs_result = array(); - parse_str($response, $pphs_result); - - if (($pphs_result['ACK'] != 'Success') && ($pphs_result['ACK'] != 'SuccessWithWarning')) { - $this->sendDebugEmail($pphs_result); - } - - if ( !tep_session_is_registered('pphs_result') ) { - tep_session_register('pphs_result'); - } - } - - $pphs_key = tep_create_random_value(16); - - if ( !tep_session_is_registered('pphs_key') ) { - tep_session_register('pphs_key'); - } - - $iframe_url = tep_href_link('ext/modules/payment/paypal/hosted_checkout.php', 'key=' . $pphs_key, 'SSL'); - $form_url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=paypal_pro_hs', 'SSL'); - -// include jquery if it doesn't exist in the template - $output = << - - - -EOD; - - $confirmation = array('title' => $output); - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $cart_PayPal_Pro_HS_ID, $customer_id, $pphs_result, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $$payment; - - $result = false; - - if ( isset($HTTP_GET_VARS['tx']) && !empty($HTTP_GET_VARS['tx']) ) { // direct payment (eg, credit card) - $result = $this->getTransactionDetails($HTTP_GET_VARS['tx']); - } elseif ( isset($HTTP_POST_VARS['txn_id']) && !empty($HTTP_POST_VARS['txn_id']) ) { // paypal payment - $result = $this->getTransactionDetails($HTTP_POST_VARS['txn_id']); - } - - if ( !is_array($result) || !isset($result['ACK']) || (($result['ACK'] != 'Success') && ($result['ACK'] != 'SuccessWithWarning')) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . stripslashes($result['L_LONGMESSAGE0']))); - } - - $order_id = substr($cart_PayPal_Pro_HS_ID, strpos($cart_PayPal_Pro_HS_ID, '-')+1); - - $seller_accounts = array(MODULE_PAYMENT_PAYPAL_PRO_HS_ID); - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_PRIMARY_ID) ) { - $seller_accounts[] = MODULE_PAYMENT_PAYPAL_PRO_HS_PRIMARY_ID; - } - - if ( !isset($result['RECEIVERBUSINESS']) || !in_array($result['RECEIVERBUSINESS'], $seller_accounts) || ($result['INVNUM'] != $order_id) || ($result['CUSTOM'] != $customer_id) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - $pphs_result = $result; - - $check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "' and customers_id = '" . (int)$customer_id . "'"); - - $tx_order_id = $pphs_result['INVNUM']; - $tx_customer_id = $pphs_result['CUSTOM']; - - if (!tep_db_num_rows($check_query) || ($order_id != $tx_order_id) || ($customer_id != $tx_customer_id)) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - $check = tep_db_fetch_array($check_query); - - $this->verifyTransaction(); - - $new_order_status = DEFAULT_ORDERS_STATUS_ID; - - if ( $check['orders_status'] != MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID ) { - $new_order_status = $check['orders_status']; - } - - if ( (MODULE_PAYMENT_PAYPAL_PRO_HS_ORDER_STATUS_ID > 0) && ($check['orders_status'] == MODULE_PAYMENT_PAYPAL_PRO_HS_ORDER_STATUS_ID) ) { - $new_order_status = MODULE_PAYMENT_PAYPAL_PRO_HS_ORDER_STATUS_ID; - } - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (int)$new_order_status . "', last_modified = now() where orders_id = '" . (int)$order_id . "'"); - - $sql_data_array = array('orders_id' => $order_id, - 'orders_status_id' => (int)$new_order_status, - 'date_added' => 'now()', - 'customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0', - 'comments' => $order->info['comments']); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - -// initialized for the email confirmation - $products_ordered = ''; - $subtotal = 0; - $total_tax = 0; - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { -// Stock Update - Joao Correia - if (STOCK_LIMITED == 'true') { - if (DOWNLOAD_ENABLED == 'true') { - $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename - FROM " . TABLE_PRODUCTS . " p - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa - ON p.products_id=pa.products_id - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - ON pa.products_attributes_id=pad.products_attributes_id - WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; -// Will work with only one option for downloadable products -// otherwise, we have to build the query dynamically with a loop - $products_attributes = $order->products[$i]['attributes']; - if (is_array($products_attributes)) { - $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; - } - $stock_query = tep_db_query($stock_query_raw); - } else { - $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - if (tep_db_num_rows($stock_query) > 0) { - $stock_values = tep_db_fetch_array($stock_query); -// do not decrement quantities if products_attributes_filename exists - if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { - $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; - } else { - $stock_left = $stock_values['products_quantity']; - } - tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { - tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - } - } - -// Update products_ordered (for bestsellers list) - tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - -//------insert customer choosen option to order-------- - $attributes_exist = '0'; - $products_ordered_attributes = ''; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; - } - } -//------insert customer choosen option eof ---- - $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); - $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; - $total_cost += $total_products_price; - - $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; - } - -// lets start with the email confirmation - $email_order = STORE_NAME . "\n" . - EMAIL_SEPARATOR . "\n" . - EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . - EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . - EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; - if ($order->info['comments']) { - $email_order .= tep_db_output($order->info['comments']) . "\n\n"; - } - $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . - EMAIL_SEPARATOR . "\n" . - $products_ordered . - EMAIL_SEPARATOR . "\n"; - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; - } - - if ($order->content_type != 'virtual') { - $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; - } - - $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; - - if (is_object($$payment)) { - $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . - EMAIL_SEPARATOR . "\n"; - $payment_class = $$payment; - $email_order .= $payment_class->title . "\n\n"; - if ($payment_class->email_footer) { - $email_order .= $payment_class->email_footer . "\n\n"; - } - } - - tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - -// send emails to other people - if (SEND_EXTRA_ORDER_EMAILS_TO != '') { - tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - -// load the after_process function from the payment modules - $this->after_process(); - - $cart->reset(true); - -// unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); - - tep_session_unregister('cart_PayPal_Pro_HS_ID'); - tep_session_unregister('pphs_result'); - tep_session_unregister('pphs_key'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); - } - - function after_process() { - return false; - } - - function get_error() { - global $pphs_error_msg; - - $error = array('title' => MODULE_PAYMENT_PAYPAL_PRO_HS_ERROR_TITLE, - 'error' => MODULE_PAYMENT_PAYPAL_PRO_HS_ERROR_GENERAL); - - if ( tep_session_is_registered('pphs_error_msg') ) { - $error['error'] = $pphs_error_msg; - - tep_session_unregister('pphs_error_msg'); - } - - return $error; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_PRO_HS_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [PayPal Pro HS]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [PayPal Pro HS]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID; - } - - if (!defined('MODULE_PAYMENT_PAYPAL_PRO_HS_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $tx_status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $tx_status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $tx_status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $tx_status_id = $check['orders_status_id']; - } - } else { - $tx_status_id = MODULE_PAYMENT_PAYPAL_PRO_HS_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_PAYPAL_PRO_HS_STATUS' => array('title' => 'Enable PayPal Payments Pro (Hosted Solution)', - 'desc' => 'Do you want to accept PayPal Payments Pro (Hosted Solution) payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_API_USERNAME' => array('title' => 'API Username', - 'desc' => 'The username to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_API_PASSWORD' => array('title' => 'API Password', - 'desc' => 'The password to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_API_SIGNATURE' => array('title' => 'API Signature', - 'desc' => 'The signature to use for the PayPal API service.'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_ID' => array('title' => 'Seller E-Mail Address', - 'desc' => 'The PayPal seller e-mail address to accept payments for'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_PRIMARY_ID' => array('title' => 'Primary E-Mail Address', - 'desc' => 'The primary PayPal seller e-mail address to validate transactions with (leave empty if it is the same as the Seller E-Mail Address)'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Sale', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID' => array('title' => 'Set Preparing Order Status', - 'desc' => 'Set the status of prepared orders made with this payment module to this value', - 'value' => $status_id, - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_ORDER_STATUS_ID' => array('title' => 'Set PayPal Acknowledged Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', - 'desc' => 'Include PayPal transaction information in this order status level.', - 'value' => $tx_status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'use_func' => 'tep_get_zone_class_title', - 'set_func' => 'tep_cfg_pull_down_zone_classes('), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_GATEWAY_SERVER' => array('title' => 'Gateway Server', - 'desc' => 'Use the testing (sandbox) or live gateway server for transactions?', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_PAYPAL_PRO_HS_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters) { - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_PAYPAL_PRO_HS_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_PRO_HS_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - - function getTransactionDetails($id) { - $params = array('USER' => MODULE_PAYMENT_PAYPAL_PRO_HS_API_USERNAME, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_HS_API_PASSWORD, - 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_PRO_HS_API_SIGNATURE, - 'VERSION' => $this->api_version, - 'METHOD' => 'GetTransactionDetails', - 'TRANSACTIONID' => $id); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($this->api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if (($response_array['ACK'] != 'Success') && ($response_array['ACK'] != 'SuccessWithWarning')) { - $this->sendDebugEmail($response_array); - } - - return $response_array; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - -// include jquery if it doesn't exist in the template - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_PAYPAL_PRO_HS_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - $params = array('USER' => MODULE_PAYMENT_PAYPAL_PRO_HS_API_USERNAME, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_HS_API_PASSWORD, - 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_PRO_HS_API_SIGNATURE, - 'VERSION' => $paypal_pro_hs->api_version, - 'METHOD' => 'BMCreateButton'); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($this->api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if ( is_array($response_array) && isset($response_array['ACK']) ) { - return 1; - } - - return -1; - } - - function verifyTransaction($is_ipn = false) { - global $pphs_result, $currencies; - - $tx_order_id = $pphs_result['INVNUM']; - $tx_customer_id = $pphs_result['CUSTOM']; - $tx_transaction_id = $pphs_result['TRANSACTIONID']; - $tx_payment_status = $pphs_result['PAYMENTSTATUS']; - $tx_payer_status = $pphs_result['PAYERSTATUS']; - $tx_amount = $pphs_result['AMT']; - $tx_currency = $pphs_result['CURRENCYCODE']; - $tx_pending_reason = (isset($pphs_result['PENDINGREASON'])) ? $pphs_result['PENDINGREASON'] : null; - $tx_reason_code = (isset($pphs_result['REASONCODE'])) ? $pphs_result['REASONCODE'] : null; - - if ( is_numeric($tx_order_id) && ($tx_order_id > 0) && is_numeric($tx_customer_id) && ($tx_customer_id > 0) ) { - $order_query = tep_db_query("select orders_id, orders_status, currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . (int)$tx_order_id . "' and customers_id = '" . (int)$tx_customer_id . "'"); - - if ( tep_db_num_rows($order_query) === 1 ) { - $order = tep_db_fetch_array($order_query); - - $new_order_status = DEFAULT_ORDERS_STATUS_ID; - - if ( $order['orders_status'] != MODULE_PAYMENT_PAYPAL_PRO_HS_PREPARE_ORDER_STATUS_ID ) { - $new_order_status = $order['orders_status']; - } - - $total_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order['orders_id'] . "' and class = 'ot_total' limit 1"); - $total = tep_db_fetch_array($total_query); - - $comment_status = 'Transaction ID: ' . $tx_transaction_id . '; ' . - $tx_payment_status . ' (' . ucfirst($tx_payer_status) . '; ' . $currencies->format($tx_amount, false, $tx_currency) . ')'; - - if ( $tx_payment_status == 'Pending' ) { - $comment_status .= '; ' . $tx_pending_reason; - } elseif ( ($tx_payment_status == 'Reversed') || ($tx_payment_status == 'Refunded') ) { - $comment_status .= '; ' . $tx_reason_code; - } - - if ( $tx_amount != number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency'])) ) { - $comment_status .= '; PayPal transaction value (' . $tx_amount . ') does not match order value (' . number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency'])) . ')'; - } elseif ( $tx_payment_status == 'Completed' ) { - $new_order_status = (MODULE_PAYMENT_PAYPAL_PRO_HS_ORDER_STATUS_ID > 0 ? MODULE_PAYMENT_PAYPAL_PRO_HS_ORDER_STATUS_ID : $new_order_status); - } - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (int)$new_order_status . "', last_modified = now() where orders_id = '" . (int)$order['orders_id'] . "'"); - - if ( $is_ipn === true ) { - $source = 'PayPal IPN Verified'; - } else { - $source = 'PayPal Verified'; - } - - $sql_data_array = array('orders_id' => (int)$order['orders_id'], - 'orders_status_id' => MODULE_PAYMENT_PAYPAL_PRO_HS_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $source . ' [' . tep_output_string_protected($comment_status) . ']'); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_HS_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_PAYPAL_PRO_HS_DEBUG_EMAIL, 'PayPal Payments Pro (Hosted Solution) Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/paypal_pro_payflow_dp.php b/catalog/includes/modules/payment/paypal_pro_payflow_dp.php deleted file mode 100644 index bbf08b819..000000000 --- a/catalog/includes/modules/payment/paypal_pro_payflow_dp.php +++ /dev/null @@ -1,731 +0,0 @@ -signature = 'paypal|paypal_pro_payflow_dp|3.1|2.3'; - - $this->code = 'paypal_pro_payflow_dp'; - $this->title = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS') && (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ORDER_STATUS_ID : 0; - - if ( !defined('MODULE_PAYMENT_INSTALLED') || !tep_not_null(MODULE_PAYMENT_INSTALLED) || !in_array('paypal_pro_payflow_ec.php', explode(';', MODULE_PAYMENT_INSTALLED)) || !defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS') || (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS != 'True') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_EXPRESS_MODULE . '
' . $this->description; - - $this->enabled = false; - } - - if ( defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS') ) { - if ( MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER == 'Sandbox' ) { - $this->title .= ' [Sandbox]'; - $this->public_title .= ' (' . $this->code . '; Sandbox)'; - } - - $this->description .= $this->getTestLinkInfo(); - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD) ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - if ( $this->templateClassExists() ) { - $GLOBALS['oscTemplate']->addBlock($this->getSubmitCardDetailsJavascript(), 'header_tags'); - } - } - - function confirmation() { - global $order; - - $today = getdate(); - - $months_array = array(); - for ($i=1; $i<13; $i++) { - $months_array[] = array('id' => sprintf('%02d', $i), 'text' => sprintf('%02d', $i)); - } - - $year_expires_array = array(); - for ($i=$today['year']; $i < $today['year']+10; $i++) { - $year_expires_array[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); - } - - $content = '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - '' . - '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_CARD_OWNER_FIRSTNAME . '' . tep_draw_input_field('cc_owner_firstname', $order->billing['firstname']) . '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_CARD_OWNER_LASTNAME . '' . tep_draw_input_field('cc_owner_lastname', $order->billing['lastname']) . '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_CARD_NUMBER . '' . tep_draw_input_field('cc_number_nh-dns', '', 'id="paypal_card_num"') . '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_CARD_EXPIRES . '' . tep_draw_pull_down_menu('cc_expires_month', $months_array) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $year_expires_array) . '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_CARD_CVC . '' . tep_draw_input_field('cc_cvc_nh-dns', '', 'size="5" maxlength="4"') . '
'; - - $content .= !$this->templateClassExists() ? $this->getSubmitCardDetailsJavascript() : ''; - - $confirmation = array('title' => $content); - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $HTTP_POST_VARS, $order, $order_totals, $sendto, $response_array; - - if (isset($HTTP_POST_VARS['cc_owner_firstname']) && !empty($HTTP_POST_VARS['cc_owner_firstname']) && isset($HTTP_POST_VARS['cc_owner_lastname']) && !empty($HTTP_POST_VARS['cc_owner_lastname']) && isset($HTTP_POST_VARS['cc_number_nh-dns']) && !empty($HTTP_POST_VARS['cc_number_nh-dns'])) { - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://payflowpro.paypal.com'; - } else { - $api_url = 'https://pilot-payflowpro.paypal.com'; - } - - $params = array('USER' => (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR), - 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR, - 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PARTNER, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD, - 'TENDER' => 'C', - 'TRXTYPE' => ((MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_METHOD == 'Sale') ? 'S' : 'A'), - 'AMT' => $this->format_raw($order->info['total']), - 'CURRENCY' => $order->info['currency'], - 'BILLTOFIRSTNAME' => $HTTP_POST_VARS['cc_owner_firstname'], - 'BILLTOLASTNAME' => $HTTP_POST_VARS['cc_owner_lastname'], - 'BILLTOSTREET' => $order->billing['street_address'], - 'BILLTOCITY' => $order->billing['city'], - 'BILLTOSTATE' => tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']), - 'BILLTOCOUNTRY' => $order->billing['country']['iso_code_2'], - 'BILLTOZIP' => $order->billing['postcode'], - 'CUSTIP' => tep_get_ip_address(), - 'EMAIL' => $order->customer['email_address'], - 'ACCT' => $HTTP_POST_VARS['cc_number_nh-dns'], - 'EXPDATE' => $HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year'], - 'CVV2' => $HTTP_POST_VARS['cc_cvc_nh-dns'], - 'BUTTONSOURCE' => 'OSCOM23_DPPF'); - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['SHIPTOFIRSTNAME'] = $order->delivery['firstname']; - $params['SHIPTOLASTNAME'] = $order->delivery['lastname']; - $params['SHIPTOSTREET'] = $order->delivery['street_address']; - $params['SHIPTOCITY'] = $order->delivery['city']; - $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['SHIPTOCOUNTRY'] = $order->delivery['country']['iso_code_2']; - $params['SHIPTOZIP'] = $order->delivery['postcode']; - } - - $item_params = array(); - - $line_item_no = 0; - - foreach ($order->products as $product) { - $item_params['L_NAME' . $line_item_no] = $product['name']; - $item_params['L_COST' . $line_item_no] = $this->format_raw($product['final_price']); - $item_params['L_QTY' . $line_item_no] = $product['qty']; - - $line_item_no++; - } - - $items_total = $this->format_raw($order->info['subtotal']); - - foreach ($order_totals as $ot) { - if ( !in_array($ot['code'], array('ot_subtotal', 'ot_shipping', 'ot_tax', 'ot_total')) ) { - $item_params['L_NAME' . $line_item_no] = $ot['title']; - $item_params['L_COST' . $line_item_no] = $this->format_raw($ot['value']); - $item_params['L_QTY' . $line_item_no] = 1; - - $items_total += $this->format_raw($ot['value']); - - $line_item_no++; - } - } - - $item_params['ITEMAMT'] = $items_total; - $item_params['TAXAMT'] = $this->format_raw($order->info['tax']); - $item_params['FREIGHTAMT'] = $this->format_raw($order->info['shipping_cost']); - - if ( $this->format_raw($item_params['ITEMAMT'] + $item_params['TAXAMT'] + $item_params['FREIGHTAMT']) == $params['AMT'] ) { - $params = array_merge($params, $item_params); - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if ($response_array['RESULT'] != '0') { - $this->sendDebugEmail($response_array); - - switch ($response_array['RESULT']) { - case '1': - case '26': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_CFG_ERROR; - break; - - case '7': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ADDRESS; - break; - - case '12': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_DECLINED; - break; - - case '23': - case '24': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_INVALID_CREDIT_CARD; - break; - - default: - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_GENERAL; - break; - } - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . urlencode($error_message), 'SSL')); - } - } else { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'error_message=' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ERROR_ALL_FIELDS_REQUIRED, 'SSL')); - } - } - - function after_process() { - global $insert_id, $response_array; - - $pp_result = 'Payflow ID: ' . tep_output_string_protected($response_array['PNREF']) . "\n" . - 'PayPal ID: ' . tep_output_string_protected($response_array['PPREF']) . "\n" . - 'Response: ' . tep_output_string_protected($response_array['RESPMSG']) . "\n"; - - switch ($response_array['AVSADDR']) { - case 'Y': - $pp_result .= 'AVS Address: Match' . "\n"; - break; - - case 'N': - $pp_result .= 'AVS Address: No Match' . "\n"; - break; - } - - switch ($response_array['AVSZIP']) { - case 'Y': - $pp_result .= 'AVS ZIP: Match' . "\n"; - break; - - case 'N': - $pp_result .= 'AVS ZIP: No Match' . "\n"; - break; - } - - switch ($response_array['IAVS']) { - case 'Y': - $pp_result .= 'IAVS: International' . "\n"; - break; - - case 'N': - $pp_result .= 'IAVS: USA' . "\n"; - break; - } - - switch ($response_array['CVV2MATCH']) { - case 'Y': - $pp_result .= 'CVV2: Match' . "\n"; - break; - - case 'N': - $pp_result .= 'CVV2: No Match' . "\n"; - break; - } - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => trim($pp_result)); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - - function get_error() { - return false; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS' => array('title' => 'Enable PayPal Payments Pro (Payflow Edition)', - 'desc' => 'Do you want to accept PayPal Payments Pro (Payflow Edition) payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR' => array('title' => 'Vendor', - 'desc' => 'Your merchant login ID that you created when you registered for the PayPal Payments Pro account.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME' => array('title' => 'User', - 'desc' => 'If you set up one or more additional users on the account, this value is the ID of the user authorised to process transactions. If, however, you have not set up additional users on the account, USER has the same value as VENDOR.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD' => array('title' => 'Password', - 'desc' => 'The 6- to 32-character password that you defined while registering for the account.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PARTNER' => array('title' => 'Partner', - 'desc' => 'The ID provided to you by the authorised PayPal Reseller who registered you for the Payflow SDK. If you purchased your account directly from PayPal, use PayPalUK.', - 'value' => 'PayPalUK'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Sale', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', - 'desc' => 'Include PayPal transaction information in this order status level.', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_zone_classes(', - 'use_func' => 'tep_get_zone_class_title'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters) { - global $cartID, $order; - - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $request_id = (isset($order) && is_object($order)) ? md5($cartID . tep_session_id() . $this->format_raw($order->info['total'])) : 'oscom_conn_test'; - - $headers = array('X-VPS-REQUEST-ID: ' . $request_id, - 'X-VPS-CLIENT-TIMEOUT: 45', - 'X-VPS-VIT-INTEGRATION-PRODUCT: OSCOM', - 'X-VPS-VIT-INTEGRATION-VERSION: 2.3'); - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://payflowpro.paypal.com'; - } else { - $api_url = 'https://pilot-payflowpro.paypal.com'; - } - - $params = array('USER' => (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR), - 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_VENDOR, - 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PARTNER, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_PASSWORD, - 'TENDER' => 'C', - 'TRXTYPE' => ((MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_METHOD == 'Sale') ? 'S' : 'A')); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if ( is_array($response_array) && isset($response_array['RESULT']) ) { - return 1; - } - - return -1; - } - - function templateClassExists() { - return class_exists('oscTemplate') && isset($GLOBALS['oscTemplate']) && is_object($GLOBALS['oscTemplate']) && (get_class($GLOBALS['oscTemplate']) == 'oscTemplate'); - } - - function getSubmitCardDetailsJavascript() { - $test_visa = ''; - - if ( MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_TRANSACTION_SERVER == 'Sandbox' ) { - $test_visa = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); -} - - - -EOD; - - return $js; - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - if (isset($HTTP_POST_VARS['cc_number_nh-dns'])) { - $HTTP_POST_VARS['cc_number_nh-dns'] = 'XXXX' . substr($HTTP_POST_VARS['cc_number_nh-dns'], -4); - } - - if (isset($HTTP_POST_VARS['cc_cvc_nh-dns'])) { - $HTTP_POST_VARS['cc_cvc_nh-dns'] = 'XXX'; - } - - if (isset($HTTP_POST_VARS['cc_expires_month'])) { - $HTTP_POST_VARS['cc_expires_month'] = 'XX'; - } - - if (isset($HTTP_POST_VARS['cc_expires_year'])) { - $HTTP_POST_VARS['cc_expires_year'] = 'XX'; - } - - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_DEBUG_EMAIL, 'PayPal Payments Pro (Payflow Edition) Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/paypal_pro_payflow_ec.php b/catalog/includes/modules/payment/paypal_pro_payflow_ec.php deleted file mode 100644 index 310246b8b..000000000 --- a/catalog/includes/modules/payment/paypal_pro_payflow_ec.php +++ /dev/null @@ -1,762 +0,0 @@ -signature = 'paypal|paypal_pro_payflow_ec|3.1|2.3'; - - $this->code = 'paypal_pro_payflow_ec'; - $this->title = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS') && (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ORDER_STATUS_ID : 0; - - if ( !defined('MODULE_PAYMENT_INSTALLED') || !tep_not_null(MODULE_PAYMENT_INSTALLED) || !in_array('paypal_pro_payflow_dp.php', explode(';', MODULE_PAYMENT_INSTALLED)) || !defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS') || (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_DP_STATUS != 'True') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_DIRECT_MODULE . '
' . $this->description; - - $this->enabled = false; - } - - if ( defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS') ) { - if ( MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Sandbox' ) { - $this->title .= ' [Sandbox]'; - $this->public_title .= ' (' . $this->code . '; Sandbox)'; - } - - $this->description .= $this->getTestLinkInfo(); - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR) || !tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PASSWORD) ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function checkout_initialization_method() { - $button_title = tep_output_string_protected(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TEXT_BUTTON); - - if ( MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Sandbox' ) { - $button_title .= ' (' . $this->code . '; Sandbox)'; - } - - $string = ''; - - return $string; - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - global $ppeuk_token, $ppeuk_secret, $ppeuk_order_total_check, $messageStack, $order; - - if (!tep_session_is_registered('ppeuk_token')) { - tep_redirect(tep_href_link('ext/modules/payment/paypal/express_payflow.php', '', 'SSL')); - } - - $response_array = $this->getExpressCheckoutDetails($ppeuk_token); - - if ($response_array['RESULT'] != '0') { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode($response_array['OSCOM_ERROR_MESSAGE']), 'SSL')); - } elseif ( !tep_session_is_registered('ppeuk_secret') || ($response_array['CUSTOM'] != $ppeuk_secret) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } - - if (!tep_session_is_registered('ppeuk_order_total_check')) tep_session_register('ppeuk_order_total_check'); - $ppeuk_order_total_check = true; - - $messageStack->add('checkout_confirmation', '' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_NOTICE_CHECKOUT_CONFIRMATION . '', 'paypal'); - - $order->info['payment_method'] = 'PayPal Logo'; - } - - function confirmation() { - global $comments; - - if (!isset($comments)) { - $comments = null; - } - - $confirmation = false; - - if (empty($comments)) { - $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TEXT_COMMENTS, - 'field' => tep_draw_textarea_field('ppecomments', 'soft', '60', '5', $comments)))); - } - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $customer_id, $order, $sendto, $ppeuk_token, $ppeuk_payerid, $ppeuk_secret, $ppeuk_order_total_check, $HTTP_POST_VARS, $comments, $response_array; - - if (!tep_session_is_registered('ppeuk_token')) { - tep_redirect(tep_href_link('ext/modules/payment/paypal/express_payflow.php', '', 'SSL')); - } - - $response_array = $this->getExpressCheckoutDetails($ppeuk_token); - - if ($response_array['RESULT'] == '0') { - if ( !tep_session_is_registered('ppeuk_secret') || ($response_array['CUSTOM'] != $ppeuk_secret) ) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - } elseif ( !tep_session_is_registered('ppeuk_order_total_check') ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL')); - } - } else { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode($response_array['OSCOM_ERROR_MESSAGE']), 'SSL')); - } - - if ( tep_session_is_registered('ppeuk_order_total_check') ) { - tep_session_unregister('ppeuk_order_total_check'); - } - - if (empty($comments)) { - if (isset($HTTP_POST_VARS['ppecomments']) && tep_not_null($HTTP_POST_VARS['ppecomments'])) { - $comments = tep_db_prepare_input($HTTP_POST_VARS['ppecomments']); - - $order->info['comments'] = $comments; - } - } - - $params = array('EMAIL' => $order->customer['email_address'], - 'TOKEN' => $ppeuk_token, - 'PAYERID' => $ppeuk_payerid, - 'AMT' => $this->format_raw($order->info['total']), - 'CURRENCY' => $order->info['currency']); - - if (is_numeric($sendto) && ($sendto > 0)) { - $params['SHIPTONAME'] = $order->delivery['firstname'] . ' ' . $order->delivery['lastname']; - $params['SHIPTOSTREET'] = $order->delivery['street_address']; - $params['SHIPTOCITY'] = $order->delivery['city']; - $params['SHIPTOSTATE'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $params['SHIPTOCOUNTRY'] = $order->delivery['country']['iso_code_2']; - $params['SHIPTOZIP'] = $order->delivery['postcode']; - } - - $response_array = $this->doExpressCheckoutPayment($params); - - if ($response_array['RESULT'] != '0') { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode($response_array['OSCOM_ERROR_MESSAGE']), 'SSL')); - } - } - - function after_process() { - global $response_array, $insert_id, $ppeuk_payerstatus, $ppeuk_addressstatus; - - $pp_result = 'Payflow ID: ' . tep_output_string_protected($response_array['PNREF']) . "\n" . - 'PayPal ID: ' . tep_output_string_protected($response_array['PPREF']) . "\n\n" . - 'Payer Status: ' . tep_output_string_protected($ppeuk_payerstatus) . "\n" . - 'Address Status: ' . tep_output_string_protected($ppeuk_addressstatus) . "\n\n" . - 'Payment Status: ' . tep_output_string_protected($response_array['PENDINGREASON']) . "\n" . - 'Payment Type: ' . tep_output_string_protected($response_array['PAYMENTTYPE']) . "\n" . - 'Response: ' . tep_output_string_protected($response_array['RESPMSG']); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $pp_result); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - - tep_session_unregister('ppeuk_token'); - tep_session_unregister('ppeuk_payerid'); - tep_session_unregister('ppeuk_payerstatus'); - tep_session_unregister('ppeuk_addressstatus'); - tep_session_unregister('ppeuk_secret'); - } - - function get_error() { - return false; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_STATUS' => array('title' => 'Enable PayPal Express Checkout (Payflow Edition)', - 'desc' => 'Do you want to accept PayPal Express Checkout (Payflow Edition) payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR' => array('title' => 'Vendor', - 'desc' => 'Your merchant login ID that you created when you registered for the PayPal Payments Pro account.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME' => array('title' => 'User', - 'desc' => 'If you set up one or more additional users on the account, this value is the ID of the user authorised to process transactions. If, however, you have not set up additional users on the account, USER has the same value as VENDOR.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PASSWORD' => array('title' => 'Password', - 'desc' => 'The 6- to 32-character password that you defined while registering for the account.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PARTNER' => array('title' => 'Partner', - 'desc' => 'The ID provided to you by the authorised PayPal Reseller who registered you for the Payflow SDK. If you purchased your account directly from PayPal, use PayPalUK.', - 'value' => 'PayPalUK'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PAGE_STYLE' => array('title' => 'Page Style', - 'desc' => 'The page style to use for the checkout flow (defined at your PayPal Profile page)'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Sale', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', - 'desc' => 'Include PayPal transaction information in this order status level.', - 'value' => $status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_zone_classes(', - 'use_func' => 'tep_get_zone_class_title'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Use the live or testing (sandbox) gateway server to process transactions?', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters) { - global $cartID, $order; - - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $request_id = (isset($order) && is_object($order)) ? md5($cartID . tep_session_id() . $this->format_raw($order->info['total'])) : 'oscom_conn_test'; - - $headers = array('X-VPS-REQUEST-ID: ' . $request_id, - 'X-VPS-CLIENT-TIMEOUT: 45', - 'X-VPS-VIT-INTEGRATION-PRODUCT: OSCOM', - 'X-VPS-VIT-INTEGRATION-VERSION: 2.3'); - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function setExpressCheckout($parameters) { - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://payflowpro.paypal.com'; - } else { - $api_url = 'https://pilot-payflowpro.paypal.com'; - } - - $params = array('USER' => (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR), - 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR, - 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PARTNER, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PASSWORD, - 'TENDER' => 'P', - 'TRXTYPE' => ((MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_METHOD == 'Sale') ? 'S' : 'A'), - 'ACTION' => 'S', - 'RETURNURL' => tep_href_link('ext/modules/payment/paypal/express_payflow.php', 'osC_Action=retrieve', 'SSL'), - 'CANCELURL' => tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL')); - - if (is_array($parameters) && !empty($parameters)) { - $params = array_merge($params, $parameters); - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if ($response_array['RESULT'] != '0') { - $this->sendDebugEmail($response_array); - - switch ($response_array['RESULT']) { - case '1': - case '26': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_CFG_ERROR; - break; - - case '1000': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_EXPRESS_DISABLED; - break; - - default: - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_GENERAL; - break; - } - - $response_array['OSCOM_ERROR_MESSAGE'] = $error_message; - } - - return $response_array; - } - - function getExpressCheckoutDetails($token) { - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://payflowpro.paypal.com'; - } else { - $api_url = 'https://pilot-payflowpro.paypal.com'; - } - - $params = array('USER' => (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR), - 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR, - 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PARTNER, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PASSWORD, - 'TENDER' => 'P', - 'TRXTYPE' => ((MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_METHOD == 'Sale') ? 'S' : 'A'), - 'ACTION' => 'G', - 'TOKEN' => $token); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if ($response_array['RESULT'] != '0') { - $this->sendDebugEmail($response_array); - - switch ($response_array['RESULT']) { - case '1': - case '26': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_CFG_ERROR; - break; - - case '7': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_ADDRESS; - break; - - case '12': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_DECLINED; - break; - - case '1000': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_EXPRESS_DISABLED; - break; - - default: - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_GENERAL; - break; - } - - $response_array['OSCOM_ERROR_MESSAGE'] = $error_message; - } - - return $response_array; - } - - function doExpressCheckoutPayment($parameters) { - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://payflowpro.paypal.com'; - } else { - $api_url = 'https://pilot-payflowpro.paypal.com'; - } - - $params = array('USER' => (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR), - 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR, - 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PARTNER, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PASSWORD, - 'TENDER' => 'P', - 'TRXTYPE' => ((MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_METHOD == 'Sale') ? 'S' : 'A'), - 'ACTION' => 'D', - 'BUTTONSOURCE' => 'OSCOM23_ECPF'); - - if (is_array($parameters) && !empty($parameters)) { - $params = array_merge($params, $parameters); - } - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - if ($response_array['RESULT'] != '0') { - $this->sendDebugEmail($response_array); - - switch ($response_array['RESULT']) { - case '1': - case '26': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_CFG_ERROR; - break; - - case '7': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_ADDRESS; - break; - - case '12': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_DECLINED; - break; - - case '1000': - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_EXPRESS_DISABLED; - break; - - default: - $error_message = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_ERROR_GENERAL; - break; - } - - $response_array['OSCOM_ERROR_MESSAGE'] = $error_message; - } - - return $response_array; - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DEBUG_EMAIL, 'PayPal Express Checkout (Payflow Edition) Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - if (MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_SERVER == 'Live') { - $api_url = 'https://payflowpro.paypal.com'; - } else { - $api_url = 'https://pilot-payflowpro.paypal.com'; - } - - $params = array('USER' => (tep_not_null(MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME) ? MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_USERNAME : MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR), - 'VENDOR' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_VENDOR, - 'PARTNER' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PARTNER, - 'PWD' => MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_PASSWORD, - 'TENDER' => 'P', - 'TRXTYPE' => ((MODULE_PAYMENT_PAYPAL_PRO_PAYFLOW_EC_TRANSACTION_METHOD == 'Sale') ? 'S' : 'A')); - - $post_string = ''; - - foreach ($params as $key => $value) { - $post_string .= $key . '[' . strlen(trim($value)) . ']=' . trim($value) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $response = $this->sendTransactionToGateway($api_url, $post_string); - - $response_array = array(); - parse_str($response, $response_array); - - return isset($response_array['RESULT']) ? 1 : -1; - } - } -?> diff --git a/catalog/includes/modules/payment/paypal_standard.php b/catalog/includes/modules/payment/paypal_standard.php deleted file mode 100755 index 98f14dc58..000000000 --- a/catalog/includes/modules/payment/paypal_standard.php +++ /dev/null @@ -1,1110 +0,0 @@ -signature = 'paypal|paypal_standard|3.2|2.3'; - - $this->code = 'paypal_standard'; - $this->title = MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_PAYPAL_STANDARD_SORT_ORDER') ? MODULE_PAYMENT_PAYPAL_STANDARD_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_PAYPAL_STANDARD_STATUS') && (MODULE_PAYMENT_PAYPAL_STANDARD_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_PAYPAL_STANDARD_STATUS') ) { - if ( MODULE_PAYMENT_PAYPAL_STANDARD_GATEWAY_SERVER == 'Sandbox' ) { - $this->title .= ' [Sandbox]'; - $this->public_title .= ' (' . $this->code . '; Sandbox)'; - } - - $this->description .= $this->getTestLinkInfo(); - - if ( MODULE_PAYMENT_PAYPAL_STANDARD_GATEWAY_SERVER == 'Live' ) { - $this->form_action_url = 'https://www.paypal.com/cgi-bin/webscr'; - } else { - $this->form_action_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; - } - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_STANDARD_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_ID) ) { - $this->description = '
' . MODULE_PAYMENT_PAYPAL_STANDARD_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPAL_STANDARD_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPAL_STANDARD_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - global $cart_PayPal_Standard_ID; - - if (tep_session_is_registered('cart_PayPal_Standard_ID')) { - $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1); - - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - - tep_session_unregister('cart_PayPal_Standard_ID'); - } - } - - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - global $cartID, $cart, $order; - - if (empty($cart->cartID)) { - $cartID = $cart->cartID = $cart->generate_cart_id(); - } - - if (!tep_session_is_registered('cartID')) { - tep_session_register('cartID'); - } - - $order->info['payment_method_raw'] = $order->info['payment_method']; - $order->info['payment_method'] = 'PayPal Logo'; - } - - function confirmation() { - global $cartID, $cart_PayPal_Standard_ID, $customer_id, $languages_id, $order, $order_total_modules; - - if (tep_session_is_registered('cartID')) { - $insert_order = false; - - if (tep_session_is_registered('cart_PayPal_Standard_ID')) { - $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1); - - $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); - $curr = tep_db_fetch_array($curr_check); - - if ( ($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_PayPal_Standard_ID, 0, strlen($cartID))) ) { - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - } - - $insert_order = true; - } - } else { - $insert_order = true; - } - - if ($insert_order == true) { - $order_totals = array(); - if (is_array($order_total_modules->modules)) { - foreach ($order_total_modules->modules as $value) { - $class = substr($value, 0, strrpos($value, '.')); - if ($GLOBALS[$class]->enabled) { - for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { - if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { - $order_totals[] = array('code' => $GLOBALS[$class]->code, - 'title' => $GLOBALS[$class]->output[$i]['title'], - 'text' => $GLOBALS[$class]->output[$i]['text'], - 'value' => $GLOBALS[$class]->output[$i]['value'], - 'sort_order' => $GLOBALS[$class]->sort_order); - } - } - } - } - } - - if ( isset($order->info['payment_method_raw']) ) { - $order->info['payment_method'] = $order->info['payment_method_raw']; - unset($order->info['payment_method_raw']); - } - - $sql_data_array = array('customers_id' => $customer_id, - 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], - 'customers_company' => $order->customer['company'], - 'customers_street_address' => $order->customer['street_address'], - 'customers_suburb' => $order->customer['suburb'], - 'customers_city' => $order->customer['city'], - 'customers_postcode' => $order->customer['postcode'], - 'customers_state' => $order->customer['state'], - 'customers_country' => $order->customer['country']['title'], - 'customers_telephone' => $order->customer['telephone'], - 'customers_email_address' => $order->customer['email_address'], - 'customers_address_format_id' => $order->customer['format_id'], - 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], - 'delivery_company' => $order->delivery['company'], - 'delivery_street_address' => $order->delivery['street_address'], - 'delivery_suburb' => $order->delivery['suburb'], - 'delivery_city' => $order->delivery['city'], - 'delivery_postcode' => $order->delivery['postcode'], - 'delivery_state' => $order->delivery['state'], - 'delivery_country' => $order->delivery['country']['title'], - 'delivery_address_format_id' => $order->delivery['format_id'], - 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], - 'billing_company' => $order->billing['company'], - 'billing_street_address' => $order->billing['street_address'], - 'billing_suburb' => $order->billing['suburb'], - 'billing_city' => $order->billing['city'], - 'billing_postcode' => $order->billing['postcode'], - 'billing_state' => $order->billing['state'], - 'billing_country' => $order->billing['country']['title'], - 'billing_address_format_id' => $order->billing['format_id'], - 'payment_method' => $order->info['payment_method'], - 'cc_type' => $order->info['cc_type'], - 'cc_owner' => $order->info['cc_owner'], - 'cc_number' => $order->info['cc_number'], - 'cc_expires' => $order->info['cc_expires'], - 'date_purchased' => 'now()', - 'orders_status' => $order->info['order_status'], - 'currency' => $order->info['currency'], - 'currency_value' => $order->info['currency_value']); - - tep_db_perform(TABLE_ORDERS, $sql_data_array); - - $insert_id = tep_db_insert_id(); - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'title' => $order_totals[$i]['title'], - 'text' => $order_totals[$i]['text'], - 'value' => $order_totals[$i]['value'], - 'class' => $order_totals[$i]['code'], - 'sort_order' => $order_totals[$i]['sort_order']); - - tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); - } - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'products_id' => tep_get_prid($order->products[$i]['id']), - 'products_model' => $order->products[$i]['model'], - 'products_name' => $order->products[$i]['name'], - 'products_price' => $order->products[$i]['price'], - 'final_price' => $order->products[$i]['final_price'], - 'products_tax' => $order->products[$i]['tax'], - 'products_quantity' => $order->products[$i]['qty']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); - - $order_products_id = tep_db_insert_id(); - - $attributes_exist = '0'; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'products_options' => $attributes_values['products_options_name'], - 'products_options_values' => $attributes_values['products_options_values_name'], - 'options_values_price' => $attributes_values['options_values_price'], - 'price_prefix' => $attributes_values['price_prefix']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); - - if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'orders_products_filename' => $attributes_values['products_attributes_filename'], - 'download_maxdays' => $attributes_values['products_attributes_maxdays'], - 'download_count' => $attributes_values['products_attributes_maxcount']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); - } - } - } - } - - $cart_PayPal_Standard_ID = $cartID . '-' . $insert_id; - tep_session_register('cart_PayPal_Standard_ID'); - } - } - - return false; - } - - function process_button() { - global $customer_id, $order, $sendto, $currency, $cart_PayPal_Standard_ID, $shipping, $order_total_modules; - - $total_tax = $order->info['tax']; - -// remove shipping tax in total tax value - if ( isset($shipping['cost']) ) { - $total_tax -= ($order->info['shipping_cost'] - $shipping['cost']); - } - - $process_button_string = ''; - $parameters = array('cmd' => '_cart', - 'upload' => '1', - 'item_name_1' => STORE_NAME, - 'shipping_1' => $this->format_raw($order->info['shipping_cost']), - 'business' => MODULE_PAYMENT_PAYPAL_STANDARD_ID, - 'amount_1' => $this->format_raw($order->info['total'] - $order->info['shipping_cost'] - $total_tax), - 'currency_code' => $currency, - 'invoice' => substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1), - 'custom' => $customer_id, - 'no_note' => '1', - 'notify_url' => tep_href_link('ext/modules/payment/paypal/standard_ipn.php', '', 'SSL', false, false), - 'rm' => '2', - 'return' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'), - 'cancel_return' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), - 'bn' => 'OSCOM23_PS', - 'paymentaction' => ((MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTION_METHOD == 'Sale') ? 'sale' : 'authorization')); - - if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_PAYPAL_RETURN_BUTTON') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_PAYPAL_RETURN_BUTTON) && (strlen(MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_PAYPAL_RETURN_BUTTON) <= 60)) { - $parameters['cbt'] = MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_PAYPAL_RETURN_BUTTON; - } - - if (is_numeric($sendto) && ($sendto > 0)) { - $parameters['address_override'] = '1'; - $parameters['first_name'] = $order->delivery['firstname']; - $parameters['last_name'] = $order->delivery['lastname']; - $parameters['address1'] = $order->delivery['street_address']; - $parameters['city'] = $order->delivery['city']; - $parameters['state'] = tep_get_zone_code($order->delivery['country']['id'], $order->delivery['zone_id'], $order->delivery['state']); - $parameters['zip'] = $order->delivery['postcode']; - $parameters['country'] = $order->delivery['country']['iso_code_2']; - } else { - $parameters['no_shipping'] = '1'; - $parameters['first_name'] = $order->billing['firstname']; - $parameters['last_name'] = $order->billing['lastname']; - $parameters['address1'] = $order->billing['street_address']; - $parameters['city'] = $order->billing['city']; - $parameters['state'] = tep_get_zone_code($order->billing['country']['id'], $order->billing['zone_id'], $order->billing['state']); - $parameters['zip'] = $order->billing['postcode']; - $parameters['country'] = $order->billing['country']['iso_code_2']; - } - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PAGE_STYLE)) { - $parameters['page_style'] = MODULE_PAYMENT_PAYPAL_STANDARD_PAGE_STYLE; - } - - $item_params = array(); - - $line_item_no = 1; - - foreach ($order->products as $product) { - if ( DISPLAY_PRICE_WITH_TAX == 'true' ) { - $product_price = $this->format_raw($product['final_price'] + tep_calculate_tax($product['final_price'], $product['tax'])); - } else { - $product_price = $this->format_raw($product['final_price']); - } - - $item_params['item_name_' . $line_item_no] = $product['name']; - $item_params['amount_' . $line_item_no] = $product_price; - $item_params['quantity_' . $line_item_no] = $product['qty']; - - $line_item_no++; - } - - $items_total = $this->format_raw($order->info['subtotal']); - - $has_negative_price = false; - -// order totals are processed on checkout confirmation but not captured into a variable - if (is_array($order_total_modules->modules)) { - foreach ($order_total_modules->modules as $value) { - $class = substr($value, 0, strrpos($value, '.')); - - if ($GLOBALS[$class]->enabled) { - for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { - if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { - if ( !in_array($GLOBALS[$class]->code, array('ot_subtotal', 'ot_shipping', 'ot_tax', 'ot_total')) ) { - $item_params['item_name_' . $line_item_no] = $GLOBALS[$class]->output[$i]['title']; - $item_params['amount_' . $line_item_no] = $this->format_raw($GLOBALS[$class]->output[$i]['value']); - - $items_total += $item_params['amount_' . $line_item_no]; - - if ( $item_params['amount_' . $line_item_no] < 0 ) { - $has_negative_price = true; - } - - $line_item_no++; - } - } - } - } - } - } - - $paypal_item_total = $items_total + $parameters['shipping_1']; - - if ( DISPLAY_PRICE_WITH_TAX == 'false' ) { - $item_params['tax_cart'] = $this->format_raw($total_tax); - - $paypal_item_total += $item_params['tax_cart']; - } - - if ( ($has_negative_price == false) && ($this->format_raw($paypal_item_total) == $this->format_raw($order->info['total'])) ) { - $parameters = array_merge($parameters, $item_params); - } else { - $parameters['tax_cart'] = $this->format_raw($total_tax); - } - - if (MODULE_PAYMENT_PAYPAL_STANDARD_EWP_STATUS == 'True') { - $parameters['cert_id'] = MODULE_PAYMENT_PAYPAL_STANDARD_EWP_CERT_ID; - - $random_string = rand(100000, 999999) . '-' . $customer_id . '-'; - - $data = ''; - foreach ($parameters as $key => $value) { - $data .= $key . '=' . $value . "\n"; - } - - $fp = fopen(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt', 'w'); - fwrite($fp, $data); - fclose($fp); - - unset($data); - - if (function_exists('openssl_pkcs7_sign') && function_exists('openssl_pkcs7_encrypt')) { - openssl_pkcs7_sign(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt', MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt', file_get_contents(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PUBLIC_KEY), file_get_contents(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PRIVATE_KEY), array('From' => MODULE_PAYMENT_PAYPAL_STANDARD_ID), PKCS7_BINARY); - - unlink(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt'); - -// remove headers from the signature - $signed = file_get_contents(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt'); - $signed = explode("\n\n", $signed); - $signed = base64_decode($signed[1]); - - $fp = fopen(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt', 'w'); - fwrite($fp, $signed); - fclose($fp); - - unset($signed); - - openssl_pkcs7_encrypt(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt', MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt', file_get_contents(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PAYPAL_KEY), array('From' => MODULE_PAYMENT_PAYPAL_STANDARD_ID), PKCS7_BINARY); - - unlink(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt'); - -// remove headers from the encrypted result - $data = file_get_contents(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt'); - $data = explode("\n\n", $data); - $data = '-----BEGIN PKCS7-----' . "\n" . $data[1] . "\n" . '-----END PKCS7-----'; - - unlink(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt'); - } else { - exec(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_OPENSSL . ' smime -sign -in ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt -signer ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PUBLIC_KEY . ' -inkey ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PRIVATE_KEY . ' -outform der -nodetach -binary > ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt'); - unlink(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'data.txt'); - - exec(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_OPENSSL . ' smime -encrypt -des3 -binary -outform pem ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PAYPAL_KEY . ' < ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt > ' . MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt'); - unlink(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'signed.txt'); - - $fh = fopen(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt', 'rb'); - $data = fread($fh, filesize(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt')); - fclose($fh); - - unlink(MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY . '/' . $random_string . 'encrypted.txt'); - } - - $process_button_string = tep_draw_hidden_field('cmd', '_s-xclick') . - tep_draw_hidden_field('encrypted', $data); - - unset($data); - } else { - foreach ($parameters as $key => $value) { - $process_button_string .= tep_draw_hidden_field($key, $value); - } - } - - return $process_button_string; - } - - function before_process() { - global $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_PayPal_Standard_ID, $$payment, $HTTP_GET_VARS, $HTTP_POST_VARS, $messageStack; - - $result = false; - - if ( isset($HTTP_POST_VARS['receiver_email']) && (($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_ID) || (defined('MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID') && tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID) && ($HTTP_POST_VARS['receiver_email'] == MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID))) ) { - $parameters = 'cmd=_notify-validate'; - - foreach ($HTTP_POST_VARS as $key => $value) { - $parameters .= '&' . $key . '=' . urlencode(stripslashes($value)); - } - - $result = $this->sendTransactionToGateway($this->form_action_url, $parameters); - } - - if ($result != 'VERIFIED') { - if (defined('MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION')) { - $messageStack->add_session('header', MODULE_PAYMENT_PAYPAL_STANDARD_TEXT_INVALID_TRANSACTION); - } - - $this->sendDebugEmail($result); - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - $this->verifyTransaction(); - - $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1); - - $check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "' and customers_id = '" . (int)$customer_id . "'"); - - if (!tep_db_num_rows($check_query) || ($order_id != $HTTP_POST_VARS['invoice']) || ($customer_id != $HTTP_POST_VARS['custom'])) { - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - $check = tep_db_fetch_array($check_query); - - $new_order_status = DEFAULT_ORDERS_STATUS_ID; - - if ( $check['orders_status'] != MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID ) { - $new_order_status = $check['orders_status']; - } - - if ( (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0) && ($check['orders_status'] == MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID) ) { - $new_order_status = MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID; - } - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (int)$new_order_status . "', last_modified = now() where orders_id = '" . (int)$order_id . "'"); - - $sql_data_array = array('orders_id' => $order_id, - 'orders_status_id' => (int)$new_order_status, - 'date_added' => 'now()', - 'customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0', - 'comments' => $order->info['comments']); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - -// initialized for the email confirmation - $products_ordered = ''; - $subtotal = 0; - $total_tax = 0; - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { -// Stock Update - Joao Correia - if (STOCK_LIMITED == 'true') { - if (DOWNLOAD_ENABLED == 'true') { - $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename - FROM " . TABLE_PRODUCTS . " p - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa - ON p.products_id=pa.products_id - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - ON pa.products_attributes_id=pad.products_attributes_id - WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; -// Will work with only one option for downloadable products -// otherwise, we have to build the query dynamically with a loop - $products_attributes = $order->products[$i]['attributes']; - if (is_array($products_attributes)) { - $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; - } - $stock_query = tep_db_query($stock_query_raw); - } else { - $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - if (tep_db_num_rows($stock_query) > 0) { - $stock_values = tep_db_fetch_array($stock_query); -// do not decrement quantities if products_attributes_filename exists - if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { - $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; - } else { - $stock_left = $stock_values['products_quantity']; - } - tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { - tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - } - } - -// Update products_ordered (for bestsellers list) - tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - -//------insert customer choosen option to order-------- - $attributes_exist = '0'; - $products_ordered_attributes = ''; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; - } - } -//------insert customer choosen option eof ---- - $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); - $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; - $total_cost += $total_products_price; - - $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; - } - -// lets start with the email confirmation - $email_order = STORE_NAME . "\n" . - EMAIL_SEPARATOR . "\n" . - EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . - EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . - EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; - if ($order->info['comments']) { - $email_order .= tep_db_output($order->info['comments']) . "\n\n"; - } - $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . - EMAIL_SEPARATOR . "\n" . - $products_ordered . - EMAIL_SEPARATOR . "\n"; - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; - } - - if ($order->content_type != 'virtual') { - $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; - } - - $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; - - if (is_object($$payment)) { - $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . - EMAIL_SEPARATOR . "\n"; - $payment_class = $$payment; - $email_order .= $payment_class->title . "\n\n"; - if ($payment_class->email_footer) { - $email_order .= $payment_class->email_footer . "\n\n"; - } - } - - tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - -// send emails to other people - if (SEND_EXTRA_ORDER_EMAILS_TO != '') { - tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - -// load the after_process function from the payment modules - $this->after_process(); - - $cart->reset(true); - -// unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); - - tep_session_unregister('cart_PayPal_Standard_ID'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); - } - - function after_process() { - return false; - } - - function get_error() { - return false; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STANDARD_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [PayPal Standard]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [PayPal Standard]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID; - } - - if (!defined('MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'PayPal [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $tx_status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $tx_status_id . "', '" . $lang['id'] . "', 'PayPal [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $tx_status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $tx_status_id = $check['orders_status_id']; - } - } else { - $tx_status_id = MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_PAYPAL_STANDARD_STATUS' => array('title' => 'Enable PayPal Payments Standard', - 'desc' => 'Do you want to accept PayPal Payments Standard payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_STANDARD_ID' => array('title' => 'Seller E-Mail Address', - 'desc' => 'The PayPal seller e-mail address to accept payments for'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_PRIMARY_ID' => array('title' => 'Primary E-Mail Address', - 'desc' => 'The primary PayPal seller e-mail address to validate IPN with (leave empty if it is the same as the Seller E-Mail Address)'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_PAGE_STYLE' => array('title' => 'Page Style', - 'desc' => 'The page style to use for the transaction procedure (defined at your PayPal Profile page)'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Sale', - 'set_func' => 'tep_cfg_select_option(array(\'Authorization\', \'Sale\'), '), - 'MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID' => array('title' => 'Set Preparing Order Status', - 'desc' => 'Set the status of prepared orders made with this payment module to this value', - 'value' => $status_id, - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID' => array('title' => 'Set PayPal Acknowledged Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'PayPal Transactions Order Status Level', - 'desc' => 'Include PayPal transaction information in this order status level.', - 'value' => $tx_status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_PAYPAL_STANDARD_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'use_func' => 'tep_get_zone_class_title', - 'set_func' => 'tep_cfg_pull_down_zone_classes('), - 'MODULE_PAYMENT_PAYPAL_STANDARD_GATEWAY_SERVER' => array('title' => 'Gateway Server', - 'desc' => 'Use the testing (sandbox) or live gateway server for transactions?', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Sandbox\'), '), - 'MODULE_PAYMENT_PAYPAL_STANDARD_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_STANDARD_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an Invalid IPN notification will be sent to this email address if one is entered.'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_STATUS' => array('title' => 'Enable Encrypted Website Payments', - 'desc' => 'Do you want to enable Encrypted Website Payments?', - 'value' => 'False', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PRIVATE_KEY' => array('title' => 'Your Private Key', - 'desc' => 'The location of your Private Key to use for signing the data. (*.pem)'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PUBLIC_KEY' => array('title' => 'Your Public Certificate', - 'desc' => 'The location of your Public Certificate to use for signing the data. (*.pem)'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_PAYPAL_KEY' => array('title' => 'PayPals Public Certificate', - 'desc' => 'The location of the PayPal Public Certificate for encrypting the data.'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_CERT_ID' => array('title' => 'Your PayPal Public Certificate ID', - 'desc' => 'The Certificate ID to use from your PayPal Encrypted Payment Settings Profile.'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_WORKING_DIRECTORY' => array('title' => 'Working Directory', - 'desc' => 'The working directory to use for temporary files. (trailing slash needed)'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_EWP_OPENSSL' => array('title' => 'OpenSSL Location', - 'desc' => 'The location of the openssl binary file.', - 'value' => '/usr/bin/openssl'), - 'MODULE_PAYMENT_PAYPAL_STANDARD_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters) { - $server = parse_url($url); - - if ( !isset($server['port']) ) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if ( !isset($server['path']) ) { - $server['path'] = '/'; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - - if ( MODULE_PAYMENT_PAYPAL_STANDARD_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/paypal/paypal.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_STANDARD_PROXY); - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function sendDebugEmail($response = '', $ipn = false) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_PAYPAL_STANDARD_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_PAYPAL_STANDARD_DEBUG_EMAIL, 'PayPal Standard Debug E-Mail' . ($ipn == true ? ' (IPN)' : ''), trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_PAYPAL_STANDARD_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - $parameters = 'cmd=_notify-validate&business=' . urlencode(MODULE_PAYMENT_PAYPAL_STANDARD_ID); - - $result = $this->sendTransactionToGateway($this->form_action_url, $parameters); - - if ( $result == 'INVALID' ) { - return 1; - } - - return -1; - } - - function verifyTransaction($is_ipn = false) { - global $HTTP_POST_VARS, $currencies; - - if ( isset($HTTP_POST_VARS['invoice']) && is_numeric($HTTP_POST_VARS['invoice']) && ($HTTP_POST_VARS['invoice'] > 0) && isset($HTTP_POST_VARS['custom']) && is_numeric($HTTP_POST_VARS['custom']) && ($HTTP_POST_VARS['custom'] > 0) ) { - $order_query = tep_db_query("select orders_id, orders_status, currency, currency_value from " . TABLE_ORDERS . " where orders_id = '" . (int)$HTTP_POST_VARS['invoice'] . "' and customers_id = '" . (int)$HTTP_POST_VARS['custom'] . "'"); - - if ( tep_db_num_rows($order_query) === 1 ) { - $order = tep_db_fetch_array($order_query); - - $new_order_status = DEFAULT_ORDERS_STATUS_ID; - - if ( $order['orders_status'] != MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID) { - $new_order_status = $order['orders_status']; - } - - $total_query = tep_db_query("select value from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order['orders_id'] . "' and class = 'ot_total' limit 1"); - $total = tep_db_fetch_array($total_query); - - $comment_status = 'Transaction ID: ' . $HTTP_POST_VARS['txn_id'] . '; ' . - $HTTP_POST_VARS['payment_status'] . ' (' . ucfirst($HTTP_POST_VARS['payer_status']) . '; ' . $currencies->format($HTTP_POST_VARS['mc_gross'], false, $HTTP_POST_VARS['mc_currency']) . ')'; - - if ( $HTTP_POST_VARS['payment_status'] == 'Pending' ) { - $comment_status .= '; ' . $HTTP_POST_VARS['pending_reason']; - } elseif ( ($HTTP_POST_VARS['payment_status'] == 'Reversed') || ($HTTP_POST_VARS['payment_status'] == 'Refunded') ) { - $comment_status .= '; ' . $HTTP_POST_VARS['reason_code']; - } - - if ( $HTTP_POST_VARS['mc_gross'] != number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency'])) ) { - $comment_status .= '; PayPal transaction value (' . $HTTP_POST_VARS['mc_gross'] . ') does not match order value (' . number_format($total['value'] * $order['currency_value'], $currencies->get_decimal_places($order['currency'])) . ')'; - } elseif ($HTTP_POST_VARS['payment_status'] == 'Completed') { - $new_order_status = (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID > 0 ? MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID : $new_order_status); - } - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (int)$new_order_status . "', last_modified = now() where orders_id = '" . (int)$order['orders_id'] . "'"); - - if ( $is_ipn === true ) { - $source = 'PayPal IPN Verified'; - } else { - $source = 'PayPal Verified'; - } - - $sql_data_array = array('orders_id' => (int)$order['orders_id'], - 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $source . ' [' . tep_output_string_protected($comment_status) . ']'); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/paypoint_secpay.php b/catalog/includes/modules/payment/paypoint_secpay.php deleted file mode 100644 index 85760d541..000000000 --- a/catalog/includes/modules/payment/paypoint_secpay.php +++ /dev/null @@ -1,209 +0,0 @@ -signature = 'paypoint|paypoint_secpay|1.0|2.3'; - - $this->code = 'paypoint_secpay'; - $this->title = MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_DESCRIPTION; - $this->sort_order = MODULE_PAYMENT_PAYPOINT_SECPAY_SORT_ORDER; - $this->enabled = ((MODULE_PAYMENT_PAYPOINT_SECPAY_STATUS == 'True') ? true : false); - - if ((int)MODULE_PAYMENT_PAYPOINT_SECPAY_ORDER_STATUS_ID > 0) { - $this->order_status = MODULE_PAYMENT_PAYPOINT_SECPAY_ORDER_STATUS_ID; - } - - if (is_object($order)) $this->update_status(); - - $this->form_action_url = 'https://www.secpay.com/java-bin/ValCard'; - } - -// class methods - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PAYPOINT_SECPAY_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PAYPOINT_SECPAY_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - return false; - } - - function confirmation() { - return false; - } - - function process_button() { - global $order, $currencies, $currency; - - switch (MODULE_PAYMENT_PAYPOINT_SECPAY_CURRENCY) { - case 'Default Currency': - $sec_currency = DEFAULT_CURRENCY; - break; - case 'Any Currency': - default: - $sec_currency = $currency; - break; - } - - switch (MODULE_PAYMENT_PAYPOINT_SECPAY_TEST_STATUS) { - case 'Always Fail': - $test_status = 'false'; - break; - case 'Production': - $test_status = 'live'; - break; - case 'Always Successful': - default: - $test_status = 'true'; - break; - } - -// Calculate the digest to send to SECPAY - - $digest_string = STORE_NAME . date('Ymdhis') . number_format($order->info['total'] * $currencies->get_value($sec_currency), $currencies->currencies[$sec_currency]['decimal_places'], '.', '') . MODULE_PAYMENT_PAYPOINT_SECPAY_REMOTE; - -// There is a bug in the digest code, if there are any spaces in the trans id ( usually in the STORE_NAME -// SECPay will replace these with an _ and the hash is calculated of that so need to do a search and replace -// in the digest_string for spaces and replace with _ - $digest_string = str_replace(' ', '_', $digest_string); - - $digest = md5($digest_string); - -// Incase this gets 'fixed' at the SECPay end do a search and replace on the trans_id too - $trans_id_string = STORE_NAME . date('Ymdhis'); - $trans_id = str_replace(' ', '_', $trans_id_string); - - $process_button_string = tep_draw_hidden_field('merchant', MODULE_PAYMENT_PAYPOINT_SECPAY_MERCHANT_ID) . - tep_draw_hidden_field('trans_id', $trans_id) . - tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->get_value($sec_currency), $currencies->currencies[$sec_currency]['decimal_places'], '.', '')) . - tep_draw_hidden_field('bill_name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . - tep_draw_hidden_field('bill_addr_1', $order->billing['street_address']) . - tep_draw_hidden_field('bill_addr_2', $order->billing['suburb']) . - tep_draw_hidden_field('bill_city', $order->billing['city']) . - tep_draw_hidden_field('bill_state', $order->billing['state']) . - tep_draw_hidden_field('bill_post_code', $order->billing['postcode']) . - tep_draw_hidden_field('bill_country', $order->billing['country']['title']) . - tep_draw_hidden_field('bill_tel', $order->customer['telephone']) . - tep_draw_hidden_field('bill_email', $order->customer['email_address']) . - tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) . - tep_draw_hidden_field('ship_addr_1', $order->delivery['street_address']) . - tep_draw_hidden_field('ship_addr_2', $order->delivery['suburb']) . - tep_draw_hidden_field('ship_city', $order->delivery['city']) . - tep_draw_hidden_field('ship_state', $order->delivery['state']) . - tep_draw_hidden_field('ship_post_code', $order->delivery['postcode']) . - tep_draw_hidden_field('ship_country', $order->delivery['country']['title']) . - tep_draw_hidden_field('currency', $sec_currency) . - tep_draw_hidden_field('callback', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . ';' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL', false)) . - tep_draw_hidden_field(tep_session_name(), tep_session_id()) . - tep_draw_hidden_field('options', 'test_status=' . $test_status . ',dups=false,cb_flds=' . tep_session_name()) . - tep_draw_hidden_field('digest', $digest); - - return $process_button_string; - } - - function before_process() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS; - - if ( ($HTTP_GET_VARS['valid'] == 'true') && ($HTTP_GET_VARS['code'] == 'A') && !empty($HTTP_GET_VARS['auth_code']) && empty($HTTP_GET_VARS['resp_code']) && !empty($HTTP_GET_VARS[tep_session_name()]) ) { - $DIGEST_PASSWORD = MODULE_PAYMENT_PAYPOINT_SECPAY_READERS_DIGEST; - list($REQUEST_URI, $CHECK_SUM) = split('hash=', $HTTP_SERVER_VARS['REQUEST_URI']); - - if ($HTTP_GET_VARS['hash'] != md5($REQUEST_URI . $DIGEST_PASSWORD)) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()] . '&payment_error=' . $this->code ."&detail=hash", 'SSL', false, false)); - } - } else { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_GET_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false)); - } - } - - function after_process() { - return false; - } - - function get_error() { - global $HTTP_GET_VARS; - - if ($HTTP_GET_VARS['code'] == 'N') { - $error = MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_ERROR_MESSAGE_N; - } elseif ($HTTP_GET_VARS['code'] == 'C') { - $error = MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_ERROR_MESSAGE_C; - } else { - $error = MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_ERROR_MESSAGE; - } - - return array('title' => MODULE_PAYMENT_PAYPOINT_SECPAY_TEXT_ERROR, - 'error' => $error); - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPOINT_SECPAY_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PayPoint.net SECPay Module', 'MODULE_PAYMENT_PAYPOINT_SECPAY_STATUS', 'False', 'Do you want to accept PayPoint.net SECPay payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_PAYPOINT_SECPAY_MERCHANT_ID', 'secpay', 'Merchant ID to use for the SECPay service', '6', '2', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYPOINT_SECPAY_CURRENCY', 'Any Currency', 'The currency to use for credit card transactions', '6', '3', 'tep_cfg_select_option(array(\'Any Currency\', \'Default Currency\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PAYPOINT_SECPAY_TEST_STATUS', 'Always Successful', 'Transaction mode to use for the PayPoint.net SECPay service', '6', '4', 'tep_cfg_select_option(array(\'Always Successful\', \'Always Fail\', \'Production\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPOINT_SECPAY_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PAYPOINT_SECPAY_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPOINT_SECPAY_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Remote Password', 'MODULE_PAYMENT_PAYPOINT_SECPAY_REMOTE', 'secpay', 'The Remote Password needs to be created in the PayPoint extranet.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Digest Key', 'MODULE_PAYMENT_PAYPOINT_SECPAY_READERS_DIGEST', 'secpay', 'The Digest Key needs to be created in the PayPoint extranet.', '6', '0', now())"); - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_PAYMENT_PAYPOINT_SECPAY_STATUS', 'MODULE_PAYMENT_PAYPOINT_SECPAY_MERCHANT_ID', 'MODULE_PAYMENT_PAYPOINT_SECPAY_REMOTE', 'MODULE_PAYMENT_PAYPOINT_SECPAY_READERS_DIGEST', 'MODULE_PAYMENT_PAYPOINT_SECPAY_CURRENCY', 'MODULE_PAYMENT_PAYPOINT_SECPAY_TEST_STATUS', 'MODULE_PAYMENT_PAYPOINT_SECPAY_ZONE', 'MODULE_PAYMENT_PAYPOINT_SECPAY_ORDER_STATUS_ID', 'MODULE_PAYMENT_PAYPOINT_SECPAY_SORT_ORDER'); - } - } -?> diff --git a/catalog/includes/modules/payment/pm2checkout.php b/catalog/includes/modules/payment/pm2checkout.php deleted file mode 100644 index cdd27e35b..000000000 --- a/catalog/includes/modules/payment/pm2checkout.php +++ /dev/null @@ -1,233 +0,0 @@ -signature = '2checkout|pm2checkout|1.2|2.2'; - - $this->code = 'pm2checkout'; - $this->title = MODULE_PAYMENT_2CHECKOUT_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_2CHECKOUT_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_2CHECKOUT_TEXT_DESCRIPTION; - $this->sort_order = MODULE_PAYMENT_2CHECKOUT_SORT_ORDER; - $this->enabled = ((MODULE_PAYMENT_2CHECKOUT_STATUS == 'True') ? true : false); - - if ((int)MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID > 0) { - $this->order_status = MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID; - } - - if (is_object($order)) $this->update_status(); - - $this->form_action_url = 'https://www.2checkout.com/2co/buyer/purchase'; - } - -// class methods - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_2CHECKOUT_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_2CHECKOUT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - return array('id' => $this->code, - 'module' => $this->public_title . (strlen(MODULE_PAYMENT_2CHECKOUT_TEXT_PUBLIC_DESCRIPTION) > 0 ? ' (' . MODULE_PAYMENT_2CHECKOUT_TEXT_PUBLIC_DESCRIPTION . ')' : '')); - } - - function pre_confirmation_check() { - if (MODULE_PAYMENT_2CHECKOUT_ROUTINE == 'Single-Page') { - $this->form_action_url = 'https://www.2checkout.com/checkout/spurchase'; - } - } - - function confirmation() { - return false; - } - - function process_button() { - global $HTTP_POST_VARS, $customer_id, $currencies, $currency, $order, $languages_id, $cartID; - - $process_button_string = tep_draw_hidden_field('sid', MODULE_PAYMENT_2CHECKOUT_LOGIN) . - tep_draw_hidden_field('total', $this->format_raw($order->info['total'], MODULE_PAYMENT_2CHECKOUT_CURRENCY)) . - tep_draw_hidden_field('cart_order_id', date('YmdHis') . '-' . $customer_id . '-' . $cartID) . - tep_draw_hidden_field('fixed', 'Y') . - tep_draw_hidden_field('first_name', $order->billing['firstname']) . - tep_draw_hidden_field('last_name', $order->billing['lastname']) . - tep_draw_hidden_field('street_address', $order->billing['street_address']) . - tep_draw_hidden_field('city', $order->billing['city']) . - tep_draw_hidden_field('state', $order->billing['state']) . - tep_draw_hidden_field('zip', $order->billing['postcode']) . - tep_draw_hidden_field('country', $order->billing['country']['title']) . - tep_draw_hidden_field('email', $order->customer['email_address']) . - tep_draw_hidden_field('phone', $order->customer['telephone']) . - tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) . - tep_draw_hidden_field('ship_street_address', $order->delivery['street_address']) . - tep_draw_hidden_field('ship_city', $order->delivery['city']) . - tep_draw_hidden_field('ship_state', $order->delivery['state']) . - tep_draw_hidden_field('ship_zip', $order->delivery['postcode']) . - tep_draw_hidden_field('ship_country', $order->delivery['country']['title']); - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $process_button_string .= tep_draw_hidden_field('c_prod_' . ($i+1), (int)$order->products[$i]['id'] . ',' . (int)$order->products[$i]['qty']) . - tep_draw_hidden_field('c_name_' . ($i+1), $order->products[$i]['name']) . - tep_draw_hidden_field('c_description_' . ($i+1), $order->products[$i]['name']) . - tep_draw_hidden_field('c_price_' . ($i+1), $this->format_raw(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), MODULE_PAYMENT_2CHECKOUT_CURRENCY)); - } - - $process_button_string .= tep_draw_hidden_field('id_type', '1') . - tep_draw_hidden_field('skip_landing', '1'); - - if (MODULE_PAYMENT_2CHECKOUT_TESTMODE == 'Test') { - $process_button_string .= tep_draw_hidden_field('demo', 'Y'); - } - - $process_button_string .= tep_draw_hidden_field('return_url', tep_href_link(FILENAME_SHOPPING_CART)); - - $lang_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$languages_id . "'"); - $lang = tep_db_fetch_array($lang_query); - - switch (strtolower($lang['code'])) { - case 'es': - $process_button_string .= tep_draw_hidden_field('lang', 'sp'); - break; - } - - $process_button_string .= tep_draw_hidden_field('cart_brand_name', 'oscommerce') . - tep_draw_hidden_field('cart_version_name', PROJECT_VERSION); - - return $process_button_string; - } - - function before_process() { - global $HTTP_POST_VARS; - - if ( ($HTTP_POST_VARS['credit_card_processed'] != 'Y') && ($HTTP_POST_VARS['credit_card_processed'] != 'K') ){ - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL', true, false)); - } - } - - function after_process() { - global $HTTP_POST_VARS, $order, $insert_id; - - if (MODULE_PAYMENT_2CHECKOUT_TESTMODE == 'Test') { - $sql_data_array = array('orders_id' => (int)$insert_id, - 'orders_status_id' => (int)$order->info['order_status'], - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => MODULE_PAYMENT_2CHECKOUT_TEXT_WARNING_DEMO_MODE); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - -// The KEY value returned from the gateway is intentionally broken for Test transactions so it is only checked in Production mode - if (tep_not_null(MODULE_PAYMENT_2CHECKOUT_SECRET_WORD) && (MODULE_PAYMENT_2CHECKOUT_TESTMODE == 'Production')) { - if (strtoupper(md5(MODULE_PAYMENT_2CHECKOUT_SECRET_WORD . MODULE_PAYMENT_2CHECKOUT_LOGIN . $HTTP_POST_VARS['order_number'] . $this->order_format($order->info['total'], MODULE_PAYMENT_2CHECKOUT_CURRENCY))) != strtoupper($HTTP_POST_VARS['key'])) { - $sql_data_array = array('orders_id' => (int)$insert_id, - 'orders_status_id' => (int)$order->info['order_status'], - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => MODULE_PAYMENT_2CHECKOUT_TEXT_WARNING_TRANSACTION_ORDER); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } - } - - function get_error() { - $error = array('title' => '', - 'error' => MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE); - - return $error; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_2CHECKOUT_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable 2Checkout', 'MODULE_PAYMENT_2CHECKOUT_STATUS', 'False', 'Do you want to accept 2CheckOut payments?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Vendor Account', 'MODULE_PAYMENT_2CHECKOUT_LOGIN', '', 'The vendor account number for the 2Checkout gateway.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_2CHECKOUT_TESTMODE', 'Test', 'Transaction mode used for the 2Checkout gateway.', '6', '0', 'tep_cfg_select_option(array(\'Test\', \'Production\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Secret Word', 'MODULE_PAYMENT_2CHECKOUT_SECRET_WORD', '', 'The secret word to confirm transactions with. (Must be the same as defined on the Vendor Admin interface)', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Payment Routine', 'MODULE_PAYMENT_2CHECKOUT_ROUTINE', 'Multi-Page', 'The payment routine to use on the 2Checkout gateway.', '6', '0', 'tep_cfg_select_option(array(\'Multi-Page\', \'Single-Page\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Processing Currency', 'MODULE_PAYMENT_2CHECKOUT_CURRENCY', '" . DEFAULT_CURRENCY . "', 'The currency to process transactions in. (Must be the same as defined on the Vendor Admin interface)', '6', '0', 'pm2checkout::getCurrencies(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_PAYMENT_2CHECKOUT_SORT_ORDER', '0', 'Sort order of display. (Lowest is displayed first)', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_2CHECKOUT_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value.', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_PAYMENT_2CHECKOUT_STATUS', 'MODULE_PAYMENT_2CHECKOUT_LOGIN', 'MODULE_PAYMENT_2CHECKOUT_TESTMODE', 'MODULE_PAYMENT_2CHECKOUT_SECRET_WORD', 'MODULE_PAYMENT_2CHECKOUT_ROUTINE', 'MODULE_PAYMENT_2CHECKOUT_CURRENCY', 'MODULE_PAYMENT_2CHECKOUT_ZONE', 'MODULE_PAYMENT_2CHECKOUT_ORDER_STATUS_ID', 'MODULE_PAYMENT_2CHECKOUT_SORT_ORDER'); - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function getCurrencies($value, $key = '') { - $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value'); - - $currencies_array = array(); - - $currencies_query = tep_db_query("select code, title from " . TABLE_CURRENCIES . " order by title"); - while ($currencies = tep_db_fetch_array($currencies_query)) { - $currencies_array[] = array('id' => $currencies['code'], - 'text' => $currencies['title']); - } - - return tep_draw_pull_down_menu($name, $currencies_array, $value); - } - } -?> diff --git a/catalog/includes/modules/payment/psigate.php b/catalog/includes/modules/payment/psigate.php deleted file mode 100644 index c7af94b4d..000000000 --- a/catalog/includes/modules/payment/psigate.php +++ /dev/null @@ -1,285 +0,0 @@ -code = 'psigate'; - $this->title = MODULE_PAYMENT_PSIGATE_TEXT_TITLE; - $this->description = MODULE_PAYMENT_PSIGATE_TEXT_DESCRIPTION; - $this->sort_order = MODULE_PAYMENT_PSIGATE_SORT_ORDER; - $this->enabled = ((MODULE_PAYMENT_PSIGATE_STATUS == 'True') ? true : false); - - if ((int)MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID > 0) { - $this->order_status = MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID; - } - - if (is_object($order)) $this->update_status(); - - $this->form_action_url = 'https://order.psigate.com/psigate.asp'; - } - -// class methods - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_PSIGATE_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_PSIGATE_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { - $js = 'if (payment_value == "' . $this->code . '") {' . "\n" . - ' var psigate_cc_number = document.checkout_payment.psigate_cc_number.value;' . "\n" . - ' if (psigate_cc_number == "" || psigate_cc_number.length < ' . CC_NUMBER_MIN_LENGTH . ') {' . "\n" . - ' error_message = error_message + "' . MODULE_PAYMENT_PSIGATE_TEXT_JS_CC_NUMBER . '";' . "\n" . - ' error = 1;' . "\n" . - ' }' . "\n" . - '}' . "\n"; - - return $js; - } else { - return false; - } - } - - function selection() { - global $order; - - if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { - for ($i=1; $i<13; $i++) { - $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000))); - } - - $today = getdate(); - for ($i=$today['year']; $i < $today['year']+10; $i++) { - $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); - } - - $selection = array('id' => $this->code, - 'module' => $this->title, - 'fields' => array(array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER, - 'field' => $order->billing['firstname'] . ' ' . $order->billing['lastname']), - array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER, - 'field' => tep_draw_input_field('psigate_cc_number')), - array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES, - 'field' => tep_draw_pull_down_menu('psigate_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('psigate_cc_expires_year', $expires_year)))); - } else { - $selection = array('id' => $this->code, - 'module' => $this->title); - } - - return $selection; - } - - function pre_confirmation_check() { - global $HTTP_POST_VARS; - - if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { - include(DIR_WS_CLASSES . 'cc_validation.php'); - - $cc_validation = new cc_validation(); - $result = $cc_validation->validate($HTTP_POST_VARS['psigate_cc_number'], $HTTP_POST_VARS['psigate_cc_expires_month'], $HTTP_POST_VARS['psigate_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) . '&psigate_cc_owner=' . urlencode($HTTP_POST_VARS['psigate_cc_owner']) . '&psigate_cc_expires_month=' . $HTTP_POST_VARS['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . $HTTP_POST_VARS['psigate_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; - $this->cc_expiry_month = $cc_validation->cc_expiry_month; - $this->cc_expiry_year = $cc_validation->cc_expiry_year; - } else { - return false; - } - } - - function confirmation() { - global $HTTP_POST_VARS, $order; - - if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { - $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, - 'fields' => array(array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_OWNER, - 'field' => $order->billing['firstname'] . ' ' . $order->billing['lastname']), - array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER, - 'field' => substr($this->cc_card_number, 0, 4) . str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)), - array('title' => MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES, - 'field' => strftime('%B, %Y', mktime(0,0,0,$HTTP_POST_VARS['psigate_cc_expires_month'], 1, '20' . $HTTP_POST_VARS['psigate_cc_expires_year']))))); - - return $confirmation; - } else { - return false; - } - } - - function process_button() { - global $HTTP_SERVER_VARS, $order, $currencies; - - switch (MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE) { - case 'Always Good': - $transaction_mode = '1'; - break; - case 'Always Duplicate': - $transaction_mode = '2'; - break; - case 'Always Decline': - $transaction_mode = '3'; - break; - case 'Production': - default: - $transaction_mode = '0'; - break; - } - - switch (MODULE_PAYMENT_PSIGATE_TRANSACTION_TYPE) { - case 'Sale': - $transaction_type = '0'; - break; - case 'PostAuth': - $transaction_type = '2'; - break; - case 'PreAuth': - default: - $transaction_type = '1'; - break; - } - - $process_button_string = tep_draw_hidden_field('MerchantID', MODULE_PAYMENT_PSIGATE_MERCHANT_ID) . - tep_draw_hidden_field('FullTotal', number_format($order->info['total'] * $currencies->get_value(MODULE_PAYMENT_PSIGATE_CURRENCY), $currencies->currencies[MODULE_PAYMENT_PSIGATE_CURRENCY]['decimal_places'])) . - tep_draw_hidden_field('ThanksURL', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true)) . - tep_draw_hidden_field('NoThanksURL', tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'NONSSL', true)) . - tep_draw_hidden_field('Bname', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . - tep_draw_hidden_field('Baddr1', $order->billing['street_address']) . - tep_draw_hidden_field('Bcity', $order->billing['city']); - - if ($order->billing['country']['iso_code_2'] == 'US') { - $billing_state_query = tep_db_query("select zone_code from " . TABLE_ZONES . " where zone_id = '" . (int)$order->billing['zone_id'] . "'"); - $billing_state = tep_db_fetch_array($billing_state_query); - - $process_button_string .= tep_draw_hidden_field('Bstate', $billing_state['zone_code']); - } else { - $process_button_string .= tep_draw_hidden_field('Bstate', $order->billing['state']); - } - - $process_button_string .= tep_draw_hidden_field('Bzip', $order->billing['postcode']) . - tep_draw_hidden_field('Bcountry', $order->billing['country']['iso_code_2']) . - tep_draw_hidden_field('Phone', $order->customer['telephone']) . - tep_draw_hidden_field('Email', $order->customer['email_address']) . - tep_draw_hidden_field('Sname', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) . - tep_draw_hidden_field('Saddr1', $order->delivery['street_address']) . - tep_draw_hidden_field('Scity', $order->delivery['city']) . - tep_draw_hidden_field('Sstate', $order->delivery['state']) . - tep_draw_hidden_field('Szip', $order->delivery['postcode']) . - tep_draw_hidden_field('Scountry', $order->delivery['country']['iso_code_2']) . - tep_draw_hidden_field('ChargeType', $transaction_type) . - tep_draw_hidden_field('Result', $transaction_mode) . - tep_draw_hidden_field('IP', $HTTP_SERVER_VARS['REMOTE_ADDR']); - - if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { - $process_button_string .= tep_draw_hidden_field('CardNumber', $this->cc_card_number) . - tep_draw_hidden_field('ExpMonth', $this->cc_expiry_month) . - tep_draw_hidden_field('ExpYear', substr($this->cc_expiry_year, -2)); - } - - return $process_button_string; - } - - function before_process() { - return false; - } - - function after_process() { - return false; - } - - function get_error() { - global $HTTP_GET_VARS; - - if (isset($HTTP_GET_VARS['ErrMsg']) && tep_not_null($HTTP_GET_VARS['ErrMsg'])) { - $error = stripslashes(urldecode($HTTP_GET_VARS['ErrMsg'])); - } elseif (isset($HTTP_GET_VARS['Err']) && tep_not_null($HTTP_GET_VARS['Err'])) { - $error = stripslashes(urldecode($HTTP_GET_VARS['Err'])); - } elseif (isset($HTTP_GET_VARS['error']) && tep_not_null($HTTP_GET_VARS['error'])) { - $error = stripslashes(urldecode($HTTP_GET_VARS['error'])); - } else { - $error = MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE; - } - - return array('title' => MODULE_PAYMENT_PSIGATE_TEXT_ERROR, - 'error' => $error); - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PSIGATE_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable PSiGate Module', 'MODULE_PAYMENT_PSIGATE_STATUS', 'True', 'Do you want to accept PSiGate payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_PSIGATE_MERCHANT_ID', 'teststorewithcard', 'Merchant ID used for the PSiGate service', '6', '2', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE', 'Always Good', 'Transaction mode to use for the PSiGate service', '6', '3', 'tep_cfg_select_option(array(\'Production\', \'Always Good\', \'Always Duplicate\', \'Always Decline\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Type', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_TYPE', 'PreAuth', 'Transaction type to use for the PSiGate service', '6', '4', 'tep_cfg_select_option(array(\'Sale\', \'PreAuth\', \'PostAuth\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Credit Card Collection', 'MODULE_PAYMENT_PSIGATE_INPUT_MODE', 'Local', 'Should the credit card details be collected locally or remotely at PSiGate?', '6', '5', 'tep_cfg_select_option(array(\'Local\', \'Remote\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PSIGATE_CURRENCY', 'USD', 'The currency to use for credit card transactions', '6', '6', 'tep_cfg_select_option(array(\'CAD\', \'USD\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PSIGATE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_PSIGATE_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_PAYMENT_PSIGATE_STATUS', 'MODULE_PAYMENT_PSIGATE_MERCHANT_ID', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE', 'MODULE_PAYMENT_PSIGATE_TRANSACTION_TYPE', 'MODULE_PAYMENT_PSIGATE_INPUT_MODE', 'MODULE_PAYMENT_PSIGATE_CURRENCY', 'MODULE_PAYMENT_PSIGATE_ZONE', 'MODULE_PAYMENT_PSIGATE_ORDER_STATUS_ID', 'MODULE_PAYMENT_PSIGATE_SORT_ORDER'); - } - } -?> diff --git a/catalog/includes/modules/payment/rbsworldpay_hosted.php b/catalog/includes/modules/payment/rbsworldpay_hosted.php deleted file mode 100644 index 680aa1a08..000000000 --- a/catalog/includes/modules/payment/rbsworldpay_hosted.php +++ /dev/null @@ -1,743 +0,0 @@ -signature = 'rbs|worldpay_hosted|2.2|2.3'; - $this->api_version = '4.6'; - - $this->code = 'rbsworldpay_hosted'; - $this->title = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_SORT_ORDER') ? MODULE_PAYMENT_RBSWORLDPAY_HOSTED_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS') && (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS') ) { - if ( MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE == 'True' ) { - $this->title .= ' [Test]'; - $this->public_title .= ' (' . $this->code . '; Test)'; - } - - if ( MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE == 'True' ) { - $this->form_action_url = 'https://secure-test.worldpay.com/wcc/purchase'; - } else { - $this->form_action_url = 'https://secure.worldpay.com/wcc/purchase'; - } - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_RBSWORLDPAY_HOSTED_INSTALLATION_ID) ) { - $this->description = '
' . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - global $cart_RBS_Worldpay_Hosted_ID; - - if (tep_session_is_registered('cart_RBS_Worldpay_Hosted_ID')) { - $order_id = substr($cart_RBS_Worldpay_Hosted_ID, strpos($cart_RBS_Worldpay_Hosted_ID, '-')+1); - - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - - tep_session_unregister('cart_RBS_Worldpay_Hosted_ID'); - } - } - - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - global $cartID, $cart; - - if (empty($cart->cartID)) { - $cartID = $cart->cartID = $cart->generate_cart_id(); - } - - if (!tep_session_is_registered('cartID')) { - tep_session_register('cartID'); - } - } - - function confirmation() { - global $cartID, $cart_RBS_Worldpay_Hosted_ID, $customer_id, $languages_id, $order, $order_total_modules; - - $insert_order = false; - - if (tep_session_is_registered('cart_RBS_Worldpay_Hosted_ID')) { - $order_id = substr($cart_RBS_Worldpay_Hosted_ID, strpos($cart_RBS_Worldpay_Hosted_ID, '-')+1); - - $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); - $curr = tep_db_fetch_array($curr_check); - - if ( ($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_RBS_Worldpay_Hosted_ID, 0, strlen($cartID))) ) { - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - } - - $insert_order = true; - } - } else { - $insert_order = true; - } - - if ($insert_order == true) { - $order_totals = array(); - if (is_array($order_total_modules->modules)) { - reset($order_total_modules->modules); - while (list(, $value) = each($order_total_modules->modules)) { - $class = substr($value, 0, strrpos($value, '.')); - if ($GLOBALS[$class]->enabled) { - for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { - if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { - $order_totals[] = array('code' => $GLOBALS[$class]->code, - 'title' => $GLOBALS[$class]->output[$i]['title'], - 'text' => $GLOBALS[$class]->output[$i]['text'], - 'value' => $GLOBALS[$class]->output[$i]['value'], - 'sort_order' => $GLOBALS[$class]->sort_order); - } - } - } - } - } - - $sql_data_array = array('customers_id' => $customer_id, - 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], - 'customers_company' => $order->customer['company'], - 'customers_street_address' => $order->customer['street_address'], - 'customers_suburb' => $order->customer['suburb'], - 'customers_city' => $order->customer['city'], - 'customers_postcode' => $order->customer['postcode'], - 'customers_state' => $order->customer['state'], - 'customers_country' => $order->customer['country']['title'], - 'customers_telephone' => $order->customer['telephone'], - 'customers_email_address' => $order->customer['email_address'], - 'customers_address_format_id' => $order->customer['format_id'], - 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], - 'delivery_company' => $order->delivery['company'], - 'delivery_street_address' => $order->delivery['street_address'], - 'delivery_suburb' => $order->delivery['suburb'], - 'delivery_city' => $order->delivery['city'], - 'delivery_postcode' => $order->delivery['postcode'], - 'delivery_state' => $order->delivery['state'], - 'delivery_country' => $order->delivery['country']['title'], - 'delivery_address_format_id' => $order->delivery['format_id'], - 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], - 'billing_company' => $order->billing['company'], - 'billing_street_address' => $order->billing['street_address'], - 'billing_suburb' => $order->billing['suburb'], - 'billing_city' => $order->billing['city'], - 'billing_postcode' => $order->billing['postcode'], - 'billing_state' => $order->billing['state'], - 'billing_country' => $order->billing['country']['title'], - 'billing_address_format_id' => $order->billing['format_id'], - 'payment_method' => $order->info['payment_method'], - 'cc_type' => $order->info['cc_type'], - 'cc_owner' => $order->info['cc_owner'], - 'cc_number' => $order->info['cc_number'], - 'cc_expires' => $order->info['cc_expires'], - 'date_purchased' => 'now()', - 'orders_status' => $order->info['order_status'], - 'currency' => $order->info['currency'], - 'currency_value' => $order->info['currency_value']); - - tep_db_perform(TABLE_ORDERS, $sql_data_array); - - $insert_id = tep_db_insert_id(); - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'title' => $order_totals[$i]['title'], - 'text' => $order_totals[$i]['text'], - 'value' => $order_totals[$i]['value'], - 'class' => $order_totals[$i]['code'], - 'sort_order' => $order_totals[$i]['sort_order']); - - tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); - } - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'products_id' => tep_get_prid($order->products[$i]['id']), - 'products_model' => $order->products[$i]['model'], - 'products_name' => $order->products[$i]['name'], - 'products_price' => $order->products[$i]['price'], - 'final_price' => $order->products[$i]['final_price'], - 'products_tax' => $order->products[$i]['tax'], - 'products_quantity' => $order->products[$i]['qty']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); - - $order_products_id = tep_db_insert_id(); - - $attributes_exist = '0'; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'products_options' => $attributes_values['products_options_name'], - 'products_options_values' => $attributes_values['products_options_values_name'], - 'options_values_price' => $attributes_values['options_values_price'], - 'price_prefix' => $attributes_values['price_prefix']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); - - if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'orders_products_filename' => $attributes_values['products_attributes_filename'], - 'download_maxdays' => $attributes_values['products_attributes_maxdays'], - 'download_count' => $attributes_values['products_attributes_maxcount']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); - } - } - } - } - - $cart_RBS_Worldpay_Hosted_ID = $cartID . '-' . $insert_id; - tep_session_register('cart_RBS_Worldpay_Hosted_ID'); - } - - return false; - } - - function process_button() { - global $order, $currency, $languages_id, $language, $customer_id, $cart_RBS_Worldpay_Hosted_ID; - - $order_id = substr($cart_RBS_Worldpay_Hosted_ID, strpos($cart_RBS_Worldpay_Hosted_ID, '-')+1); - - $lang_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$languages_id . "'"); - $lang = tep_db_fetch_array($lang_query); - - $process_button_string = tep_draw_hidden_field('instId', MODULE_PAYMENT_RBSWORLDPAY_HOSTED_INSTALLATION_ID) . - tep_draw_hidden_field('cartId', $order_id) . - tep_draw_hidden_field('amount', $this->format_raw($order->info['total'])) . - tep_draw_hidden_field('currency', $currency) . - tep_draw_hidden_field('desc', STORE_NAME) . - tep_draw_hidden_field('name', $order->billing['firstname'] . ' ' . $order->billing['lastname']) . - tep_draw_hidden_field('address1', $order->billing['street_address']) . - tep_draw_hidden_field('town', $order->billing['city']) . - tep_draw_hidden_field('region', $order->billing['state']) . - tep_draw_hidden_field('postcode', $order->billing['postcode']) . - tep_draw_hidden_field('country', $order->billing['country']['iso_code_2']) . - tep_draw_hidden_field('tel', $order->customer['telephone']) . - tep_draw_hidden_field('email', $order->customer['email_address']) . - tep_draw_hidden_field('fixContact', 'Y') . - tep_draw_hidden_field('hideCurrency', 'true') . - tep_draw_hidden_field('lang', strtoupper($lang['code'])) . - tep_draw_hidden_field('signatureFields', 'amount:currency:cartId') . - tep_draw_hidden_field('signature', md5(MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD . ':' . $this->format_raw($order->info['total']) . ':' . $currency . ':' . $order_id)) . - tep_draw_hidden_field('MC_callback', tep_href_link('ext/modules/payment/rbsworldpay/hosted_callback.php', '', 'SSL', false)) . - tep_draw_hidden_field('M_sid', tep_session_id()) . - tep_draw_hidden_field('M_cid', $customer_id) . - tep_draw_hidden_field('M_lang', $language) . - tep_draw_hidden_field('M_hash', md5(tep_session_id() . $customer_id . $order_id . $language . number_format($order->info['total'], 2) . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD)); - - if (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTION_METHOD == 'Pre-Authorization') { - $process_button_string .= tep_draw_hidden_field('authMode', 'E'); - } - - if (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE == 'True') { - $process_button_string .= tep_draw_hidden_field('testMode', '100'); - } - - return $process_button_string; - } - - function before_process() { - global $HTTP_GET_VARS, $customer_id, $language, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_RBS_Worldpay_Hosted_ID; - global $$payment; - - $order_id = substr($cart_RBS_Worldpay_Hosted_ID, strpos($cart_RBS_Worldpay_Hosted_ID, '-')+1); - - if (!isset($HTTP_GET_VARS['hash']) || ($HTTP_GET_VARS['hash'] != md5(tep_session_id() . $customer_id . $order_id . $language . number_format($order->info['total'], 2) . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD))) { - $this->sendDebugEmail(); - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - $check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "' and customers_id = '" . (int)$customer_id . "'"); - - if (!tep_db_num_rows($check_query)) { - $this->sendDebugEmail(); - - tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); - } - - $check = tep_db_fetch_array($check_query); - - $order_status_id = (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID); - - if ($check['orders_status'] == MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID) { - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$order_id . "'"); - - $sql_data_array = array('orders_id' => $order_id, - 'orders_status_id' => $order_status_id, - 'date_added' => 'now()', - 'customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0', - 'comments' => $order->info['comments']); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } else { - $order_status_query = tep_db_query("select orders_status_history_id from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$order_id . "' and orders_status_id = '" . (int)$order_status_id . "' and comments = '' order by date_added desc limit 1"); - - if (tep_db_num_rows($order_status_query)) { - $order_status = tep_db_fetch_array($order_status_query); - - $sql_data_array = array('customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0', - 'comments' => $order->info['comments']); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'update', "orders_status_history_id = '" . (int)$order_status['orders_status_history_id'] . "'"); - } - } - - $trans_result = 'WorldPay: Transaction Verified'; - - if (MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE == 'True') { - $trans_result .= "\n" . MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TEXT_WARNING_DEMO_MODE; - } - - $sql_data_array = array('orders_id' => $order_id, - 'orders_status_id' => MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => $trans_result); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - -// initialized for the email confirmation - $products_ordered = ''; - $subtotal = 0; - $total_tax = 0; - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { -// Stock Update - Joao Correia - if (STOCK_LIMITED == 'true') { - if (DOWNLOAD_ENABLED == 'true') { - $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename - FROM " . TABLE_PRODUCTS . " p - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa - ON p.products_id=pa.products_id - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - ON pa.products_attributes_id=pad.products_attributes_id - WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; -// Will work with only one option for downloadable products -// otherwise, we have to build the query dynamically with a loop - $products_attributes = $order->products[$i]['attributes']; - if (is_array($products_attributes)) { - $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; - } - $stock_query = tep_db_query($stock_query_raw); - } else { - $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - if (tep_db_num_rows($stock_query) > 0) { - $stock_values = tep_db_fetch_array($stock_query); -// do not decrement quantities if products_attributes_filename exists - if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { - $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; - } else { - $stock_left = $stock_values['products_quantity']; - } - tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { - tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - } - } - -// Update products_ordered (for bestsellers list) - tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - -//------insert customer choosen option to order-------- - $attributes_exist = '0'; - $products_ordered_attributes = ''; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; - } - } -//------insert customer choosen option eof ---- - $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); - $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; - $total_cost += $total_products_price; - - $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; - } - -// lets start with the email confirmation - $email_order = STORE_NAME . "\n" . - EMAIL_SEPARATOR . "\n" . - EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . - EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . - EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; - if ($order->info['comments']) { - $email_order .= tep_db_output($order->info['comments']) . "\n\n"; - } - $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . - EMAIL_SEPARATOR . "\n" . - $products_ordered . - EMAIL_SEPARATOR . "\n"; - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; - } - - if ($order->content_type != 'virtual') { - $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; - } - - $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; - - if (is_object($$payment)) { - $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . - EMAIL_SEPARATOR . "\n"; - $payment_class = $$payment; - $email_order .= $payment_class->title . "\n\n"; - if ($payment_class->email_footer) { - $email_order .= $payment_class->email_footer . "\n\n"; - } - } - - tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - -// send emails to other people - if (SEND_EXTRA_ORDER_EMAILS_TO != '') { - tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - -// load the after_process function from the payment modules - $this->after_process(); - - $cart->reset(true); - -// unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); - - tep_session_unregister('cart_RBS_Worldpay_Hosted_ID'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); - } - - function after_process() { - return false; - } - - function get_error() { - return false; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if (!defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Preparing [WorldPay]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Preparing [WorldPay]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - } else { - $status_id = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID; - } - - if (!defined('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'WorldPay [Transactions]' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $tx_status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $tx_status_id . "', '" . $lang['id'] . "', 'WorldPay [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $tx_status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $tx_status_id = $check['orders_status_id']; - } - } else { - $tx_status_id = MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID; - } - - $params = array('MODULE_PAYMENT_RBSWORLDPAY_HOSTED_STATUS' => array('title' => 'Enable WorldPay Hosted Payment Pages', - 'desc' => 'Do you want to accept WorldPay Hosted Payment Pages payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_INSTALLATION_ID' => array('title' => 'Installation ID', - 'desc' => 'The WorldPay Account Installation ID to accept payments for'), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_CALLBACK_PASSWORD' => array('title' => 'Callback Password', - 'desc' => 'The password sent to the callback processing script. This must be the same value defined in the WorldPay Merchant Interface.'), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_MD5_PASSWORD' => array('title' => 'MD5 Password', - 'desc' => 'The MD5 password to verify transactions with. This must be the same value defined in the WorldPay Merchant Interface.'), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Capture', - 'set_func' => 'tep_cfg_select_option(array(\'Pre-Authorization\', \'Capture\'), '), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_PREPARE_ORDER_STATUS_ID' => array('title' => 'Set Preparing Order Status', - 'desc' => 'Set the status of prepared orders made with this payment module to this value', - 'value' => $status_id, - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TRANSACTIONS_ORDER_STATUS_ID' => array('title' => 'Transactions Order Status Level', - 'desc' => 'Include WorldPay transaction information in this order status level.', - 'value' => $tx_status_id, - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'use_func' => 'tep_get_zone_class_title', - 'set_func' => 'tep_cfg_pull_down_zone_classes('), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_TESTMODE' => array('title' => 'Test Mode', - 'desc' => 'Should transactions be processed in test mode?', - 'value' => 'False', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address if one is entered.'), - 'MODULE_PAYMENT_RBSWORLDPAY_HOSTED_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - -// format prices without currency formatting - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$this->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '.', ''); - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_RBSWORLDPAY_HOSTED_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_RBSWORLDPAY_HOSTED_DEBUG_EMAIL, 'WorldPay Hosted Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - } -?> diff --git a/catalog/includes/modules/payment/sage_pay_direct.php b/catalog/includes/modules/payment/sage_pay_direct.php index 9d19f432f..40970cf4e 100644 --- a/catalog/includes/modules/payment/sage_pay_direct.php +++ b/catalog/includes/modules/payment/sage_pay_direct.php @@ -5,16 +5,21 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\HTTP; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sage_pay_direct { var $code, $title, $description, $enabled; function sage_pay_direct() { - global $HTTP_GET_VARS, $PHP_SELF, $order; + global $PHP_SELF, $order; $this->signature = 'sage_pay|sage_pay_direct|3.1|2.3'; $this->api_version = '3.00'; @@ -56,7 +61,7 @@ function sage_pay_direct() { } } - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { + if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == 'modules.php') && isset($_GET['action']) && ($_GET['action'] == 'install') && isset($_GET['subaction']) && ($_GET['subaction'] == 'conntest') ) { echo $this->getTestConnectionResult(); exit; } @@ -65,18 +70,20 @@ function sage_pay_direct() { function update_status() { global $order; + $OSCOM_Db = Registry::get('Db'); + if ( ($this->enabled == true) && ($this->hasCards() == false) ) { $this->enabled = false; } if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_DIRECT_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SAGE_PAY_DIRECT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_PAYMENT_SAGE_PAY_DIRECT_ZONE, 'zone_country_id' => $order->billing['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->billing['zone_id']) { $check_flag = true; break; } @@ -93,14 +100,13 @@ function javascript_validation() { } function selection() { - global $customer_id, $payment; + $OSCOM_Db = Registry::get('Db'); - if ( (MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True') && !tep_session_is_registered('payment') ) { - $tokens_query = tep_db_query("select 1 from customers_sagepay_tokens where customers_id = '" . (int)$customer_id . "' limit 1"); + if ( (MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True') && !isset($_SESSION['payment']) ) { + $Qtokens = $OSCOM_Db->get('customers_sagepay_tokens', '1', ['customers_id' => $_SESSION['customer_id']], null, 1); - if ( tep_db_num_rows($tokens_query) ) { - $payment = $this->code; - tep_session_register('payment'); + if ( $Qtokens->fetch() !== false ) { + $_SESSION['payment'] = $this->code; } } @@ -115,7 +121,9 @@ function pre_confirmation_check() { } function confirmation() { - global $order, $customer_id; + global $order; + + $OSCOM_Db = Registry::get('Db'); $card_types = array(); foreach ($this->getCardTypes() as $key => $value) { @@ -123,7 +131,7 @@ function confirmation() { 'text' => $value); } - $today = getdate(); + $today = getdate(); $months_array = array(); for ($i=1; $i<13; $i++) { @@ -143,24 +151,24 @@ function confirmation() { $content = ''; if ( MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True' ) { - $tokens_query = tep_db_query("select id, card_type, number_filtered, expiry_date from customers_sagepay_tokens where customers_id = '" . (int)$customer_id . "' order by date_added"); + $Qtokens = $OSCOM_Db->get('customers_sagepay_tokens', ['id', 'card_type', 'number_filtered', 'expiry_date'], ['customers_id' => $_SESSION['customer_id']], 'date_added'); - if ( tep_db_num_rows($tokens_query) > 0 ) { + if ($Qtokens->fetch() !== false) { $content .= ''; - while ( $tokens = tep_db_fetch_array($tokens_query) ) { - $content .= '' . - ' ' . - ' ' . + do { + $content .= '' . + ' ' . + ' ' . ''; if (MODULE_PAYMENT_SAGE_PAY_DIRECT_VERIFY_WITH_CVC == 'True') { - $content .= '' . + $content .= '' . ' ' . - ' ' . + ' ' . ''; } - } + } while ($Qtokens->fetch()); $content .= '' . ' ' . @@ -173,47 +181,47 @@ function confirmation() { $content .= '
' . tep_output_string_protected($tokens['number_filtered']) . '  ' . tep_output_string_protected(substr($tokens['expiry_date'], 0, 2)) . '/' . strftime('%Y', mktime(0, 0, 0, 1, 1, (2000 + substr($tokens['expiry_date'], 2)))) . '  ' . tep_output_string_protected($tokens['card_type']) . '
' . $Qtokens->valueProtected('number_filtered') . '  ' . tep_output_string_protected(substr($Qtokens->value('expiry_date'), 0, 2)) . '/' . strftime('%Y', mktime(0, 0, 0, 1, 1, (2000 + substr($Qtokens->value('expiry_date'), 2)))) . '  ' . $Qtokens->valueProtected('card_type') . '
 ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_CVC . ' ' . tep_draw_input_field('cc_cvc_tokens_nh-dns[' . (int)$tokens['id'] . ']', '', 'size="5" maxlength="4"') . '' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_CVC . ' ' . HTML::inputField('cc_cvc_tokens_nh-dns[' . $Qtokens->valueInt('id') . ']', '', 'size="5" maxlength="4"') . '
' . '' . ' ' . - ' ' . + ' ' . '' . '' . ' ' . - ' ' . + ' ' . '' . '' . ' ' . - ' ' . + ' ' . ''; if ( (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MAESTRO == 'True') || (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_AMEX == 'True') ) { $content .= '' . ' ' . - ' ' . + ' ' . ''; } $content .= '' . ' ' . - ' ' . + ' ' . ''; if ( (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MAESTRO == 'True') ) { $content .= '' . ' ' . - ' ' . + ' ' . ''; } if (MODULE_PAYMENT_SAGE_PAY_DIRECT_VERIFY_WITH_CVC == 'True') { $content .= '' . ' ' . - ' ' . + ' ' . ''; } if ( MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True' ) { $content .= '' . ' ' . - ' ' . + ' ' . ''; } @@ -231,29 +239,31 @@ function process_button() { } function before_process() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $customer_id, $order, $currency, $order_totals, $cartID, $sage_pay_response; + global $order, $order_totals, $sage_pay_response; + + $OSCOM_Db = Registry::get('Db'); $transaction_response = null; $sage_pay_response = null; $error = null; - if ( isset($HTTP_GET_VARS['check']) ) { - if ( ($HTTP_GET_VARS['check'] == '3D') && isset($HTTP_POST_VARS['MD']) && tep_not_null($HTTP_POST_VARS['MD']) && isset($HTTP_POST_VARS['PaRes']) && tep_not_null($HTTP_POST_VARS['PaRes']) ) { + if ( isset($_GET['check']) ) { + if ( ($_GET['check'] == '3D') && isset($_POST['MD']) && tep_not_null($_POST['MD']) && isset($_POST['PaRes']) && tep_not_null($_POST['PaRes']) ) { if ( MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_SERVER == 'Live' ) { $gateway_url = 'https://live.sagepay.com/gateway/service/direct3dcallback.vsp'; } else { $gateway_url = 'https://test.sagepay.com/gateway/service/direct3dcallback.vsp'; } - $post_string = 'MD=' . $HTTP_POST_VARS['MD'] . '&PARes=' . $HTTP_POST_VARS['PaRes']; + $post_string = 'MD=' . $_POST['MD'] . '&PARes=' . $_POST['PaRes']; $transaction_response = $this->sendTransactionToGateway($gateway_url, $post_string); - } elseif ( ($HTTP_GET_VARS['check'] == 'PAYPAL') && isset($HTTP_POST_VARS['Status']) ) { - if ( ($HTTP_POST_VARS['Status'] == 'PAYPALOK') && isset($HTTP_POST_VARS['VPSTxId']) && isset($HTTP_POST_VARS['CustomerEMail']) && isset($HTTP_POST_VARS['PayerID']) ) { + } elseif ( ($_GET['check'] == 'PAYPAL') && isset($_POST['Status']) ) { + if ( ($_POST['Status'] == 'PAYPALOK') && isset($_POST['VPSTxId']) && isset($_POST['CustomerEMail']) && isset($_POST['PayerID']) ) { $params = array('VPSProtocol' => $this->api_version, 'TxType' => 'COMPLETE', - 'VPSTxId' => $HTTP_POST_VARS['VPSTxId'], + 'VPSTxId' => $_POST['VPSTxId'], 'Amount' => $this->format_raw($order->info['total']), 'Accept' => 'YES'); @@ -270,8 +280,8 @@ function before_process() { } $transaction_response = $this->sendTransactionToGateway($gateway_url, $post_string); - } elseif ( isset($HTTP_POST_VARS['StatusDetail']) && ($HTTP_POST_VARS['StatusDetail'] == 'Paypal transaction cancelled by client.') ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL')); + } elseif ( isset($_POST['StatusDetail']) && ($_POST['StatusDetail'] == 'Paypal transaction cancelled by client.') ) { + OSCOM::redirect('checkout_confirmation.php', '', 'SSL'); } } } else { @@ -279,37 +289,35 @@ function before_process() { $sagepay_token_cvc = null; if ( MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True' ) { - if ( isset($HTTP_POST_VARS['sagepay_card']) && is_numeric($HTTP_POST_VARS['sagepay_card']) && ($HTTP_POST_VARS['sagepay_card'] > 0) ) { - $token_query = tep_db_query("select sagepay_token from customers_sagepay_tokens where id = '" . (int)$HTTP_POST_VARS['sagepay_card'] . "' and customers_id = '" . (int)$customer_id . "'"); + if ( isset($_POST['sagepay_card']) && is_numeric($_POST['sagepay_card']) && ($_POST['sagepay_card'] > 0) ) { + $Qtoken = $OSCOM_Db->get('customers_sagepay_tokens', 'sagepay_token', ['id' => $_POST['sagepay_card'], 'customers_id' => $_SESSION['customer_id']]); - if ( tep_db_num_rows($token_query) == 1 ) { - $token = tep_db_fetch_array($token_query); + if ( $Qtoken->fetch() !== false ) { + $sagepay_token = $Qtoken->value('sagepay_token'); - $sagepay_token = $token['sagepay_token']; - - if ( isset($HTTP_POST_VARS['cc_cvc_tokens_nh-dns']) && is_array($HTTP_POST_VARS['cc_cvc_tokens_nh-dns']) && isset($HTTP_POST_VARS['cc_cvc_tokens_nh-dns'][$HTTP_POST_VARS['sagepay_card']]) ) { - $sagepay_token_cvc = substr($HTTP_POST_VARS['cc_cvc_tokens_nh-dns'][$HTTP_POST_VARS['sagepay_card']], 0, 4); + if ( isset($_POST['cc_cvc_tokens_nh-dns']) && is_array($_POST['cc_cvc_tokens_nh-dns']) && isset($_POST['cc_cvc_tokens_nh-dns'][$_POST['sagepay_card']]) ) { + $sagepay_token_cvc = substr($_POST['cc_cvc_tokens_nh-dns'][$_POST['sagepay_card']], 0, 4); } } } } if ( !isset($sagepay_token) ) { - $cc_type = isset($HTTP_POST_VARS['cc_type']) ? substr($HTTP_POST_VARS['cc_type'], 0, 15) : null; + $cc_type = isset($_POST['cc_type']) ? substr($_POST['cc_type'], 0, 15) : null; if ( !isset($cc_type) || ($this->isCard($cc_type) == false) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardtype', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardtype', 'SSL'); } if ( $cc_type != 'PAYPAL' ) { - $cc_owner = isset($HTTP_POST_VARS['cc_owner']) ? substr($HTTP_POST_VARS['cc_owner'], 0, 50) : null; - $cc_number = isset($HTTP_POST_VARS['cc_number_nh-dns']) ? substr(preg_replace('/[^0-9]/', '', $HTTP_POST_VARS['cc_number_nh-dns']), 0, 20) : null; + $cc_owner = isset($_POST['cc_owner']) ? substr($_POST['cc_owner'], 0, 50) : null; + $cc_number = isset($_POST['cc_number_nh-dns']) ? substr(preg_replace('/[^0-9]/', '', $_POST['cc_number_nh-dns']), 0, 20) : null; $cc_start = null; $cc_expires = null; - $cc_issue = isset($HTTP_POST_VARS['cc_issue_nh-dns']) ? substr($HTTP_POST_VARS['cc_issue_nh-dns'], 0, 2) : null; - $cc_cvc = isset($HTTP_POST_VARS['cc_cvc_nh-dns']) ? substr($HTTP_POST_VARS['cc_cvc_nh-dns'], 0, 4) : null; + $cc_issue = isset($_POST['cc_issue_nh-dns']) ? substr($_POST['cc_issue_nh-dns'], 0, 2) : null; + $cc_cvc = isset($_POST['cc_cvc_nh-dns']) ? substr($_POST['cc_cvc_nh-dns'], 0, 4) : null; - $today = getdate(); + $today = getdate(); $months_array = array(); for ($i=1; $i<13; $i++) { @@ -327,48 +335,48 @@ function before_process() { } if ( !isset($cc_owner) || empty($cc_owner) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardowner', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardowner', 'SSL'); } if ( !isset($cc_number) || (is_numeric($cc_number) == false) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardnumber', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardnumber', 'SSL'); } if ( (($cc_type == 'MAESTRO') && (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MAESTRO == 'True')) || (($cc_type == 'AMEX') && (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_AMEX == 'True')) ) { - if ( !isset($HTTP_POST_VARS['cc_starts_month']) || !in_array($HTTP_POST_VARS['cc_starts_month'], $months_array) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardstart', 'SSL')); + if ( !isset($_POST['cc_starts_month']) || !in_array($_POST['cc_starts_month'], $months_array) ) { + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardstart', 'SSL'); } - if ( !isset($HTTP_POST_VARS['cc_starts_year']) || !in_array($HTTP_POST_VARS['cc_starts_year'], $year_valid_from_array) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardstart', 'SSL')); + if ( !isset($_POST['cc_starts_year']) || !in_array($_POST['cc_starts_year'], $year_valid_from_array) ) { + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardstart', 'SSL'); } - $cc_start = substr($HTTP_POST_VARS['cc_starts_month'] . $HTTP_POST_VARS['cc_starts_year'], 0, 4); + $cc_start = substr($_POST['cc_starts_month'] . $_POST['cc_starts_year'], 0, 4); } - if ( !isset($HTTP_POST_VARS['cc_expires_month']) || !in_array($HTTP_POST_VARS['cc_expires_month'], $months_array) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardexpires', 'SSL')); + if ( !isset($_POST['cc_expires_month']) || !in_array($_POST['cc_expires_month'], $months_array) ) { + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardexpires', 'SSL'); } - if ( !isset($HTTP_POST_VARS['cc_expires_year']) || !in_array($HTTP_POST_VARS['cc_expires_year'], $year_valid_to_array) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardexpires', 'SSL')); + if ( !isset($_POST['cc_expires_year']) || !in_array($_POST['cc_expires_year'], $year_valid_to_array) ) { + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardexpires', 'SSL'); } - if ( ($HTTP_POST_VARS['cc_expires_year'] == date('y')) && ($HTTP_POST_VARS['cc_expires_month'] < date('m')) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardexpires', 'SSL')); + if ( ($_POST['cc_expires_year'] == date('y')) && ($_POST['cc_expires_month'] < date('m')) ) { + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardexpires', 'SSL'); } - $cc_expires = substr($HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year'], 0, 4); + $cc_expires = substr($_POST['cc_expires_month'] . $_POST['cc_expires_year'], 0, 4); if ( (($cc_type == 'MAESTRO') && (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MAESTRO == 'True')) ) { if ( !isset($cc_issue) || empty($cc_issue) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardissue', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardissue', 'SSL'); } } if (MODULE_PAYMENT_SAGE_PAY_DIRECT_VERIFY_WITH_CVC == 'True') { if ( !isset($cc_cvc) || empty($cc_cvc) ) { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardcvc', 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . '&error=cardcvc', 'SSL'); } } } @@ -377,9 +385,9 @@ function before_process() { $params = array('VPSProtocol' => $this->api_version, 'ReferrerID' => 'C74D7B82-E9EB-4FBD-93DB-76F0F551C802', 'Vendor' => substr(MODULE_PAYMENT_SAGE_PAY_DIRECT_VENDOR_LOGIN_NAME, 0, 15), - 'VendorTxCode' => substr(date('YmdHis') . '-' . $customer_id . '-' . $cartID, 0, 40), + 'VendorTxCode' => substr(date('YmdHis') . '-' . $_SESSION['customer_id'] . '-' . $_SESSION['cartID'], 0, 40), 'Amount' => $this->format_raw($order->info['total']), - 'Currency' => $currency, + 'Currency' => $_SESSION['currency'], 'Description' => substr(STORE_NAME, 0, 100), 'BillingSurname' => substr($order->billing['lastname'], 0, 20), 'BillingFirstnames' => substr($order->billing['firstname'], 0, 20), @@ -397,7 +405,7 @@ function before_process() { 'DeliveryPhone' => substr($order->customer['telephone'], 0, 20), 'CustomerEMail' => substr($order->customer['email_address'], 0, 255), 'Apply3DSecure' => '0', - 'VendorData' => 'Customer ID ' . $customer_id); + 'VendorData' => 'Customer ID ' . $_SESSION['customer_id']); if ( isset($sagepay_token) ) { $params['Token'] = $sagepay_token; @@ -410,12 +418,12 @@ function before_process() { $params['CardType'] = $cc_type; if ( $cc_type == 'PAYPAL' ) { - $params['PayPalCallbackURL'] = tep_href_link(FILENAME_CHECKOUT_PROCESS, 'check=PAYPAL', 'SSL'); + $params['PayPalCallbackURL'] = OSCOM::link('checkout_process.php', 'check=PAYPAL', 'SSL'); } else { $params['CardHolder'] = $cc_owner; $params['CardNumber'] = $cc_number; $params['ExpiryDate'] = $cc_expires; - $params['CreateToken'] = ((MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True') && isset($HTTP_POST_VARS['cc_save']) && ($HTTP_POST_VARS['cc_save'] == 'true') ? '1' : '0'); + $params['CreateToken'] = ((MODULE_PAYMENT_SAGE_PAY_DIRECT_TOKENS == 'True') && isset($_POST['cc_save']) && ($_POST['cc_save'] == 'true') ? '1' : '0'); if ( (($cc_type == 'MAESTRO') && (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_MAESTRO == 'True')) || (($cc_type == 'AMEX') && (MODULE_PAYMENT_SAGE_PAY_DIRECT_ALLOW_AMEX == 'True')) ) { $params['StartDate'] = $cc_start; @@ -499,35 +507,21 @@ function before_process() { } if ( isset($params['CreateToken']) && ($params['CreateToken'] == '1') ) { - global $sagepay_token_cc_type, $sagepay_token_cc_number, $sagepay_token_cc_expiry_date; - - tep_session_register('sagepay_token_cc_type'); - $sagepay_token_cc_type = $params['CardType']; - - tep_session_register('sagepay_token_cc_number'); - $sagepay_token_cc_number = str_repeat('X', strlen($params['CardNumber']) - 4) . substr($params['CardNumber'], -4); - - tep_session_register('sagepay_token_cc_expiry_date'); - $sagepay_token_cc_expiry_date = $params['ExpiryDate']; + $_SESSION['sagepay_token_cc_type'] = $params['CardType']; + $_SESSION['sagepay_token_cc_number'] = str_repeat('X', strlen($params['CardNumber']) - 4) . substr($params['CardNumber'], -4); + $_SESSION['sagepay_token_cc_expiry_date'] = $params['ExpiryDate']; } if ($sage_pay_response['Status'] == '3DAUTH') { - global $sage_pay_direct_acsurl, $sage_pay_direct_pareq, $sage_pay_direct_md; - - tep_session_register('sage_pay_direct_acsurl'); - $sage_pay_direct_acsurl = $sage_pay_response['ACSURL']; - - tep_session_register('sage_pay_direct_pareq'); - $sage_pay_direct_pareq = $sage_pay_response['PAReq']; + $_SESSION['sage_pay_direct_acsurl'] = $sage_pay_response['ACSURL']; + $_SESSION['sage_pay_direct_pareq'] = $sage_pay_response['PAReq']; + $_SESSION['sage_pay_direct_md'] = $sage_pay_response['MD']; - tep_session_register('sage_pay_direct_md'); - $sage_pay_direct_md = $sage_pay_response['MD']; - - tep_redirect(tep_href_link('ext/modules/payment/sage_pay/checkout.php', '', 'SSL')); + OSCOM::redirect('ext/modules/payment/sage_pay/checkout.php', '', 'SSL'); } if ($sage_pay_response['Status'] == 'PPREDIRECT') { - tep_redirect($sage_pay_response['PayPalRedirectURL']); + HTTP::redirect($sage_pay_response['PayPalRedirectURL']); } if ( ($sage_pay_response['Status'] != 'OK') && ($sage_pay_response['Status'] != 'AUTHENTICATED') && ($sage_pay_response['Status'] != 'REGISTERED') ) { @@ -535,12 +529,14 @@ function before_process() { $error = $this->getErrorMessageNumber($sage_pay_response['StatusDetail']); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL'); } } function after_process() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $customer_id, $insert_id, $sage_pay_response; + global $insert_id, $sage_pay_response; + + $OSCOM_Db = Registry::get('Db'); $result = array(); @@ -572,33 +568,32 @@ function after_process() { $result['3D Secure'] = $sage_pay_response['3DSecureStatus']; } - if ( isset($sage_pay_response['Token']) && tep_session_is_registered('sagepay_token_cc_number') ) { - global $sagepay_token_cc_type, $sagepay_token_cc_number, $sagepay_token_cc_expiry_date; + if ( isset($sage_pay_response['Token']) && isset($_SESSION['sagepay_token_cc_number']) ) { + $Qcheck = $OSCOM_Db->get('customers_sagepay_tokens', 'id', ['customers_id' => $_SESSION['customer_id'], 'sagepay_token' => $sage_pay_response['Token']], null, 1); - $check_query = tep_db_query("select id from customers_sagepay_tokens where customers_id = '" . (int)$customer_id . "' and sagepay_token = '" . tep_db_input($sage_pay_response['Token']) . "' limit 1"); - if ( tep_db_num_rows($check_query) < 1 ) { - $sql_data_array = array('customers_id' => $customer_id, + if ($Qcheck->fetch() === false) { + $sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'sagepay_token' => $sage_pay_response['Token'], - 'card_type' => $sagepay_token_cc_type, - 'number_filtered' => $sagepay_token_cc_number, - 'expiry_date' => $sagepay_token_cc_expiry_date, + 'card_type' => $_SESSION['sagepay_token_cc_type'], + 'number_filtered' => $_SESSION['sagepay_token_cc_number'], + 'expiry_date' => $_SESSION['sagepay_token_cc_expiry_date'], 'date_added' => 'now()'); - tep_db_perform('customers_sagepay_tokens', $sql_data_array); + $OSCOM_Db->save('customers_sagepay_tokens', $sql_data_array); } $result['Token Created'] = 'Yes'; - tep_session_unregister('sagepay_token_cc_type'); - tep_session_unregister('sagepay_token_cc_number'); - tep_session_unregister('sagepay_token_cc_expiry_date'); + unset($_SESSION['sagepay_token_cc_type']); + unset($_SESSION['sagepay_token_cc_number']); + unset($_SESSION['sagepay_token_cc_expiry_date']); } - if ( isset($HTTP_GET_VARS['check']) && ($HTTP_GET_VARS['check'] == 'PAYPAL') && isset($HTTP_POST_VARS['Status']) && ($HTTP_POST_VARS['Status'] == 'PAYPALOK') && isset($HTTP_POST_VARS['VPSTxId']) && isset($sage_pay_response['VPSTxId']) && ($HTTP_POST_VARS['VPSTxId'] == $sage_pay_response['VPSTxId']) ) { - $result['PayPal Payer E-Mail'] = $HTTP_POST_VARS['CustomerEMail']; - $result['PayPal Payer Status'] = $HTTP_POST_VARS['PayerStatus']; - $result['PayPal Payer ID'] = $HTTP_POST_VARS['PayerID']; - $result['PayPal Payer Address'] = $HTTP_POST_VARS['AddressStatus']; + if ( isset($_GET['check']) && ($_GET['check'] == 'PAYPAL') && isset($_POST['Status']) && ($_POST['Status'] == 'PAYPALOK') && isset($_POST['VPSTxId']) && isset($sage_pay_response['VPSTxId']) && ($_POST['VPSTxId'] == $sage_pay_response['VPSTxId']) ) { + $result['PayPal Payer E-Mail'] = $_POST['CustomerEMail']; + $result['PayPal Payer Status'] = $_POST['PayerStatus']; + $result['PayPal Payer ID'] = $_POST['PayerID']; + $result['PayPal Payer Address'] = $_POST['AddressStatus']; } $result_string = ''; @@ -613,27 +608,25 @@ function after_process() { 'customer_notified' => '0', 'comments' => trim($result_string)); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); + $OSCOM_Db->save('orders_status_history', $sql_data_array); - if (tep_session_is_registered('sage_pay_direct_acsurl')) { - tep_session_unregister('sage_pay_direct_acsurl'); - tep_session_unregister('sage_pay_direct_pareq'); - tep_session_unregister('sage_pay_direct_md'); + if (isset($_SESSION['sage_pay_direct_acsurl'])) { + unset($_SESSION['sage_pay_direct_acsurl']); + unset($_SESSION['sage_pay_direct_pareq']); + unset($_SESSION['sage_pay_direct_md']); } $sage_pay_response = null; } function get_error() { - global $HTTP_GET_VARS; - $message = MODULE_PAYMENT_SAGE_PAY_DIRECT_ERROR_GENERAL; - if ( isset($HTTP_GET_VARS['error']) && tep_not_null($HTTP_GET_VARS['error']) ) { - if ( is_numeric($HTTP_GET_VARS['error']) && $this->errorMessageNumberExists($HTTP_GET_VARS['error']) ) { - $message = $this->getErrorMessage($HTTP_GET_VARS['error']) . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_ERROR_GENERAL; + if ( isset($_GET['error']) && tep_not_null($_GET['error']) ) { + if ( is_numeric($_GET['error']) && $this->errorMessageNumberExists($_GET['error']) ) { + $message = $this->getErrorMessage($_GET['error']) . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_ERROR_GENERAL; } else { - switch ($HTTP_GET_VARS['error']) { + switch ($_GET['error']) { case 'cardtype': $message = MODULE_PAYMENT_SAGE_PAY_DIRECT_ERROR_CARDTYPE; break; @@ -672,14 +665,12 @@ function get_error() { } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SAGE_PAY_DIRECT_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_PAYMENT_SAGE_PAY_DIRECT_STATUS'); } function install($parameter = null) { + $OSCOM_Db = Registry::get('Db'); + $params = $this->getParams(); if (isset($parameter)) { @@ -707,12 +698,12 @@ function install($parameter = null) { $sql_data_array['use_function'] = $data['use_func']; } - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); + $OSCOM_Db->save('configuration', $sql_data_array); } } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { @@ -730,7 +721,11 @@ function keys() { } function getParams() { - if ( tep_db_num_rows(tep_db_query("show tables like 'customers_sagepay_tokens'")) != 1 ) { + $OSCOM_Db = Registry::get('Db'); + + $Qcheck = $OSCOM_Db->query('show tables like "customers_sagepay_tokens"'); + + if ($Qcheck->fetch() === false) { $sql = <<exec($sql); } if (!defined('MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sage Pay [Transactions]' limit 1"); + $Qcheck = $OSCOM_Db->get('orders_status', 'orders_status_id', ['orders_status_name' => 'Sage Pay [Transactions]'], null, 1); - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); + if ($Qcheck->fetch() === false) { + $Qstatus = $OSCOM_Db->get('orders_status', 'max(orders_status_id) as status_id'); - $status_id = $status['status_id']+1; + $status_id = $Qstatus->valueInt('status_id') + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Sage Pay [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); + $OSCOM_Db->save('orders_status', [ + 'orders_status_id' => $status_id, + 'language_id' => $lang['id'], + 'orders_status_name' => 'Sage Pay [Transactions]', + 'public_flag' => 0, + 'downloads_flag' => 0 + ]); } } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; + $status_id = $Qcheck->valueInt('orders_status_id'); } } else { $status_id = MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_ORDER_STATUS_ID; @@ -921,10 +914,10 @@ function sendTransactionToGateway($url, $parameters) { // format prices without currency formatting function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; + global $currencies; if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; + $currency_code = $_SESSION['currency']; } if (empty($currency_value) || !is_numeric($currency_value)) { @@ -1001,7 +994,7 @@ function isCard($key) { } function deleteCard($token, $token_id) { - global $customer_id; + $OSCOM_Db = Registry::get('Db'); if ( MODULE_PAYMENT_SAGE_PAY_DIRECT_TRANSACTION_SERVER == 'Live' ) { $gateway_url = 'https://live.sagepay.com/gateway/service/removetoken.vsp'; @@ -1032,9 +1025,7 @@ function deleteCard($token, $token_id) { } } - tep_db_query("delete from customers_sagepay_tokens where id = '" . (int)$token_id . "' and customers_id = '" . (int)$customer_id . "' and sagepay_token = '" . tep_db_prepare_input(tep_db_input($token)) . "'"); - - return (tep_db_affected_rows() === 1); + return $OSCOM_Db->delete('customers_sagepay_tokens', ['id' => $token_id, 'customers_id' => $_SESSION['customer_id'], 'sagepay_token' => $token]) === 1; } function loadErrorMessages() { @@ -1089,7 +1080,7 @@ function getTestLinkInfo() { $dialog_error = MODULE_PAYMENT_SAGE_PAY_DIRECT_DIALOG_CONNECTION_ERROR; $dialog_connection_time = MODULE_PAYMENT_SAGE_PAY_DIRECT_DIALOG_CONNECTION_TIME; - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); + $test_url = OSCOM::link('modules.php', 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); $js = << @@ -1329,8 +1320,6 @@ function sagepayShowNewCardFields() { } function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_DIRECT_DEBUG_EMAIL)) { $email_body = ''; @@ -1338,44 +1327,44 @@ function sendDebugEmail($response = array()) { $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; } - if (!empty($HTTP_POST_VARS)) { - if (isset($HTTP_POST_VARS['cc_number_nh-dns'])) { - $HTTP_POST_VARS['cc_number_nh-dns'] = 'XXXX' . substr($HTTP_POST_VARS['cc_number_nh-dns'], -4); + if (!empty($_POST)) { + if (isset($_POST['cc_number_nh-dns'])) { + $_POST['cc_number_nh-dns'] = 'XXXX' . substr($_POST['cc_number_nh-dns'], -4); } - if (isset($HTTP_POST_VARS['cc_cvc_tokens_nh-dns'])) { - $HTTP_POST_VARS['cc_cvc_tokens_nh-dns'] = 'XXX'; + if (isset($_POST['cc_cvc_tokens_nh-dns'])) { + $_POST['cc_cvc_tokens_nh-dns'] = 'XXX'; } - if (isset($HTTP_POST_VARS['cc_cvc_nh-dns'])) { - $HTTP_POST_VARS['cc_cvc_nh-dns'] = 'XXX'; + if (isset($_POST['cc_cvc_nh-dns'])) { + $_POST['cc_cvc_nh-dns'] = 'XXX'; } - if (isset($HTTP_POST_VARS['cc_issue_nh-dns'])) { - $HTTP_POST_VARS['cc_issue_nh-dns'] = 'XXX'; + if (isset($_POST['cc_issue_nh-dns'])) { + $_POST['cc_issue_nh-dns'] = 'XXX'; } - if (isset($HTTP_POST_VARS['cc_expires_month'])) { - $HTTP_POST_VARS['cc_expires_month'] = 'XX'; + if (isset($_POST['cc_expires_month'])) { + $_POST['cc_expires_month'] = 'XX'; } - if (isset($HTTP_POST_VARS['cc_expires_year'])) { - $HTTP_POST_VARS['cc_expires_year'] = 'XX'; + if (isset($_POST['cc_expires_year'])) { + $_POST['cc_expires_year'] = 'XX'; } - if (isset($HTTP_POST_VARS['cc_starts_month'])) { - $HTTP_POST_VARS['cc_starts_month'] = 'XX'; + if (isset($_POST['cc_starts_month'])) { + $_POST['cc_starts_month'] = 'XX'; } - if (isset($HTTP_POST_VARS['cc_starts_year'])) { - $HTTP_POST_VARS['cc_starts_year'] = 'XX'; + if (isset($_POST['cc_starts_year'])) { + $_POST['cc_starts_year'] = 'XX'; } - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; + $email_body .= '$_POST:' . "\n\n" . print_r($_POST, true) . "\n\n"; } - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; + if (!empty($_GET)) { + $email_body .= '$_GET:' . "\n\n" . print_r($_GET, true) . "\n\n"; } if (!empty($email_body)) { diff --git a/catalog/includes/modules/payment/sage_pay_form.php b/catalog/includes/modules/payment/sage_pay_form.php index a1fa75c9e..e03138244 100644 --- a/catalog/includes/modules/payment/sage_pay_form.php +++ b/catalog/includes/modules/payment/sage_pay_form.php @@ -5,11 +5,15 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sage_pay_form { var $code, $title, $description, $enabled; @@ -64,14 +68,16 @@ function sage_pay_form() { function update_status() { global $order; + $OSCOM_Db = Registry::get('Db'); + if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_FORM_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SAGE_PAY_FORM_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_PAYMENT_SAGE_PAY_FORM_ZONE, 'zone_country_id' => $order->billing['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->billing['zone_id']) { $check_flag = true; break; } @@ -101,7 +107,7 @@ function confirmation() { } function process_button() { - global $customer_id, $order, $currency, $cartID; + global $order; $process_button_string = ''; @@ -117,12 +123,12 @@ function process_button() { } $crypt = array('ReferrerID' => 'C74D7B82-E9EB-4FBD-93DB-76F0F551C802', - 'VendorTxCode' => substr(date('YmdHis') . '-' . $customer_id . '-' . $cartID, 0, 40), + 'VendorTxCode' => substr(date('YmdHis') . '-' . $_SESSION['customer_id'] . '-' . $_SESSION['cartID'], 0, 40), 'Amount' => $this->format_raw($order->info['total']), - 'Currency' => $currency, + 'Currency' => $_SESSION['currency'], 'Description' => substr(STORE_NAME, 0, 100), - 'SuccessURL' => tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'), - 'FailureURL' => tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL'), + 'SuccessURL' => OSCOM::link('checkout_process.php', '', 'SSL'), + 'FailureURL' => OSCOM::link('checkout_payment.php', 'payment_error=' . $this->code, 'SSL'), 'CustomerName' => substr($order->billing['firstname'] . ' ' . $order->billing['lastname'], 0, 100), 'CustomerEMail' => substr($order->customer['email_address'], 0, 255), 'BillingSurname' => substr($order->billing['lastname'], 0, 20), @@ -202,17 +208,17 @@ function process_button() { $params['Crypt'] = $this->encryptParams($crypt_string); foreach ($params as $key => $value) { - $process_button_string .= tep_draw_hidden_field($key, $value); + $process_button_string .= HTML::hiddenField($key, $value); } return $process_button_string; } function before_process() { - global $HTTP_GET_VARS, $sage_pay_response; + global $sage_pay_response; - if (isset($HTTP_GET_VARS['crypt']) && tep_not_null($HTTP_GET_VARS['crypt'])) { - $transaction_response = $this->decryptParams($HTTP_GET_VARS['crypt']); + if (isset($_GET['crypt']) && tep_not_null($_GET['crypt'])) { + $transaction_response = $this->decryptParams($_GET['crypt']); $string_array = explode('&', $transaction_response); $sage_pay_response = array('Status' => null); @@ -229,16 +235,18 @@ function before_process() { $error = $this->getErrorMessageNumber($sage_pay_response['StatusDetail']); - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL'); } } else { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code, 'SSL'); } } function after_process() { global $insert_id, $sage_pay_response; + $OSCOM_Db = Registry::get('Db'); + $result = array(); if ( isset($sage_pay_response['VPSTxId']) ) { @@ -289,20 +297,18 @@ function after_process() { 'customer_notified' => '0', 'comments' => trim($result_string)); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); + $OSCOM_Db->save('orders_status_history', $sql_data_array); } function get_error() { - global $HTTP_GET_VARS; - $message = MODULE_PAYMENT_SAGE_PAY_FORM_ERROR_GENERAL; $error_number = null; - if ( isset($HTTP_GET_VARS['error']) && is_numeric($HTTP_GET_VARS['error']) && $this->errorMessageNumberExists($HTTP_GET_VARS['error']) ) { - $error_number = $HTTP_GET_VARS['error']; - } elseif (isset($HTTP_GET_VARS['crypt']) && tep_not_null($HTTP_GET_VARS['crypt'])) { - $transaction_response = $this->decryptParams($HTTP_GET_VARS['crypt']); + if ( isset($_GET['error']) && is_numeric($_GET['error']) && $this->errorMessageNumberExists($_GET['error']) ) { + $error_number = $_GET['error']; + } elseif (isset($_GET['crypt']) && tep_not_null($_GET['crypt'])) { + $transaction_response = $this->decryptParams($_GET['crypt']); $string_array = explode('&', $transaction_response); $return = array('Status' => null); @@ -337,14 +343,12 @@ function get_error() { } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SAGE_PAY_FORM_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_PAYMENT_SAGE_PAY_FORM_STATUS'); } function install($parameter = null) { + $OSCOM_Db = Registry::get('Db'); + $params = $this->getParams(); if (isset($parameter)) { @@ -372,12 +376,12 @@ function install($parameter = null) { $sql_data_array['use_function'] = $data['use_func']; } - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); + $OSCOM_Db->save('configuration', $sql_data_array); } } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { @@ -395,29 +399,29 @@ function keys() { } function getParams() { + $OSCOM_Db = Registry::get('Db'); + if (!defined('MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sage Pay [Transactions]' limit 1"); + $Qcheck = $OSCOM_Db->get('orders_status', 'orders_status_id', ['orders_status_name' => 'Sage Pay [Transactions]'], null, 1); - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); + if ($Qcheck->fetch() === false) { + $Qstatus = $OSCOM_Db->get('orders_status', 'max(orders_status_id) as status_id'); - $status_id = $status['status_id']+1; + $status_id = $Qstatus->valueInt('status_id') + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Sage Pay [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); + $OSCOM_Db->save('orders_status', [ + 'orders_status_id' => $status_id, + 'language_id' => $lang['id'], + 'orders_status_name' => 'Sage Pay [Transactions]', + 'public_flag' => 0, + 'downloads_flag' => 0 + ]); } } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; + $status_id = $Qcheck->valueInt('orders_status_id'); } } else { $status_id = MODULE_PAYMENT_SAGE_PAY_FORM_TRANSACTION_ORDER_STATUS_ID; @@ -475,10 +479,10 @@ function getParams() { // format prices without currency formatting function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; + global $currencies; if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; + $currency_code = $_SESSION['currency']; } if (empty($currency_value) || !is_numeric($currency_value)) { @@ -580,8 +584,6 @@ function errorMessageNumberExists($number) { } function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_FORM_DEBUG_EMAIL)) { $email_body = ''; @@ -589,12 +591,12 @@ function sendDebugEmail($response = array()) { $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; } - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; + if (!empty($_POST)) { + $email_body .= '$_POST:' . "\n\n" . print_r($_POST, true) . "\n\n"; } - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; + if (!empty($_GET)) { + $email_body .= '$_GET:' . "\n\n" . print_r($_GET, true) . "\n\n"; } if (!empty($email_body)) { @@ -613,6 +615,6 @@ function sage_pay_form_clip_text($value) { } function sage_pay_form_textarea_field($value = '', $key = '') { - return tep_draw_textarea_field('configuration[' . $key . ']', 'soft', 60, 5, $value); + return HTML::textareaField('configuration[' . $key . ']', 60, 5, $value); } ?> diff --git a/catalog/includes/modules/payment/sage_pay_server.php b/catalog/includes/modules/payment/sage_pay_server.php index 50fe1e045..76b2c2f1c 100644 --- a/catalog/includes/modules/payment/sage_pay_server.php +++ b/catalog/includes/modules/payment/sage_pay_server.php @@ -5,16 +5,21 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\HTTP; + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sage_pay_server { var $code, $title, $description, $enabled; function sage_pay_server() { - global $HTTP_GET_VARS, $PHP_SELF, $order; + global $PHP_SELF, $order; $this->signature = 'sage_pay|sage_pay_server|2.1|2.3'; $this->api_version = '3.00'; @@ -56,7 +61,7 @@ function sage_pay_server() { } } - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { + if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == 'modules.php') && isset($_GET['action']) && ($_GET['action'] == 'install') && isset($_GET['subaction']) && ($_GET['subaction'] == 'conntest') ) { echo $this->getTestConnectionResult(); exit; } @@ -65,14 +70,16 @@ function sage_pay_server() { function update_status() { global $order; + $OSCOM_Db = Registry::get('Db'); + if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE, 'zone_country_id' => $order->billing['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->billing['zone_id']) { $check_flag = true; break; } @@ -106,45 +113,45 @@ function process_button() { } function before_process() { - global $HTTP_GET_VARS, $HTTP_POST_VARS, $sagepay_server_skey_code, $sagepay_server_transaction_details, $sage_pay_server_nexturl, $customer_id, $order, $currency, $order_totals, $cartID; + global $sagepay_server_transaction_details, $order, $order_totals; + + $OSCOM_Db = Registry::get('Db'); $sagepay_server_transaction_details = null; $error = null; - if (isset($HTTP_GET_VARS['check']) && ($HTTP_GET_VARS['check'] == 'PROCESS')) { - if ( isset($HTTP_GET_VARS['skcode']) && tep_session_is_registered('sagepay_server_skey_code') && ($HTTP_GET_VARS['skcode'] == $sagepay_server_skey_code) ) { - $skcode = tep_db_prepare_input($HTTP_GET_VARS['skcode']); + if (isset($_GET['check']) && ($_GET['check'] == 'PROCESS')) { + if ( isset($_GET['skcode']) && isset($_SESSION['sagepay_server_skey_code']) && ($_GET['skcode'] == $_SESSION['sagepay_server_skey_code']) ) { + $skcode = HTML::sanitize($_GET['skcode']); - $sp_query = tep_db_query('select verified, transaction_details from sagepay_server_securitykeys where code = "' . tep_db_input($skcode) . '" limit 1'); + $Qsp = $OSCOM_Db->get('sagepay_server_securitykeys', ['verified', 'transaction_details'], ['code' => $skcode], null, 1); - if ( tep_db_num_rows($sp_query) ) { - $sp = tep_db_fetch_array($sp_query); + if ($Qsp->fetch() !== false) { + unset($_SESSION['sagepay_server_skey_code']); - tep_session_unregister('sagepay_server_skey_code'); - tep_db_query('delete from sagepay_server_securitykeys where code = "' . tep_db_input($skcode) . '"'); + $OSCOM_Db->delete('sagepay_server_securitykeys', ['code' => $skcode]); - if ( $sp['verified'] == '1' ) { - $sagepay_server_transaction_details = $sp['transaction_details']; + if ( $Qsp->value('verified') == '1' ) { + $sagepay_server_transaction_details = $Qsp->value('transaction_details'); return true; } } } } else { - if ( !tep_session_is_registered('sagepay_server_skey_code') ) { - tep_session_register('sagepay_server_skey_code'); - $sagepay_server_skey_code = tep_create_random_value(16); + if ( !isset($_SESSION['sagepay_server_skey_code']) ) { + $_SESSION['sagepay_server_skey_code'] = tep_create_random_value(16); } $params = array('VPSProtocol' => $this->api_version, 'ReferrerID' => 'C74D7B82-E9EB-4FBD-93DB-76F0F551C802', 'Vendor' => substr(MODULE_PAYMENT_SAGE_PAY_SERVER_VENDOR_LOGIN_NAME, 0, 15), - 'VendorTxCode' => substr(date('YmdHis') . '-' . $customer_id . '-' . $cartID, 0, 40), + 'VendorTxCode' => substr(date('YmdHis') . '-' . $_SESSION['customer_id'] . '-' . $_SESSION['cartID'], 0, 40), 'Amount' => $this->format_raw($order->info['total']), - 'Currency' => $currency, + 'Currency' => $_SESSION['currency'], 'Description' => substr(STORE_NAME, 0, 100), - 'NotificationURL' => $this->formatURL(tep_href_link('ext/modules/payment/sage_pay/server.php', 'check=SERVER&skcode=' . $sagepay_server_skey_code, 'SSL', false)), + 'NotificationURL' => $this->formatURL(OSCOM::link('ext/modules/payment/sage_pay/server.php', 'check=SERVER&skcode=' . $_SESSION['sagepay_server_skey_code'], 'SSL', false)), 'BillingSurname' => substr($order->billing['lastname'], 0, 20), 'BillingFirstnames' => substr($order->billing['firstname'], 0, 20), 'BillingAddress1' => substr($order->billing['street_address'], 0, 100), @@ -233,28 +240,26 @@ function before_process() { } if ($return['Status'] == 'OK') { - $sp_query = tep_db_query('select id, securitykey from sagepay_server_securitykeys where code = "' . tep_db_input($sagepay_server_skey_code) . '" limit 1'); + $Qsp = $OSCOM_Db->get('sagepay_server_securitykeys', ['id', 'securitykey'], ['code' => $_SESSION['sagepay_server_skey_code']], null, 1); - if ( tep_db_num_rows($sp_query) ) { - $sp = tep_db_fetch_array($sp_query); - - if ( $sp['securitykey'] != $return['SecurityKey'] ) { - tep_db_query('update sagepay_server_securitykeys set securitykey = "' . tep_db_input($return['SecurityKey']) . '", date_added = now() where id = "' . (int)$sp['id'] . '"'); + if ($Qsp->fetch() !== false) { + if ( $Qsp->value('securitykey') != $return['SecurityKey'] ) { + $OSCOM_Db->save('sagepay_server_securitykeys', ['securitykey' => $return['SecurityKey'], 'date_added' => 'now()'], ['id' => $Qsp->valueInt('id')]); } } else { - tep_db_query('insert into sagepay_server_securitykeys (code, securitykey, date_added) values ("' . tep_db_input($sagepay_server_skey_code) . '", "' . tep_db_input($return['SecurityKey']) . '", now())'); + $OSCOM_Db->save('sagepay_server_securitykeys', [ + 'code' => $_SESSION['sagepay_server_skey_code'], + 'securitykey' => $return['SecurityKey'], + 'date_added' => 'now()' + ]); } if ( MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE == 'Normal' ) { - tep_redirect($return['NextURL']); + HTTP::redirect($return['NextURL']); } else { - if ( !tep_session_is_registered('sage_pay_server_nexturl') ) { - tep_session_register('sage_pay_server_nexturl'); - } + $_SESSION['sage_pay_server_nexturl'] = $return['NextURL']; - $sage_pay_server_nexturl = $return['NextURL']; - - tep_redirect(tep_href_link('ext/modules/payment/sage_pay/checkout.php', '', 'SSL')); + OSCOM::redirect('ext/modules/payment/sage_pay/checkout.php', '', 'SSL'); } } else { $error = $this->getErrorMessageNumber($return['StatusDetail']); @@ -263,47 +268,45 @@ function before_process() { } } - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL')); + OSCOM::redirect('checkout_payment.php', 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : ''), 'SSL'); } function after_process() { global $insert_id, $sagepay_server_transaction_details; + $OSCOM_Db = Registry::get('Db'); + $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => trim($sagepay_server_transaction_details)); - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); + $OSCOM_Db->save('orders_status_history', $sql_data_array); if ( MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE == 'Low' ) { - global $cart; - - $cart->reset(true); + $_SESSION['cart']->reset(true); // unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); + unset($_SESSION['sendto']); + unset($_SESSION['billto']); + unset($_SESSION['shipping']); + unset($_SESSION['payment']); + unset($_SESSION['comments']); - tep_session_unregister('sage_pay_server_nexturl'); + unset($_SESSION['sage_pay_server_nexturl']); - tep_redirect(tep_href_link('ext/modules/payment/sage_pay/redirect.php', '', 'SSL')); + OSCOM::redirect('ext/modules/payment/sage_pay/redirect.php', '', 'SSL'); } } function get_error() { - global $HTTP_GET_VARS; - $message = MODULE_PAYMENT_SAGE_PAY_SERVER_ERROR_GENERAL; $error_number = null; - if ( isset($HTTP_GET_VARS['error']) && is_numeric($HTTP_GET_VARS['error']) && $this->errorMessageNumberExists($HTTP_GET_VARS['error']) ) { - $error_number = $HTTP_GET_VARS['error']; + if ( isset($_GET['error']) && is_numeric($_GET['error']) && $this->errorMessageNumberExists($_GET['error']) ) { + $error_number = $_GET['error']; } if ( isset($error_number) ) { @@ -322,14 +325,12 @@ function get_error() { } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SAGE_PAY_SERVER_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_PAYMENT_SAGE_PAY_SERVER_STATUS'); } function install($parameter = null) { + $OSCOM_Db = Registry::get('Db'); + $params = $this->getParams(); if (isset($parameter)) { @@ -357,12 +358,12 @@ function install($parameter = null) { $sql_data_array['use_function'] = $data['use_func']; } - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); + $OSCOM_Db->save('configuration', $sql_data_array); } } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { @@ -380,7 +381,11 @@ function keys() { } function getParams() { - if ( tep_db_num_rows(tep_db_query("show tables like 'sagepay_server_securitykeys'")) != 1 ) { + $OSCOM_Db = Registry::get('Db'); + + $Qcheck = $OSCOM_Db->query('show tables like "sagepay_server_securitykeys"'); + + if ($Qcheck->fetch() === false) { $sql = <<exec($sql); } if (!defined('MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID')) { - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sage Pay [Transactions]' limit 1"); + $Qcheck = $OSCOM_Db->get('orders_status', 'orders_status_id', ['orders_status_name' => 'Sage Pay [Transactions]'], null, 1); - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); + if ($Qcheck->fetch() === false) { + $Qstatus = $OSCOM_Db->get('orders_status', 'max(orders_status_id) as status_id'); - $status_id = $status['status_id']+1; + $status_id = $Qstatus->valueInt('status_id') + 1; $languages = tep_get_languages(); foreach ($languages as $lang) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $lang['id'] . "', 'Sage Pay [Transactions]')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); + $OSCOM_Db->save('orders_status', [ + 'orders_status_id' => $status_id, + 'language_id' => $lang['id'], + 'orders_status_name' => 'Sage Pay [Transactions]', + 'public_flag' => 0, + 'downloads_flag' => 0 + ]); } } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; + $status_id = $Qcheck->valueInt('orders_status_id'); } } else { $status_id = MODULE_PAYMENT_SAGE_PAY_SERVER_TRANSACTION_ORDER_STATUS_ID; @@ -521,10 +524,10 @@ function sendTransactionToGateway($url, $parameters) { // format prices without currency formatting function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; + global $currencies; if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; + $currency_code = $_SESSION['currency']; } if (empty($currency_value) || !is_numeric($currency_value)) { @@ -590,7 +593,7 @@ function getTestLinkInfo() { $dialog_error = MODULE_PAYMENT_SAGE_PAY_SERVER_DIALOG_CONNECTION_ERROR; $dialog_connection_time = MODULE_PAYMENT_SAGE_PAY_SERVER_DIALOG_CONNECTION_TIME; - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); + $test_url = OSCOM::link('modules.php', 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); $js = << @@ -691,8 +694,6 @@ function getTestConnectionResult() { } function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - if (tep_not_null(MODULE_PAYMENT_SAGE_PAY_SERVER_DEBUG_EMAIL)) { $email_body = ''; @@ -700,12 +701,12 @@ function sendDebugEmail($response = array()) { $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; } - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; + if (!empty($_POST)) { + $email_body .= '$_POST:' . "\n\n" . print_r($_POST, true) . "\n\n"; } - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; + if (!empty($_GET)) { + $email_body .= '$_GET:' . "\n\n" . print_r($_GET, true) . "\n\n"; } if (!empty($email_body)) { diff --git a/catalog/includes/modules/payment/sofortueberweisung_direct.php b/catalog/includes/modules/payment/sofortueberweisung_direct.php deleted file mode 100755 index b8cb4ed5b..000000000 --- a/catalog/includes/modules/payment/sofortueberweisung_direct.php +++ /dev/null @@ -1,610 +0,0 @@ -code = 'sofortueberweisung_direct'; - $this->title = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_DESCRIPTION; - $this->sort_order = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_SORT_ORDER; - $this->enabled = ((MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS == 'True') ? true : false); - - if ((int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID > 0) { - $this->order_status = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID; - } - - if (is_object($order)) $this->update_status(); - - $this->email_footer = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_EMAIL_FOOTER; - - $this->form_action_url = 'https://www.sofort-ueberweisung.de/payment.php'; - } - -// class methods - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->billing['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - global $cart_Sofortueberweisung_Direct_ID; - - if (tep_session_is_registered('cart_Sofortueberweisung_Direct_ID')) { - $order_id = substr($cart_Sofortueberweisung_Direct_ID, strpos($cart_Sofortueberweisung_Direct_ID, '-')+1); - - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - - tep_session_unregister('cart_Sofortueberweisung_Direct_ID'); - } - } - - return array('id' => $this->code, - 'module' => $this->public_title, - 'fields' => array(array('title' => MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_DESCRIPTION_CHECKOUT_PAYMENT))); - } - - function pre_confirmation_check() { - global $cartID, $cart; - - // We need the cartID - if (empty($cart->cartID)) { - $cartID = $cart->cartID = $cart->generate_cart_id(); - } - - if (!tep_session_is_registered('cartID')) { - tep_session_register('cartID'); - } - } - - function confirmation() { - global $cartID, $cart_Sofortueberweisung_Direct_ID, $customer_id, $languages_id, $order, $order_total_modules; - - $insert_order = false; - - if (tep_session_is_registered('cart_Sofortueberweisung_Direct_ID')) { - $order_id = substr($cart_Sofortueberweisung_Direct_ID, strpos($cart_Sofortueberweisung_Direct_ID, '-')+1); - - $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); - $curr = tep_db_fetch_array($curr_check); - - if ( ($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_Sofortueberweisung_Direct_ID, 0, strlen($cartID))) ) { - $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); - - if (tep_db_num_rows($check_query) < 1) { - tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); - tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); - } - - $insert_order = true; - } - } else { - $insert_order = true; - } - - if ($insert_order == true) { - $order_totals = array(); - if (is_array($order_total_modules->modules)) { - reset($order_total_modules->modules); - while (list(, $value) = each($order_total_modules->modules)) { - $class = substr($value, 0, strrpos($value, '.')); - if ($GLOBALS[$class]->enabled) { - for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { - if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { - $order_totals[] = array('code' => $GLOBALS[$class]->code, - 'title' => $GLOBALS[$class]->output[$i]['title'], - 'text' => $GLOBALS[$class]->output[$i]['text'], - 'value' => $GLOBALS[$class]->output[$i]['value'], - 'sort_order' => $GLOBALS[$class]->sort_order); - } - } - } - } - } - - $sql_data_array = array('customers_id' => $customer_id, - 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], - 'customers_company' => $order->customer['company'], - 'customers_street_address' => $order->customer['street_address'], - 'customers_suburb' => $order->customer['suburb'], - 'customers_city' => $order->customer['city'], - 'customers_postcode' => $order->customer['postcode'], - 'customers_state' => $order->customer['state'], - 'customers_country' => $order->customer['country']['title'], - 'customers_telephone' => $order->customer['telephone'], - 'customers_email_address' => $order->customer['email_address'], - 'customers_address_format_id' => $order->customer['format_id'], - 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], - 'delivery_company' => $order->delivery['company'], - 'delivery_street_address' => $order->delivery['street_address'], - 'delivery_suburb' => $order->delivery['suburb'], - 'delivery_city' => $order->delivery['city'], - 'delivery_postcode' => $order->delivery['postcode'], - 'delivery_state' => $order->delivery['state'], - 'delivery_country' => $order->delivery['country']['title'], - 'delivery_address_format_id' => $order->delivery['format_id'], - 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], - 'billing_company' => $order->billing['company'], - 'billing_street_address' => $order->billing['street_address'], - 'billing_suburb' => $order->billing['suburb'], - 'billing_city' => $order->billing['city'], - 'billing_postcode' => $order->billing['postcode'], - 'billing_state' => $order->billing['state'], - 'billing_country' => $order->billing['country']['title'], - 'billing_address_format_id' => $order->billing['format_id'], - 'payment_method' => $order->info['payment_method'], - 'cc_type' => $order->info['cc_type'], - 'cc_owner' => $order->info['cc_owner'], - 'cc_number' => $order->info['cc_number'], - 'cc_expires' => $order->info['cc_expires'], - 'date_purchased' => 'now()', - 'orders_status' => $order->info['order_status'], - 'currency' => $order->info['currency'], - 'currency_value' => $order->info['currency_value']); - - tep_db_perform(TABLE_ORDERS, $sql_data_array); - - $insert_id = tep_db_insert_id(); - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'title' => $order_totals[$i]['title'], - 'text' => $order_totals[$i]['text'], - 'value' => $order_totals[$i]['value'], - 'class' => $order_totals[$i]['code'], - 'sort_order' => $order_totals[$i]['sort_order']); - - tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); - } - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { - $sql_data_array = array('orders_id' => $insert_id, - 'products_id' => tep_get_prid($order->products[$i]['id']), - 'products_model' => $order->products[$i]['model'], - 'products_name' => $order->products[$i]['name'], - 'products_price' => $order->products[$i]['price'], - 'final_price' => $order->products[$i]['final_price'], - 'products_tax' => $order->products[$i]['tax'], - 'products_quantity' => $order->products[$i]['qty']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array); - - $order_products_id = tep_db_insert_id(); - - $attributes_exist = '0'; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'products_options' => $attributes_values['products_options_name'], - 'products_options_values' => $attributes_values['products_options_values_name'], - 'options_values_price' => $attributes_values['options_values_price'], - 'price_prefix' => $attributes_values['price_prefix']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array); - - if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) { - $sql_data_array = array('orders_id' => $insert_id, - 'orders_products_id' => $order_products_id, - 'orders_products_filename' => $attributes_values['products_attributes_filename'], - 'download_maxdays' => $attributes_values['products_attributes_maxdays'], - 'download_count' => $attributes_values['products_attributes_maxcount']); - - tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array); - } - } - } - } - - $cart_Sofortueberweisung_Direct_ID = $cartID . '-' . $insert_id; - tep_session_register('cart_Sofortueberweisung_Direct_ID'); - } - - return array('title' => MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_DESCRIPTION_CHECKOUT_CONFIRMATION); - } - - function process_button() { - global $order, $cart, $customer_id, $currencies, $cart_Sofortueberweisung_Direct_ID; - - $order_id = substr($cart_Sofortueberweisung_Direct_ID, strpos($cart_Sofortueberweisung_Direct_ID, '-')+1); - - $parameter= array(); - $parameter['kdnr'] = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_KDNR; // Repräsentiert Ihre Kundennummer bei der Sofortüberweisung - $parameter['projekt'] = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PROJEKT; // Die verantwortliche Projektnummer bei der Sofortüberweisung, zu der die Zahlung gehört - $parameter['betrag'] = number_format($order->info['total'] * $currencies->get_value('EUR'), 2, '.',''); // Beziffert den Zahlungsbetrag, der an Sie übermittelt werden soll - $vzweck1 = str_replace('{{orderid}}', $order_id, MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_V_ZWECK_1); - $vzweck2 = str_replace('{{orderid}}', $order_id, MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_V_ZWECK_2); - - $vzweck1 = str_replace('{{order_date}}', strftime(DATE_FORMAT_SHORT), $vzweck1); - $vzweck2 = str_replace('{{order_date}}', strftime(DATE_FORMAT_SHORT), $vzweck2); - - $vzweck1 = str_replace('{{customer_id}}', $customer_id, $vzweck1); - $vzweck2 = str_replace('{{customer_id}}', $customer_id, $vzweck2); - - $vzweck1 = str_replace('{{customer_name}}', $order->customer['firstname'] . ' ' . $order->customer['lastname'], $vzweck1); - $vzweck2 = str_replace('{{customer_name}}', $order->customer['firstname'] . ' ' . $order->customer['lastname'], $vzweck2); - - $vzweck1 = str_replace('{{customer_company}}', $order->customer['company'], $vzweck1); - $vzweck2 = str_replace('{{customer_company}}', $order->customer['company'], $vzweck2); - - $vzweck1 = str_replace('{{customer_email}}', $order->customer['email_address'], $vzweck1); - $vzweck2 = str_replace('{{customer_email}}', $order->customer['email_address'], $vzweck2); - - // Kürzen auf 27 Zeichen - $vzweck1 = substr($vzweck1, 0, 27); - $vzweck2 = substr($vzweck2, 0, 27); - - $parameter['v_zweck_1'] = tep_output_string($vzweck1); // Definieren Sie hier Ihre Verwendungszwecke - $parameter['v_zweck_2'] = tep_output_string($vzweck2); // Definieren Sie hier Ihre Verwendungszwecke - - $parameter['kunden_var_0'] = tep_output_string($order_id); // Eindeutige Identifikation der Zahlung, z.B. Session ID oder Auftragsnummer. - $parameter['kunden_var_1'] = tep_output_string($customer_id); - $parameter['kunden_var_2'] = tep_output_string(tep_session_id()); - $parameter['kunden_var_3'] = tep_output_string($cart->cartID); - $parameter['kunden_var_4'] = ''; - $parameter['kunden_var_5'] = ''; - // $parameter['Partner'] = ''; - - if (strlen(MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT) > 0) { - $tmparray = array( - $parameter['betrag'], - $parameter['v_zweck_1'], - $parameter['v_zweck_2'], - '', // von_konto_inhaber - '', // von_konto_nr - '', // von_konto_blz - $parameter['kunden_var_0'], - $parameter['kunden_var_1'], - $parameter['kunden_var_2'], - $parameter['kunden_var_3'], - $parameter['kunden_var_4'], - $parameter['kunden_var_5'], - MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT); - $parameter['key'] = md5(implode("|", $tmparray)); - } - $process_button_string = ''; - reset($parameter); - while (list($key, $value) = each($parameter)) { - $process_button_string .= tep_draw_hidden_field($key, $value). "\n"; - } - - return $process_button_string; - } - - function before_process() { - global $HTTP_GET_VARS, $customer_id, $order, $order_totals, $sendto, $billto, $languages_id, $payment, $currencies, $cart, $cart_Sofortueberweisung_Direct_ID; - global $$payment; - - $md5var4 = md5($HTTP_GET_VARS['sovar3'] . MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_CNT_PASSWORT); - // Statusupdate nur wenn keine Cartänderung vorgenommen - $order_total_integer = number_format($order->info['total'] * $currencies->get_value('EUR'), 2, '.','')*100; - if ($order_total_integer < 1) { - $order_total_integer = '000'; - } elseif ($order_total_integer < 10) { - $order_total_integer = '00' . $order_total_integer; - } elseif ($order_total_integer < 100) { - $order_total_integer = '0' . $order_total_integer; - } - - $order_id = substr($cart_Sofortueberweisung_Direct_ID, strpos($cart_Sofortueberweisung_Direct_ID, '-')+1); - - $check_query = tep_db_query("select orders_status from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); - if (tep_db_num_rows($check_query)) { - $check = tep_db_fetch_array($check_query); - - if ($check['orders_status'] == MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID) { - $sql_data_array = array('orders_id' => $order_id, - 'orders_status_id' => MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => ''); - - if (($md5var4 == $HTTP_GET_VARS['sovar4']) && ((int)$HTTP_GET_VARS['betrag_integer'] == (int)$order_total_integer)) { - $sql_data_array['comments'] = 'Zahlung durch Sofortüberweisung Weiter-Button/Weiterleitung bestätigt!'; - } else { - $sql_data_array['comments'] = MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_CHECK_ERROR . '\n' . ($HTTP_GET_VARS['betrag_integer']/100) . '!=' . ($order_total_integer/100); - } - - if (MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STORE_TRANSACTION_DETAILS == 'True') { - $sql_data_array['comments'] = (!empty($sql_data_array['comments']) ? $sql_data_array['comments'] . "\n\n" : '') . serialize($HTTP_GET_VARS) . "\n" . serialize($HTTP_POST_VARS); - } - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - } - } - - tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . (MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID) . "', last_modified = now() where orders_id = '" . (int)$order_id . "'"); - - $sql_data_array = array('orders_id' => $order_id, - 'orders_status_id' => (MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID > 0 ? (int)MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID : (int)DEFAULT_ORDERS_STATUS_ID), - 'date_added' => 'now()', - 'customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0', - 'comments' => $order->info['comments']); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - -// initialized for the email confirmation - $products_ordered = ''; - $subtotal = 0; - $total_tax = 0; - - for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { -// Stock Update - Joao Correia - if (STOCK_LIMITED == 'true') { - if (DOWNLOAD_ENABLED == 'true') { - $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename - FROM " . TABLE_PRODUCTS . " p - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa - ON p.products_id=pa.products_id - LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - ON pa.products_attributes_id=pad.products_attributes_id - WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; -// Will work with only one option for downloadable products -// otherwise, we have to build the query dynamically with a loop - $products_attributes = $order->products[$i]['attributes']; - if (is_array($products_attributes)) { - $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'"; - } - $stock_query = tep_db_query($stock_query_raw); - } else { - $stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - if (tep_db_num_rows($stock_query) > 0) { - $stock_values = tep_db_fetch_array($stock_query); -// do not decrement quantities if products_attributes_filename exists - if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { - $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; - } else { - $stock_left = $stock_values['products_quantity']; - } - tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { - tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - } - } - } - -// Update products_ordered (for bestsellers list) - tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); - -//------insert customer choosen option to order-------- - $attributes_exist = '0'; - $products_ordered_attributes = ''; - if (isset($order->products[$i]['attributes'])) { - $attributes_exist = '1'; - for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { - if (DOWNLOAD_ENABLED == 'true') { - $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename - from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa - left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad - on pa.products_attributes_id=pad.products_attributes_id - where pa.products_id = '" . $order->products[$i]['id'] . "' - and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' - and pa.options_id = popt.products_options_id - and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' - and pa.options_values_id = poval.products_options_values_id - and popt.language_id = '" . $languages_id . "' - and poval.language_id = '" . $languages_id . "'"; - $attributes = tep_db_query($attributes_query); - } else { - $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); - } - $attributes_values = tep_db_fetch_array($attributes); - - $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; - } - } -//------insert customer choosen option eof ---- - $total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']); - $total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; - $total_cost += $total_products_price; - - $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; - } - -// lets start with the email confirmation - $email_order = STORE_NAME . "\n" . - EMAIL_SEPARATOR . "\n" . - EMAIL_TEXT_ORDER_NUMBER . ' ' . $order_id . "\n" . - EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $order_id, 'SSL', false) . "\n" . - EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; - if ($order->info['comments']) { - $email_order .= tep_db_output($order->info['comments']) . "\n\n"; - } - $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . - EMAIL_SEPARATOR . "\n" . - $products_ordered . - EMAIL_SEPARATOR . "\n"; - - for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { - $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; - } - - if ($order->content_type != 'virtual') { - $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n"; - } - - $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" . - EMAIL_SEPARATOR . "\n" . - tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n"; - - if (is_object($$payment)) { - $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . - EMAIL_SEPARATOR . "\n"; - $payment_class = $$payment; - $email_order .= $payment_class->title . "\n\n"; - if ($payment_class->email_footer) { - $email_order .= $payment_class->email_footer . "\n\n"; - } - } - - tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - -// send emails to other people - if (SEND_EXTRA_ORDER_EMAILS_TO != '') { - tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - -// load the after_process function from the payment modules - $this->after_process(); - - $cart->reset(true); - -// unregister session variables used during checkout - tep_session_unregister('sendto'); - tep_session_unregister('billto'); - tep_session_unregister('shipping'); - tep_session_unregister('payment'); - tep_session_unregister('comments'); - - tep_session_unregister('cart_Sofortueberweisung_Direct_ID'); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); - } - - function after_process() { - return false; - } - - function get_error() { - global $HTTP_GET_VARS; - - $error = array('title' => MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_ERROR_HEADING, - 'error' => MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_TEXT_ERROR_MESSAGE); - - return $error; - } - - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install() { - global $HTTP_GET_VARS; - - $kdnr = (isset($HTTP_GET_VARS['kdnr']) && !empty($HTTP_GET_VARS['kdnr'])) ? tep_db_prepare_input($HTTP_GET_VARS['kdnr']) : '10000'; - $projekt = (isset($HTTP_GET_VARS['projekt']) && !empty($HTTP_GET_VARS['projekt'])) ? tep_db_prepare_input($HTTP_GET_VARS['projekt']) : '500000'; - $input_passwort = (isset($HTTP_GET_VARS['input_passwort']) && !empty($HTTP_GET_VARS['input_passwort'])) ? tep_db_prepare_input($HTTP_GET_VARS['input_passwort']) : ''; - $bna_passwort = (isset($HTTP_GET_VARS['bna_passwort']) && !empty($HTTP_GET_VARS['bna_passwort'])) ? tep_db_prepare_input($HTTP_GET_VARS['bna_passwort']) : ''; - $cnt_passwort = (isset($HTTP_GET_VARS['cnt_passwort']) && !empty($HTTP_GET_VARS['cnt_passwort'])) ? tep_db_prepare_input($HTTP_GET_VARS['cnt_passwort']) : ''; - - $check_query = tep_db_query("select orders_status_id from " . TABLE_ORDERS_STATUS . " where orders_status_name = 'Sofortüberweisung Vorbereitung' limit 1"); - - if (tep_db_num_rows($check_query) < 1) { - $status_query = tep_db_query("select max(orders_status_id) as status_id from " . TABLE_ORDERS_STATUS); - $status = tep_db_fetch_array($status_query); - - $status_id = $status['status_id']+1; - - $languages = tep_get_languages(); - - for ($i=0, $n=sizeof($languages); $i<$n; $i++) { - tep_db_query("insert into " . TABLE_ORDERS_STATUS . " (orders_status_id, language_id, orders_status_name) values ('" . $status_id . "', '" . $languages[$i]['id'] . "', 'Sofortüberweisung Vorbereitung')"); - } - - $flags_query = tep_db_query("describe " . TABLE_ORDERS_STATUS . " public_flag"); - if (tep_db_num_rows($flags_query) == 1) { - tep_db_query("update " . TABLE_ORDERS_STATUS . " set public_flag = 0 and downloads_flag = 0 where orders_status_id = '" . $status_id . "'"); - } - } else { - $check = tep_db_fetch_array($check_query); - - $status_id = $check['orders_status_id']; - } - - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Sofortüberweisung direkter Modus aktivieren', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS', 'True', 'Bezahlung per Sofortüberweisung acceptieren?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Kundennummer:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_KDNR', '" . (int)$kdnr . "', 'Ihre Kundennummer bei der Sofortüberweisung', '6', '1', now());"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Projektnummer:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PROJEKT', '" . (int)$projekt . "', 'Die verantwortliche Projektnummer bei der Sofortüberweisung, zu der die Zahlung gehört', '6', '1', now());"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Input-Passwort:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT', '" . tep_db_input($input_passwort) . "', 'Das Input-Passwort (unter Nicht änderbare Parameter / Input-Passwort)', '6', '1', now());"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Benachrichtigung-Passwort:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_BNA_PASSWORT', '" . tep_db_input($bna_passwort) . "', 'Das Benachrichtigung-Passwort (unter Benachrichtigungen festlegen)', '6', '1', now());"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Contentpasswort:', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_CNT_PASSWORT', '" . tep_db_input($cnt_passwort) . "', 'Das Contentpasswort (unter Content-Passwort)', '6', '1', now());"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID', '" . (int)$status_id . "', 'Order Status vor Eingang Bestellung', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID', '0', 'Order Status nach Eingang Bestellung', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Store Transactiondetails', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STORE_TRANSACTION_DETAILS', 'False', 'Transactionsdetails bei Benachrichtigung in das Kommentarfeld speichern (zum debuggen, ist für Kunden via Konto sichtbar)', '6', '2', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now());"); - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STATUS', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_KDNR', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PROJEKT', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_INPUT_PASSWORT', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_BNA_PASSWORT', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_CNT_PASSWORT', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_STORE_TRANSACTION_DETAILS', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ZONE', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_PREPARE_ORDER_STATUS_ID', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_ORDER_STATUS_ID', 'MODULE_PAYMENT_SOFORTUEBERWEISUNG_DIRECT_SORT_ORDER'); - } - } -?> diff --git a/catalog/includes/modules/payment/stripe.php b/catalog/includes/modules/payment/stripe.php deleted file mode 100644 index 868c8a7e0..000000000 --- a/catalog/includes/modules/payment/stripe.php +++ /dev/null @@ -1,904 +0,0 @@ -signature = 'stripe|stripe|1.1|2.3'; - $this->api_version = '2014-05-19'; - - $this->code = 'stripe'; - $this->title = MODULE_PAYMENT_STRIPE_TEXT_TITLE; - $this->public_title = MODULE_PAYMENT_STRIPE_TEXT_PUBLIC_TITLE; - $this->description = MODULE_PAYMENT_STRIPE_TEXT_DESCRIPTION; - $this->sort_order = defined('MODULE_PAYMENT_STRIPE_SORT_ORDER') ? MODULE_PAYMENT_STRIPE_SORT_ORDER : 0; - $this->enabled = defined('MODULE_PAYMENT_STRIPE_STATUS') && (MODULE_PAYMENT_STRIPE_STATUS == 'True') ? true : false; - $this->order_status = defined('MODULE_PAYMENT_STRIPE_ORDER_STATUS_ID') && ((int)MODULE_PAYMENT_STRIPE_ORDER_STATUS_ID > 0) ? (int)MODULE_PAYMENT_STRIPE_ORDER_STATUS_ID : 0; - - if ( defined('MODULE_PAYMENT_STRIPE_STATUS') ) { - if ( MODULE_PAYMENT_STRIPE_TRANSACTION_SERVER == 'Test' ) { - $this->title .= ' [Test]'; - $this->public_title .= ' (' . $this->code . '; Test)'; - } - - $this->description .= $this->getTestLinkInfo(); - } - - if ( !function_exists('curl_init') ) { - $this->description = '
' . MODULE_PAYMENT_STRIPE_ERROR_ADMIN_CURL . '
' . $this->description; - - $this->enabled = false; - } - - if ( $this->enabled === true ) { - if ( !tep_not_null(MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY) || !tep_not_null(MODULE_PAYMENT_STRIPE_SECRET_KEY) ) { - $this->description = '
' . MODULE_PAYMENT_STRIPE_ERROR_ADMIN_CONFIGURATION . '
' . $this->description; - - $this->enabled = false; - } - } - - if ( $this->enabled === true ) { - if ( isset($order) && is_object($order) ) { - $this->update_status(); - } - } - - if ( defined('FILENAME_MODULES') && (basename($PHP_SELF) == FILENAME_MODULES) && isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'install') && isset($HTTP_GET_VARS['subaction']) && ($HTTP_GET_VARS['subaction'] == 'conntest') ) { - echo $this->getTestConnectionResult(); - exit; - } - } - - function update_status() { - global $order; - - if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_STRIPE_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_STRIPE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - } - - function javascript_validation() { - return false; - } - - function selection() { - global $customer_id, $payment; - - if ( (MODULE_PAYMENT_STRIPE_TOKENS == 'True') && !tep_session_is_registered('payment') ) { - $tokens_query = tep_db_query("select 1 from customers_stripe_tokens where customers_id = '" . (int)$customer_id . "' limit 1"); - - if ( tep_db_num_rows($tokens_query) ) { - $payment = $this->code; - tep_session_register('payment'); - } - } - - return array('id' => $this->code, - 'module' => $this->public_title); - } - - function pre_confirmation_check() { - global $oscTemplate; - - if ( $this->templateClassExists() ) { - $oscTemplate->addBlock($this->getSubmitCardDetailsJavascript(), 'header_tags'); - } - } - - function confirmation() { - global $customer_id, $order, $currencies, $currency; - - $months_array = array(); - - for ($i=1; $i<13; $i++) { - $months_array[] = array('id' => tep_output_string(sprintf('%02d', $i)), - 'text' => tep_output_string_protected(sprintf('%02d', $i))); - } - - $today = getdate(); - $years_array = array(); - - for ($i=$today['year']; $i < $today['year']+10; $i++) { - $years_array[] = array('id' => tep_output_string(strftime('%Y',mktime(0,0,0,1,1,$i))), - 'text' => tep_output_string_protected(strftime('%Y',mktime(0,0,0,1,1,$i)))); - } - - $months_string = ''; - - $years_string = ''; - - $content = ''; - - if ( MODULE_PAYMENT_STRIPE_TOKENS == 'True' ) { - $tokens_query = tep_db_query("select id, card_type, number_filtered, expiry_date from customers_stripe_tokens where customers_id = '" . (int)$customer_id . "' order by date_added"); - - if ( tep_db_num_rows($tokens_query) > 0 ) { - $content .= '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_TYPE . '' . tep_draw_pull_down_menu('cc_type', $card_types, '', 'id="sagepay_card_type"') . '' . HTML::selectField('cc_type', $card_types, '', 'id="sagepay_card_type"') . '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_OWNER . '' . tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'maxlength="50"') . '' . HTML::inputField('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'maxlength="50"') . '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_NUMBER . '' . tep_draw_input_field('cc_number_nh-dns', '', 'maxlength="20"') . '' . HTML::inputField('cc_number_nh-dns', '', 'maxlength="20"') . '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_STARTS . '' . tep_draw_pull_down_menu('cc_starts_month', $months_array, '', 'id="sagepay_card_date_start"') . ' ' . tep_draw_pull_down_menu('cc_starts_year', $year_valid_from_array) . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_STARTS_INFO . '' . HTML::selectField('cc_starts_month', $months_array, '', 'id="sagepay_card_date_start"') . ' ' . HTML::selectField('cc_starts_year', $year_valid_from_array) . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_STARTS_INFO . '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_EXPIRES . '' . tep_draw_pull_down_menu('cc_expires_month', $months_array) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $year_valid_to_array) . '' . HTML::selectField('cc_expires_month', $months_array) . ' ' . HTML::selectField('cc_expires_year', $year_valid_to_array) . '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_ISSUE_NUMBER . '' . tep_draw_input_field('cc_issue_nh-dns', '', 'id="sagepay_card_issue" size="3" maxlength="2"') . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_ISSUE_NUMBER_INFO . '' . HTML::inputField('cc_issue_nh-dns', '', 'id="sagepay_card_issue" size="3" maxlength="2"') . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_ISSUE_NUMBER_INFO . '
' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_CVC . '' . tep_draw_input_field('cc_cvc_nh-dns', '', 'size="5" maxlength="4"') . '' . HTML::inputField('cc_cvc_nh-dns', '', 'size="5" maxlength="4"') . '
 ' . tep_draw_checkbox_field('cc_save', 'true') . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_SAVE . '' . HTML::checkboxField('cc_save', 'true') . ' ' . MODULE_PAYMENT_SAGE_PAY_DIRECT_CREDIT_CARD_SAVE . '
'; - - while ( $tokens = tep_db_fetch_array($tokens_query) ) { - $content .= '' . - ' ' . - ' ' . - ''; - } - - $content .= '' . - ' ' . - ' ' . - '' . - '
' . tep_output_string_protected($tokens['card_type']) . '  ****' . tep_output_string_protected($tokens['number_filtered']) . '  ' . tep_output_string_protected(substr($tokens['expiry_date'], 0, 2) . '/' . substr($tokens['expiry_date'], 2)) . '
' . MODULE_PAYMENT_STRIPE_CREDITCARD_NEW . '
'; - } - } - - $content .= '
' . - '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - '' . - '' . - ' ' . - ' ' . - ''; - - if ( MODULE_PAYMENT_STRIPE_VERIFY_WITH_CVC == 'True' ) { - $content .= '' . - ' ' . - ' ' . - ''; - } - - if ( MODULE_PAYMENT_STRIPE_TOKENS == 'True' ) { - $content .= '' . - ' ' . - ' ' . - ''; - } - - $content .= '
' . MODULE_PAYMENT_STRIPE_CREDITCARD_OWNER . '
' . MODULE_PAYMENT_STRIPE_CREDITCARD_NUMBER . '
' . MODULE_PAYMENT_STRIPE_CREDITCARD_EXPIRY . '' . $months_string . ' / ' . $years_string . '
' . MODULE_PAYMENT_STRIPE_CREDITCARD_CVC . '
 ' . tep_draw_checkbox_field('cc_save', 'true') . ' ' . MODULE_PAYMENT_STRIPE_CREDITCARD_SAVE . '
'; - - $address = array('address_line1' => $order->billing['street_address'], - 'address_city' => $order->billing['city'], - 'address_zip' => $order->billing['postcode'], - 'address_state' => tep_get_zone_name($order->billing['country_id'], $order->billing['zone_id'], $order->billing['state']), - 'address_country' => $order->billing['country']['iso_code_2']); - - foreach ( $address as $k => $v ) { - $content .= ''; - } - - if ( !$this->templateClassExists() ) { - $content .= $this->getSubmitCardDetailsJavascript(); - } - - $confirmation = array('title' => $content); - - return $confirmation; - } - - function process_button() { - return false; - } - - function before_process() { - global $customer_id, $order, $currency, $HTTP_POST_VARS, $stripe_result, $stripe_error; - - $stripe_result = null; - - $params = array(); - - if ( MODULE_PAYMENT_STRIPE_TOKENS == 'True' ) { - if ( isset($HTTP_POST_VARS['stripe_card']) && is_numeric($HTTP_POST_VARS['stripe_card']) && ($HTTP_POST_VARS['stripe_card'] > 0) ) { - $token_query = tep_db_query("select stripe_token from customers_stripe_tokens where id = '" . (int)$HTTP_POST_VARS['stripe_card'] . "' and customers_id = '" . (int)$customer_id . "'"); - - if ( tep_db_num_rows($token_query) === 1 ) { - $token = tep_db_fetch_array($token_query); - - $stripe_token_array = explode(':|:', $token['stripe_token'], 2); - - $params['customer'] = $stripe_token_array[0]; - $params['card'] = $stripe_token_array[1]; - } else { - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=cardstored', 'SSL')); - } - } - } - - if ( empty($params) && isset($HTTP_POST_VARS['stripeToken']) && !empty($HTTP_POST_VARS['stripeToken']) ) { - if ( (MODULE_PAYMENT_STRIPE_TOKENS == 'True') && isset($HTTP_POST_VARS['cc_save']) && ($HTTP_POST_VARS['cc_save'] == 'true') ) { - $stripe_customer_id = $this->getCustomerID(); - $stripe_card_id = false; - - if ( $stripe_customer_id === false ) { - $stripe_customer_array = $this->createCustomer($HTTP_POST_VARS['stripeToken']); - - if ( ($stripe_customer_array !== false) && isset($stripe_customer_array['id']) ) { - $stripe_customer_id = $stripe_customer_array['id']; - $stripe_card_id = $stripe_customer_array['card_id']; - } - } else { - $stripe_card_id = $this->addCard($HTTP_POST_VARS['stripeToken'], $stripe_customer_id); - } - - if ( ($stripe_customer_id !== false) && ($stripe_card_id !== false) ) { - $params['customer'] = $stripe_customer_id; - $params['card'] = $stripe_card_id; - } - } else { - $params['card'] = $HTTP_POST_VARS['stripeToken']; - } - } - - if ( !empty($params) ) { - $params['amount'] = $this->format_raw($order->info['total']); - $params['currency'] = $currency; - $params['capture'] = (MODULE_PAYMENT_STRIPE_TRANSACTION_METHOD == 'Capture') ? 'true' : 'false'; - - $stripe_result = json_decode($this->sendTransactionToGateway('https://api.stripe.com/v1/charges', $params), true); - - if ( is_array($stripe_result) && !empty($stripe_result) ) { - if ( isset($stripe_result['object']) && ($stripe_result['object'] == 'charge') ) { - return true; - } - } - } - - if ( isset($stripe_result['error']['message']) ) { - tep_session_register('stripe_error'); - - $stripe_error = $stripe_result['error']['message']; - } - - $this->sendDebugEmail($stripe_result); - - tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL')); - } - - function after_process() { - global $insert_id, $customer_id, $stripe_result, $HTTP_POST_VARS; - - $status_comment = array('Transaction ID: ' . $stripe_result['id'], - 'CVC: ' . $stripe_result['card']['cvc_check']); - - if ( !empty($stripe_result['card']['address_line1_check']) ) { - $status_comment[] = 'Address Check: ' . $stripe_result['card']['address_line1_check']; - } - - if ( !empty($stripe_result['card']['address_zip_check']) ) { - $status_comment[] = 'ZIP Check: ' . $stripe_result['card']['address_zip_check']; - } - - if ( MODULE_PAYMENT_STRIPE_TOKENS == 'True' ) { - if ( isset($HTTP_POST_VARS['cc_save']) && ($HTTP_POST_VARS['cc_save'] == 'true') ) { - $status_comment[] = 'Token Saved: Yes'; - } elseif ( isset($HTTP_POST_VARS['stripe_card']) && is_numeric($HTTP_POST_VARS['stripe_card']) && ($HTTP_POST_VARS['stripe_card'] > 0) ) { - $status_comment[] = 'Token Used: Yes'; - } - } - - $sql_data_array = array('orders_id' => $insert_id, - 'orders_status_id' => MODULE_PAYMENT_STRIPE_TRANSACTION_ORDER_STATUS_ID, - 'date_added' => 'now()', - 'customer_notified' => '0', - 'comments' => implode("\n", $status_comment)); - - tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); - - if ( tep_session_is_registered('stripe_error') ) { - tep_session_unregister('stripe_error'); - } - } - - function get_error() { - global $HTTP_GET_VARS, $stripe_error; - - $message = MODULE_PAYMENT_STRIPE_ERROR_GENERAL; - - if ( tep_session_is_registered('stripe_error') ) { - $message = $stripe_error . ' ' . $message; - - tep_session_unregister('stripe_error'); - } - - if ( isset($HTTP_GET_VARS['error']) && !empty($HTTP_GET_VARS['error']) ) { - switch ($HTTP_GET_VARS['error']) { - case 'cardstored': - $message = MODULE_PAYMENT_STRIPE_ERROR_CARDSTORED; - break; - } - } - - $error = array('title' => MODULE_PAYMENT_STRIPE_ERROR_TITLE, - 'error' => $message); - - return $error; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_STRIPE_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install($parameter = null) { - $params = $this->getParams(); - - if (isset($parameter)) { - if (isset($params[$parameter])) { - $params = array($parameter => $params[$parameter]); - } else { - $params = array(); - } - } - - foreach ($params as $key => $data) { - $sql_data_array = array('configuration_title' => $data['title'], - 'configuration_key' => $key, - 'configuration_value' => (isset($data['value']) ? $data['value'] : ''), - 'configuration_description' => $data['desc'], - 'configuration_group_id' => '6', - 'sort_order' => '0', - 'date_added' => 'now()'); - - if (isset($data['set_func'])) { - $sql_data_array['set_function'] = $data['set_func']; - } - - if (isset($data['use_func'])) { - $sql_data_array['use_function'] = $data['use_func']; - } - - tep_db_perform(TABLE_CONFIGURATION, $sql_data_array); - } - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - $keys = array_keys($this->getParams()); - - if ($this->check()) { - foreach ($keys as $key) { - if (!defined($key)) { - $this->install($key); - } - } - } - - return $keys; - } - - function getParams() { - if ( tep_db_num_rows(tep_db_query("show tables like 'customers_stripe_tokens'")) != 1 ) { - $sql = << array('title' => 'Enable Stripe Module', - 'desc' => 'Do you want to accept Stripe payments?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY' => array('title' => 'Publishable API Key', - 'desc' => 'The Stripe account publishable API key to use.', - 'value' => ''), - 'MODULE_PAYMENT_STRIPE_SECRET_KEY' => array('title' => 'Secret API Key', - 'desc' => 'The Stripe account secret API key to use with the publishable key.', - 'value' => ''), - 'MODULE_PAYMENT_STRIPE_TOKENS' => array('title' => 'Create Tokens', - 'desc' => 'Create and store tokens for card payments customers can use on their next purchase?', - 'value' => 'False', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_STRIPE_VERIFY_WITH_CVC' => array('title' => 'Verify With CVC', - 'desc' => 'Verify the credit card billing address with the Card Verification Code (CVC)?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_STRIPE_TRANSACTION_METHOD' => array('title' => 'Transaction Method', - 'desc' => 'The processing method to use for each transaction.', - 'value' => 'Authorize', - 'set_func' => 'tep_cfg_select_option(array(\'Authorize\', \'Capture\'), '), - 'MODULE_PAYMENT_STRIPE_ORDER_STATUS_ID' => array('title' => 'Set Order Status', - 'desc' => 'Set the status of orders made with this payment module to this value', - 'value' => '0', - 'use_func' => 'tep_get_order_status_name', - 'set_func' => 'tep_cfg_pull_down_order_statuses('), - 'MODULE_PAYMENT_STRIPE_TRANSACTION_ORDER_STATUS_ID' => array('title' => 'Transaction Order Status', - 'desc' => 'Include transaction information in this order status level', - 'value' => $status_id, - 'set_func' => 'tep_cfg_pull_down_order_statuses(', - 'use_func' => 'tep_get_order_status_name'), - 'MODULE_PAYMENT_STRIPE_ZONE' => array('title' => 'Payment Zone', - 'desc' => 'If a zone is selected, only enable this payment method for that zone.', - 'value' => '0', - 'use_func' => 'tep_get_zone_class_title', - 'set_func' => 'tep_cfg_pull_down_zone_classes('), - 'MODULE_PAYMENT_STRIPE_TRANSACTION_SERVER' => array('title' => 'Transaction Server', - 'desc' => 'Perform transactions on the production server or on the testing server.', - 'value' => 'Live', - 'set_func' => 'tep_cfg_select_option(array(\'Live\', \'Test\'), '), - 'MODULE_PAYMENT_STRIPE_VERIFY_SSL' => array('title' => 'Verify SSL Certificate', - 'desc' => 'Verify gateway server SSL certificate on connection?', - 'value' => 'True', - 'set_func' => 'tep_cfg_select_option(array(\'True\', \'False\'), '), - 'MODULE_PAYMENT_STRIPE_PROXY' => array('title' => 'Proxy Server', - 'desc' => 'Send API requests through this proxy server. (host:port, eg: 123.45.67.89:8080 or proxy.example.com:8080)'), - 'MODULE_PAYMENT_STRIPE_DEBUG_EMAIL' => array('title' => 'Debug E-Mail Address', - 'desc' => 'All parameters of an invalid transaction will be sent to this email address.'), - 'MODULE_PAYMENT_STRIPE_SORT_ORDER' => array('title' => 'Sort order of display.', - 'desc' => 'Sort order of display. Lowest is displayed first.', - 'value' => '0')); - - return $params; - } - - function sendTransactionToGateway($url, $parameters = null, $curl_opts = array()) { - $server = parse_url($url); - - if (isset($server['port']) === false) { - $server['port'] = ($server['scheme'] == 'https') ? 443 : 80; - } - - if (isset($server['path']) === false) { - $server['path'] = '/'; - } - - $header = array('Stripe-Version: ' . $this->api_version, - 'User-Agent: OSCOM ' . tep_get_version()); - - if ( is_array($parameters) && !empty($parameters) ) { - $post_string = ''; - - foreach ($parameters as $key => $value) { - $post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&'; - } - - $post_string = substr($post_string, 0, -1); - - $parameters = $post_string; - } - - $curl = curl_init($server['scheme'] . '://' . $server['host'] . $server['path'] . (isset($server['query']) ? '?' . $server['query'] : '')); - curl_setopt($curl, CURLOPT_PORT, $server['port']); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_FORBID_REUSE, true); - curl_setopt($curl, CURLOPT_FRESH_CONNECT, true); - curl_setopt($curl, CURLOPT_USERPWD, MODULE_PAYMENT_STRIPE_SECRET_KEY . ':'); - curl_setopt($curl, CURLOPT_HTTPHEADER, $header); - - if ( !empty($parameters) ) { - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); - } - - if ( MODULE_PAYMENT_STRIPE_VERIFY_SSL == 'True' ) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); - - if ( file_exists(DIR_FS_CATALOG . 'ext/modules/payment/stripe/stripe.com.crt') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'ext/modules/payment/stripe/stripe.com.crt'); - } elseif ( file_exists(DIR_FS_CATALOG . 'includes/cacert.pem') ) { - curl_setopt($curl, CURLOPT_CAINFO, DIR_FS_CATALOG . 'includes/cacert.pem'); - } - } else { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - } - - if ( tep_not_null(MODULE_PAYMENT_STRIPE_PROXY) ) { - curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); - curl_setopt($curl, CURLOPT_PROXY, MODULE_PAYMENT_STRIPE_PROXY); - } - - if ( !empty($curl_opts) ) { - foreach ( $curl_opts as $key => $value ) { - curl_setopt($curl, $key, $value); - } - } - - $result = curl_exec($curl); - - curl_close($curl); - - return $result; - } - - function getTestLinkInfo() { - $dialog_title = MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_TITLE; - $dialog_button_close = MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_BUTTON_CLOSE; - $dialog_success = MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_SUCCESS; - $dialog_failed = MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_FAILED; - $dialog_error = MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_ERROR; - $dialog_connection_time = MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_TIME; - - $test_url = tep_href_link(FILENAME_MODULES, 'set=payment&module=' . $this->code . '&action=install&subaction=conntest'); - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); - document.write(''); - document.write(''); -} - - - -EOD; - - $info = '

 ' . MODULE_PAYMENT_STRIPE_DIALOG_CONNECTION_LINK_TITLE . '

' . - '' . - $js; - - return $info; - } - - function getTestConnectionResult() { - $stripe_result = json_decode($this->sendTransactionToGateway('https://api.stripe.com/v1/charges/oscommerce_connection_test'), true); - - if ( is_array($stripe_result) && !empty($stripe_result) && isset($stripe_result['error']) ) { - return 1; - } - - return -1; - } - - function format_raw($number, $currency_code = '', $currency_value = '') { - global $currencies, $currency; - - if (empty($currency_code) || !$currencies->is_set($currency_code)) { - $currency_code = $currency; - } - - if (empty($currency_value) || !is_numeric($currency_value)) { - $currency_value = $currencies->currencies[$currency_code]['value']; - } - - return number_format(tep_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '', ''); - } - - function templateClassExists() { - return class_exists('oscTemplate') && isset($GLOBALS['oscTemplate']) && is_object($GLOBALS['oscTemplate']) && (get_class($GLOBALS['oscTemplate']) == 'oscTemplate'); - } - - function getSubmitCardDetailsJavascript() { - $stripe_publishable_key = MODULE_PAYMENT_STRIPE_PUBLISHABLE_KEY; - - $js = << -if ( typeof jQuery == 'undefined' ) { - document.write(''); -} - - - -EOD; - - return $js; - } - - function sendDebugEmail($response = array()) { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - if (tep_not_null(MODULE_PAYMENT_STRIPE_DEBUG_EMAIL)) { - $email_body = ''; - - if (!empty($response)) { - $email_body .= 'RESPONSE:' . "\n\n" . print_r($response, true) . "\n\n"; - } - - if (!empty($HTTP_POST_VARS)) { - $email_body .= '$HTTP_POST_VARS:' . "\n\n" . print_r($HTTP_POST_VARS, true) . "\n\n"; - } - - if (!empty($HTTP_GET_VARS)) { - $email_body .= '$HTTP_GET_VARS:' . "\n\n" . print_r($HTTP_GET_VARS, true) . "\n\n"; - } - - if (!empty($email_body)) { - tep_mail('', MODULE_PAYMENT_STRIPE_DEBUG_EMAIL, 'Stripe Debug E-Mail', trim($email_body), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); - } - } - } - - function getCustomerID() { - global $customer_id; - - $token_check_query = tep_db_query("select stripe_token from customers_stripe_tokens where customers_id = '" . (int)$customer_id . "' limit 1"); - - if ( tep_db_num_rows($token_check_query) === 1 ) { - $token_check = tep_db_fetch_array($token_check_query); - - $stripe_token_array = explode(':|:', $token_check['stripe_token'], 2); - - return $stripe_token_array[0]; - } - - return false; - } - - function createCustomer($token) { - global $customer_id; - - $params = array('card' => $token); - - $result = json_decode($this->sendTransactionToGateway('https://api.stripe.com/v1/customers', $params), true); - - if ( is_array($result) && !empty($result) && isset($result['object']) && ($result['object'] == 'customer') ) { - $token = tep_db_prepare_input($result['id'] . ':|:' . $result['cards']['data'][0]['id']); - $type = tep_db_prepare_input($result['cards']['data'][0]['type']); - $number = tep_db_prepare_input($result['cards']['data'][0]['last4']); - $expiry = tep_db_prepare_input(str_pad($result['cards']['data'][0]['exp_month'], 2, '0', STR_PAD_LEFT) . $result['cards']['data'][0]['exp_year']); - - $sql_data_array = array('customers_id' => (int)$customer_id, - 'stripe_token' => $token, - 'card_type' => $type, - 'number_filtered' => $number, - 'expiry_date' => $expiry, - 'date_added' => 'now()'); - - tep_db_perform('customers_stripe_tokens', $sql_data_array); - - return array('id' => $result['id'], - 'card_id' => $result['cards']['data'][0]['id']); - } - - $this->sendDebugEmail($result); - - return false; - } - - function addCard($token, $customer) { - global $customer_id; - - $params = array('card' => $token); - - $result = json_decode($this->sendTransactionToGateway('https://api.stripe.com/v1/customers/' . $customer . '/cards', $params), true); - - if ( is_array($result) && !empty($result) && isset($result['object']) && ($result['object'] == 'card') ) { - $token = tep_db_prepare_input($customer . ':|:' . $result['id']); - $type = tep_db_prepare_input($result['type']); - $number = tep_db_prepare_input($result['last4']); - $expiry = tep_db_prepare_input(str_pad($result['exp_month'], 2, '0', STR_PAD_LEFT) . $result['exp_year']); - - $sql_data_array = array('customers_id' => (int)$customer_id, - 'stripe_token' => $token, - 'card_type' => $type, - 'number_filtered' => $number, - 'expiry_date' => $expiry, - 'date_added' => 'now()'); - - tep_db_perform('customers_stripe_tokens', $sql_data_array); - - return $result['id']; - } - - $this->sendDebugEmail($result); - - return false; - } - - function deleteCard($card, $customer, $token_id) { - global $customer_id; - - $result = $this->sendTransactionToGateway('https://api.stripe.com/v1/customers/' . $customer . '/cards/' . $card, null, array(CURLOPT_CUSTOMREQUEST => 'DELETE')); - - if ( !is_array($result) || !isset($result['object']) || ($result['object'] != 'card') ) { - $this->sendDebugEmail($result); - } - - tep_db_query("delete from customers_stripe_tokens where id = '" . (int)$token_id . "' and customers_id = '" . (int)$customer_id . "' and stripe_token = '" . tep_db_prepare_input(tep_db_input($customer . ':|:' . $card)) . "'"); - - return (tep_db_affected_rows() === 1); - } - } -?> diff --git a/catalog/includes/modules/product_listing.php b/catalog/includes/modules/product_listing.php index 6a195eba7..426dda6a3 100644 --- a/catalog/includes/modules/product_listing.php +++ b/catalog/includes/modules/product_listing.php @@ -5,167 +5,177 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ - $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); + use OSC\OM\HTML; + use OSC\OM\OSCOM; + + if ($messageStack->size('product_action') > 0) { + echo $messageStack->output('product_action'); + } ?>
number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { + if ( ($Qlisting->getPageSetTotalRows() > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> - -
- display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> - - display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> -
- -
- +
+ +
+ + +
+
' . - '
' . - ' ' . - ' '; - - for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { - $lc_align = ''; - - switch ($column_list[$col]) { - case 'PRODUCT_LIST_MODEL': - $lc_text = TABLE_HEADING_MODEL; - $lc_align = ''; - break; - case 'PRODUCT_LIST_NAME': - $lc_text = TABLE_HEADING_PRODUCTS; - $lc_align = ''; - break; - case 'PRODUCT_LIST_MANUFACTURER': - $lc_text = TABLE_HEADING_MANUFACTURER; - $lc_align = ''; - break; - case 'PRODUCT_LIST_PRICE': - $lc_text = TABLE_HEADING_PRICE; - $lc_align = 'right'; - break; - case 'PRODUCT_LIST_QUANTITY': - $lc_text = TABLE_HEADING_QUANTITY; - $lc_align = 'right'; - break; - case 'PRODUCT_LIST_WEIGHT': - $lc_text = TABLE_HEADING_WEIGHT; - $lc_align = 'right'; - break; - case 'PRODUCT_LIST_IMAGE': - $lc_text = TABLE_HEADING_IMAGE; - $lc_align = 'center'; - break; - case 'PRODUCT_LIST_BUY_NOW': - $lc_text = TABLE_HEADING_BUY_NOW; - $lc_align = 'center'; - break; - } + if ($Qlisting->getPageSetTotalRows() > 0) { ?> +
+
+ + + +
+ + + +
+ + +
+ +
+
- $prod_list_contents .= ' ' . $lc_text . ''; - } - - $prod_list_contents .= ' ' . - '
' . - '
'; - - if ($listing_split->number_of_rows > 0) { - $rows = 0; - $listing_query = tep_db_query($listing_split->sql_query); + ' . - ' '; + while ($Qlisting->fetch()) { + $prod_list_contents .= '
'; + $prod_list_contents .= '
'; + if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { + $prod_list_contents .= ' ' . HTML::image(DIR_WS_IMAGES . $Qlisting->value('products_image'), $Qlisting->value('products_name'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, NULL, NULL, 'img-responsive thumbnail group list-group-image') . ''; + } else { + $prod_list_contents .= ' ' . HTML::image(DIR_WS_IMAGES . $Qlisting->value('products_image'), $Qlisting->value('products_name'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, NULL, NULL, 'img-responsive thumbnail group list-group-image') . ''; + } + $prod_list_contents .= '
'; + $prod_list_contents .= '

'; + if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) { + $prod_list_contents .= ' ' . $Qlisting->value('products_name') . ''; + } else { + $prod_list_contents .= ' ' . $Qlisting->value('products_name') . ''; + } + $prod_list_contents .= '

'; - while ($listing = tep_db_fetch_array($listing_query)) { - $rows++; + $prod_list_contents .= '

' . strip_tags($Qlisting->value('products_description'), '
') . '…

'; - $prod_list_contents .= '
'; + $extra_list_contents = NULL; + if (($lc_show_manu == true) && ($Qlisting->valueInt('manufacturers_id') != 0)) $extra_list_contents .= '
' . TABLE_HEADING_MANUFACTURER . '
' . $Qlisting->value('manufacturers_name') . '
'; + if ( ($lc_show_model == true) && tep_not_null($Qlisting->value('products_model'))) $extra_list_contents .= '
' . TABLE_HEADING_MODEL . '
' . $Qlisting->value('products_model') . '
'; + if (($lc_show_qty == true) && (tep_get_products_stock($Qlisting->valueInt('products_id'))!= 0) ) $extra_list_contents .= '
' . TABLE_HEADING_QUANTITY . '
' . tep_get_products_stock($Qlisting->valueInt('products_id')) . '
'; + if (($lc_show_lbs == true) && ($Qlisting->valueDecimal('products_weight') != 0)) $extra_list_contents .= '
' . TABLE_HEADING_WEIGHT . '
' . $Qlisting->valueDecimal('products_weight') . '
'; - for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { - switch ($column_list[$col]) { - case 'PRODUCT_LIST_MODEL': - $prod_list_contents .= ' '; - break; - case 'PRODUCT_LIST_NAME': - if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { - $prod_list_contents .= ' '; - } else { - $prod_list_contents .= ' '; - } - break; - case 'PRODUCT_LIST_MANUFACTURER': - $prod_list_contents .= ' '; - break; - case 'PRODUCT_LIST_PRICE': - if (tep_not_null($listing['specials_new_products_price'])) { - $prod_list_contents .= ' '; - } else { - $prod_list_contents .= ' '; - } - break; - case 'PRODUCT_LIST_QUANTITY': - $prod_list_contents .= ' '; - break; - case 'PRODUCT_LIST_WEIGHT': - $prod_list_contents .= ' '; - break; - case 'PRODUCT_LIST_IMAGE': - if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { - $prod_list_contents .= ' '; - } else { - $prod_list_contents .= ' '; - } - break; - case 'PRODUCT_LIST_BUY_NOW': - $prod_list_contents .= ' '; - break; - } - } - - $prod_list_contents .= ' '; + if (tep_not_null($extra_list_contents)) { + $prod_list_contents .= '
'; + $prod_list_contents .= $extra_list_contents; + $prod_list_contents .= '
'; } - $prod_list_contents .= '
' . $listing['products_model'] . '' . $listing['products_name'] . '' . $listing['products_name'] . '' . $listing['manufacturers_name'] . '' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '  ' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '' . $listing['products_quantity'] . '' . $listing['products_weight'] . '' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '
' . - '
' . - '
'; - - echo $prod_list_contents; - } else { -?> + $prod_list_contents .= '
'; + if (tep_not_null($Qlisting->valueDecimal('specials_new_products_price'))) { + $prod_list_contents .= '
'; + } else { + $prod_list_contents .= '
'; + } + $prod_list_contents .= '
' . HTML::button(IMAGE_BUTTON_BUY_NOW, 'glyphicon glyphicon-shopping-cart', OSCOM::link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'sort', 'cPath')) . 'action=buy_now&products_id=' . $Qlisting->valueInt('products_id')), NULL, NULL, 'btn-success btn-sm') . '
'; + $prod_list_contents .= '
'; -

+ $prod_list_contents .= '
'; + $prod_list_contents .= '
'; + $prod_list_contents .= '
'; -number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { -?> - -
+ echo '
' . $prod_list_contents . '
'; -
- display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?> +} else { +?> - display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?> -
+
getPageSetTotalRows() > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { + ?> +
+ +
+ + +
+
+ -
+
diff --git a/catalog/includes/modules/shipping/flat.php b/catalog/includes/modules/shipping/flat.php index 09ebed119..bc3921487 100644 --- a/catalog/includes/modules/shipping/flat.php +++ b/catalog/includes/modules/shipping/flat.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\Registry; + class flat { var $code, $title, $description, $icon, $enabled; @@ -17,6 +20,8 @@ class flat { function flat() { global $order; + $OSCOM_Db = Registry::get('Db'); + $this->code = 'flat'; $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE; $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION; @@ -27,12 +32,12 @@ function flat() { if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_SHIPPING_FLAT_ZONE, 'zone_country_id' => $order->delivery['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->delivery['zone_id']) { $check_flag = true; break; } @@ -58,29 +63,76 @@ function quote($method = '') { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } - if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); + if (tep_not_null($this->icon)) $this->quotes['icon'] = HTML::image($this->icon, $this->title); return $this->quotes; } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLAT_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_SHIPPING_FLAT_STATUS'); } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Flat Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FLAT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FLAT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FLAT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Flat Shipping', + 'configuration_key' => 'MODULE_SHIPPING_FLAT_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to offer flat rate shipping?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shipping Cost', + 'configuration_key' => 'MODULE_SHIPPING_FLAT_COST', + 'configuration_value' => '5.00', + 'configuration_description' => 'The shipping cost for all orders using this shipping method.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Tax Class', + 'configuration_key' => 'MODULE_SHIPPING_FLAT_TAX_CLASS', + 'configuration_value' => '0', + 'configuration_description' => 'Use the following tax class on the shipping fee.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_tax_class_title', + 'set_function' => 'tep_cfg_pull_down_tax_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shipping Zone', + 'configuration_key' => 'MODULE_SHIPPING_FLAT_ZONE', + 'configuration_value' => '0', + 'configuration_description' => 'If a zone is selected, only enable this shipping method for that zone.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_zone_class_title', + 'set_function' => 'tep_cfg_pull_down_zone_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SHIPPING_FLAT_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/shipping/item.php b/catalog/includes/modules/shipping/item.php index d867b1456..c85b3c90c 100644 --- a/catalog/includes/modules/shipping/item.php +++ b/catalog/includes/modules/shipping/item.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2008 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\Registry; + class item { var $code, $title, $description, $icon, $enabled; @@ -17,6 +20,8 @@ class item { function item() { global $order; + $OSCOM_Db = Registry::get('Db'); + $this->code = 'item'; $this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE; $this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION; @@ -27,12 +32,12 @@ function item() { if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_SHIPPING_ITEM_ZONE, 'zone_country_id' => $order->delivery['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->delivery['zone_id']) { $check_flag = true; break; } @@ -60,30 +65,86 @@ function quote($method = '') { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } - if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); + if (tep_not_null($this->icon)) $this->quotes['icon'] = HTML::image($this->icon, $this->title); return $this->quotes; } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEM_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_SHIPPING_ITEM_STATUS'); } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Item Shipping', + 'configuration_key' => 'MODULE_SHIPPING_ITEM_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to offer per item rate shipping?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shipping Cost', + 'configuration_key' => 'MODULE_SHIPPING_ITEM_COST', + 'configuration_value' => '2.50', + 'configuration_description' => 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Handling Fee', + 'configuration_key' => 'MODULE_SHIPPING_ITEM_HANDLING', + 'configuration_value' => '0', + 'configuration_description' => 'Handling fee for this shipping method.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Tax Class', + 'configuration_key' => 'MODULE_SHIPPING_ITEM_TAX_CLASS', + 'configuration_value' => '0', + 'configuration_description' => 'Use the following tax class on the shipping fee.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_tax_class_title', + 'set_function' => 'tep_cfg_pull_down_tax_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shipping Zone', + 'configuration_key' => 'MODULE_SHIPPING_ITEM_ZONE', + 'configuration_value' => '0', + 'configuration_description' => 'If a zone is selected, only enable this shipping method for that zone.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_zone_class_title', + 'set_function' => 'tep_cfg_pull_down_zone_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SHIPPING_ITEM_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { @@ -93,6 +154,8 @@ function keys() { function getNumberOfItems() { global $order, $total_count; + $OSCOM_Db = Registry::get('Db'); + $number_of_items = $total_count; if ($order->content_type == 'mixed') { @@ -102,12 +165,13 @@ function getNumberOfItems() { $number_of_items += $order->products[$i]['qty']; if (isset($order->products[$i]['attributes'])) { - reset($order->products[$i]['attributes']); - while (list($option, $value) = each($order->products[$i]['attributes'])) { - $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id"); - $virtual_check = tep_db_fetch_array($virtual_check_query); + foreach ( $order->products[$i]['attributes'] as $option => $value ) { + $Qcheck = $OSCOM_Db->prepare('select pa.products_id from :table_products_attributes pa, :table_products_attributes_download pad where pa.products_id = :products_id and pa.options_values_id = :options_values_id and pa.products_attributes_id = pad.products_attributes_id'); + $Qcheck->bindInt(':products_id', $order->products[$i]['id']); + $Qcheck->bindInt(':options_values_id', $value['value_id']); + $Qcheck->execute(); - if ($virtual_check['total'] > 0) { + if ($Qcheck->fetch() !== false) { $number_of_items -= $order->products[$i]['qty']; } } diff --git a/catalog/includes/modules/shipping/table.php b/catalog/includes/modules/shipping/table.php index 9676e2709..d56a4f58f 100644 --- a/catalog/includes/modules/shipping/table.php +++ b/catalog/includes/modules/shipping/table.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2008 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\Registry; + class table { var $code, $title, $description, $icon, $enabled; @@ -17,6 +20,8 @@ class table { function table() { global $order; + $OSCOM_Db = Registry::get('Db'); + $this->code = 'table'; $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE; $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION; @@ -27,12 +32,12 @@ function table() { if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) { $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { + $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_SHIPPING_TABLE_ZONE, 'zone_country_id' => $order->delivery['country']['id']], 'zone_id'); + while ($Qcheck->fetch()) { + if ($Qcheck->valueInt('zone_id') < 1) { $check_flag = true; break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { + } elseif ($Qcheck->valueInt('zone_id') == $order->delivery['zone_id']) { $check_flag = true; break; } @@ -77,31 +82,97 @@ function quote($method = '') { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } - if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); + if (tep_not_null($this->icon)) $this->quotes['icon'] = HTML::image($this->icon, $this->title); return $this->quotes; } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_SHIPPING_TABLE_STATUS'); } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Table Method', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to offer table rate shipping?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shipping Table', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_COST', + 'configuration_value' => '25:8.50,50:5.50,10000:0.00', + 'configuration_description' => 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Table Method', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_MODE', + 'configuration_value' => 'weight', + 'configuration_description' => 'The shipping cost is based on the order total or the total weight of the items ordered.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'weight\', \'price\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Handling Fee', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_HANDLING', + 'configuration_value' => '0', + 'configuration_description' => 'Handling fee for this shipping method.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Tax Class', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_TAX_CLASS', + 'configuration_value' => '0', + 'configuration_description' => 'Use the following tax class on the shipping fee.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_tax_class_title', + 'set_function' => 'tep_cfg_pull_down_tax_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shipping Zone', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_ZONE', + 'configuration_value' => '0', + 'configuration_description' => 'If a zone is selected, only enable this shipping method for that zone.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_zone_class_title', + 'set_function' => 'tep_cfg_pull_down_zone_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SHIPPING_TABLE_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { @@ -109,9 +180,11 @@ function keys() { } function getShippableTotal() { - global $order, $cart, $currencies; + global $order, $currencies; + + $OSCOM_Db = Registry::get('Db'); - $order_total = $cart->show_total(); + $order_total = $_SESSION['cart']->show_total(); if ($order->content_type == 'mixed') { $order_total = 0; @@ -120,12 +193,13 @@ function getShippableTotal() { $order_total += $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']); if (isset($order->products[$i]['attributes'])) { - reset($order->products[$i]['attributes']); - while (list($option, $value) = each($order->products[$i]['attributes'])) { - $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id"); - $virtual_check = tep_db_fetch_array($virtual_check_query); + foreach ( $order->products[$i]['attributes'] as $option => $value ) { + $Qcheck = $OSCOM_Db->prepare('select pa.products_id from :table_products_attributes pa, :table_products_attributes_download pad where pa.products_id = :products_id and pa.options_values_id = :options_values_id and pa.products_attributes_id = pad.products_attributes_id'); + $Qcheck->bindInt(':products_id', $order->products[$i]['id']); + $Qcheck->bindInt(':options_values_id', $value['value_id']); + $Qcheck->execute(); - if ($virtual_check['total'] > 0) { + if ($Qcheck->fetch() !== false) { $order_total -= $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']); } } diff --git a/catalog/includes/modules/shipping/usps.php b/catalog/includes/modules/shipping/usps.php deleted file mode 100644 index ccaf354d3..000000000 --- a/catalog/includes/modules/shipping/usps.php +++ /dev/null @@ -1,547 +0,0 @@ -code = 'usps'; - $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE; - $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION; - $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER; - $this->icon = DIR_WS_ICONS . 'shipping_usps.gif'; - $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS; - $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false); - - if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_USPS_ZONE > 0) ) { - $check_flag = false; - $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); - while ($check = tep_db_fetch_array($check_query)) { - if ($check['zone_id'] < 1) { - $check_flag = true; - break; - } elseif ($check['zone_id'] == $order->delivery['zone_id']) { - $check_flag = true; - break; - } - } - - if ($check_flag == false) { - $this->enabled = false; - } - } - - $this->types = array( -// Domestic Types - 'Express Mail', - 'Express Mail Flat Rate Envelope', - 'Priority Mail', - 'Priority Mail Flat Rate Envelope', - 'Priority Mail Small Flat Rate Box', - 'Priority Mail Medium Flat Rate Box', - 'Priority Mail Large Flat Rate Box', - 'First-Class Mail Flat', - 'First-Class Mail Parcel', - 'Parcel Post', - 'Bound Printed Matter', - 'Media Mail', - 'Library Mail', -// International Types - 'Global Express Guaranteed (GXG)', - 'Global Express Guaranteed Non-Document Rectangular', - 'Global Express Guaranteed Non-Document Non-Rectangular', - 'USPS GXG Envelopes', - 'Express Mail International', - 'Express Mail International Flat Rate Envelope', - 'Priority Mail International', - 'Priority Mail International Large Flat Rate Box', - 'Priority Mail International Medium Flat Rate Box', - 'Priority Mail International Small Flat Rate Box', - 'Priority Mail International Flat Rate Envelope', - 'First-Class Mail International Package', - 'First-Class Mail International Large Envelope' - ); - - $this->countries = $this->country_list(); - } - -// class methods - function quote($method = '') { - global $order, $shipping_weight, $shipping_num_boxes; - - // if ( tep_not_null($method) && in_array($method, $this->types)) { - // $this->_setService($method); - // } - - $this->_setMachinable('False'); - $this->_setContainer('None'); - $this->_setSize('REGULAR'); - -// usps doesnt accept zero weight - $shipping_weight = ($shipping_weight < 0.1 ? 0.1 : $shipping_weight); - $shipping_pounds = floor ($shipping_weight); - $shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight))); - $this->_setWeight($shipping_pounds, $shipping_ounces); - $uspsQuote = $this->_getQuote(); - if (is_array($uspsQuote)) { - if (isset($uspsQuote['error'])) { - $this->quotes = array('module' => $this->title, - 'error' => $uspsQuote['error']); - } else { - $this->quotes = array('id' => $this->code, - 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)'); - - $methods = array(); - $size = sizeof($uspsQuote); - for ($i=0; $i<$size; $i++) { - list($type, $cost) = each($uspsQuote[$i]); - -// echo "USPS $type @ $cost
"; - if (($method == '' && in_array($type, $this->types)) || $method == $type) { - if (strpos($type, "Flat Rate")) $type_flat = $type . ', subject to verification'; - else $type_flat = $type; - $methods[] = array('id' => $type, - 'title' => $type_flat, - 'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes); - } - } - - $this->quotes['methods'] = $methods; - - if ($this->tax_class > 0) { - $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); - } - } - } else { - $this->quotes = array('module' => $this->title, - 'error' => MODULE_SHIPPING_USPS_TEXT_ERROR); - } - - if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); - - return $this->quotes; - } - - function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; - } - - function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS Password', 'MODULE_SHIPPING_USPS_PASSWORD', 'NONE', 'See USERID, above.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_USPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); - } - - function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); - } - - function keys() { - return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_PASSWORD', 'MODULE_SHIPPING_USPS_HANDLING', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER'); - } - - function _setService($service) { - $this->service = $service; - } - - function _setWeight($pounds, $ounces=0) { - $this->pounds = $pounds; - $this->ounces = $ounces; - } - - function _setContainer($container) { - $this->container = $container; - } - - function _setSize($size) { - $this->size = $size; - } - - function _setMachinable($machinable) { - $this->machinable = $machinable; - } - - function _getQuote() { - global $order; - - if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { - $dest_zip = str_replace(' ', '', $order->delivery['postcode']); - if ($order->delivery['country']['iso_code_2'] == 'US') $dest_zip = substr($dest_zip, 0, 5); - $request = '' . - '' . - '' . 'ALL' . '' . - '' . SHIPPING_ORIGIN_ZIP . '' . - '' . $dest_zip . '' . - '' . $this->pounds . '' . - '' . $this->ounces . '' . - 'RegularTrue' . - ''; - $request = 'API=RateV3&XML=' . urlencode($request); - } else { - $request = '' . - '' . - '' . $this->pounds . '' . - '' . $this->ounces . '' . - 'Package' . - '' . - '121212' . - 'NN' . - '' . - '50' . - '' . $this->countries[$order->delivery['country']['iso_code_2']] . '' . - '' . - ''; - - $request = 'API=IntlRate&XML=' . urlencode($request); - } - - $body = ''; - - if (!class_exists('httpClient')) { - include('includes/classes/http_client.php'); - } - - $http = new httpClient(); - if ($http->Connect('production.shippingapis.com', 80)) { - $http->addHeader('Host', 'production.shippingapis.com'); - $http->addHeader('User-Agent', 'osCommerce'); - $http->addHeader('Connection', 'Close'); - if ($http->Get('/shippingapi.dll?' . $request)) $body = $http->getBody(); - - $http->Disconnect(); - } else { - return false; - } - $response = array(); - while (true) { - if ($start = strpos($body, ''); - $response[] = substr($body, 0, $end+10); - $body = substr($body, $end+9); - } else { - break; - } - } - $rates = array(); - if ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { - if (sizeof($response) == '1') { - if (preg_match('//', $response[0])) { - $number = preg_match('/(.*)<\/Number>/', $response[0], $regs); - $number = $regs[1]; - $description = preg_match('/(.*)<\/Description>/', $response[0], $regs); - $description = $regs[1]; - - return array('error' => $number . ' - ' . $description); - } - } - - $n = sizeof($response); - for ($i=0; $i<$n; $i++) { - $resp = $response[$i]; - $pos = 0; - while (1) { - $pos = strpos($response[$i], '', $pos); - if ($end === FALSE) break; - $resp = substr($response[$i], $pos, $end-$pos); - $service = preg_match('/(.*)<\/MailService>/', $resp, $regs); - $service = $regs[1]; - $postage = preg_match('/(.*)<\/Rate>/', $resp, $regs); - $postage = $regs[1]; - $pos = $end; - $rates[] = array($service => $postage); - } - } - } else { - if (preg_match('//', $response[0])) { - $number = preg_match('/(.*)<\/Number>/', $response[0], $regs); - $number = $regs[1]; - $description = preg_match('/(.*)<\/Description>/', $response[0], $regs); - $description = $regs[1]; - - return array('error' => $number . ' - ' . $description); - } else { - $body = $response[0]; - $services = array(); - while (true) { - if ($start = strpos($body, ''); - $services[] = substr($body, 0, $end+10); - $body = substr($body, $end+9); - } else { - break; - } - } - - $size = sizeof($services); - for ($i=0, $n=$size; $i<$n; $i++) { - if (strpos($services[$i], '')) { - $service = preg_match('/(.*)<\/SvcDescription>/', $services[$i], $regs); - $service = $regs[1]; - $postage = preg_match('/(.*)<\/Postage>/', $services[$i], $regs); - $postage = $regs[1]; - - if (isset($this->service) && ($service != $this->service) ) { - continue; - } - - $rates[] = array($service => $postage); - } - } - } - } - - return ((sizeof($rates) > 0) ? $rates : false); - } - - function country_list() { - $list = array('AF' => 'Afghanistan', - 'AL' => 'Albania', - 'DZ' => 'Algeria', - 'AD' => 'Andorra', - 'AO' => 'Angola', - 'AI' => 'Anguilla', - 'AG' => 'Antigua and Barbuda', - 'AR' => 'Argentina', - 'AM' => 'Armenia', - 'AW' => 'Aruba', - 'AU' => 'Australia', - 'AT' => 'Austria', - 'AZ' => 'Azerbaijan', - 'BS' => 'Bahamas', - 'BH' => 'Bahrain', - 'BD' => 'Bangladesh', - 'BB' => 'Barbados', - 'BY' => 'Belarus', - 'BE' => 'Belgium', - 'BZ' => 'Belize', - 'BJ' => 'Benin', - 'BM' => 'Bermuda', - 'BT' => 'Bhutan', - 'BO' => 'Bolivia', - 'BA' => 'Bosnia-Herzegovina', - 'BW' => 'Botswana', - 'BR' => 'Brazil', - 'VG' => 'British Virgin Islands', - 'BN' => 'Brunei Darussalam', - 'BG' => 'Bulgaria', - 'BF' => 'Burkina Faso', - 'MM' => 'Burma', - 'BI' => 'Burundi', - 'KH' => 'Cambodia', - 'CM' => 'Cameroon', - 'CA' => 'Canada', - 'CV' => 'Cape Verde', - 'KY' => 'Cayman Islands', - 'CF' => 'Central African Republic', - 'TD' => 'Chad', - 'CL' => 'Chile', - 'CN' => 'China', - 'CX' => 'Christmas Island (Australia)', - 'CC' => 'Cocos Island (Australia)', - 'CO' => 'Colombia', - 'KM' => 'Comoros', - 'CG' => 'Congo (Brazzaville),Republic of the', - 'ZR' => 'Congo, Democratic Republic of the', - 'CK' => 'Cook Islands (New Zealand)', - 'CR' => 'Costa Rica', - 'CI' => 'Cote d\'Ivoire (Ivory Coast)', - 'HR' => 'Croatia', - 'CU' => 'Cuba', - 'CY' => 'Cyprus', - 'CZ' => 'Czech Republic', - 'DK' => 'Denmark', - 'DJ' => 'Djibouti', - 'DM' => 'Dominica', - 'DO' => 'Dominican Republic', - 'TP' => 'East Timor (Indonesia)', - 'EC' => 'Ecuador', - 'EG' => 'Egypt', - 'SV' => 'El Salvador', - 'GQ' => 'Equatorial Guinea', - 'ER' => 'Eritrea', - 'EE' => 'Estonia', - 'ET' => 'Ethiopia', - 'FK' => 'Falkland Islands', - 'FO' => 'Faroe Islands', - 'FJ' => 'Fiji', - 'FI' => 'Finland', - 'FR' => 'France', - 'GF' => 'French Guiana', - 'PF' => 'French Polynesia', - 'GA' => 'Gabon', - 'GM' => 'Gambia', - 'GE' => 'Georgia, Republic of', - 'DE' => 'Germany', - 'GH' => 'Ghana', - 'GI' => 'Gibraltar', - 'GB' => 'Great Britain and Northern Ireland', - 'GR' => 'Greece', - 'GL' => 'Greenland', - 'GD' => 'Grenada', - 'GP' => 'Guadeloupe', - 'GT' => 'Guatemala', - 'GN' => 'Guinea', - 'GW' => 'Guinea-Bissau', - 'GY' => 'Guyana', - 'HT' => 'Haiti', - 'HN' => 'Honduras', - 'HK' => 'Hong Kong', - 'HU' => 'Hungary', - 'IS' => 'Iceland', - 'IN' => 'India', - 'ID' => 'Indonesia', - 'IR' => 'Iran', - 'IQ' => 'Iraq', - 'IE' => 'Ireland', - 'IL' => 'Israel', - 'IT' => 'Italy', - 'JM' => 'Jamaica', - 'JP' => 'Japan', - 'JO' => 'Jordan', - 'KZ' => 'Kazakhstan', - 'KE' => 'Kenya', - 'KI' => 'Kiribati', - 'KW' => 'Kuwait', - 'KG' => 'Kyrgyzstan', - 'LA' => 'Laos', - 'LV' => 'Latvia', - 'LB' => 'Lebanon', - 'LS' => 'Lesotho', - 'LR' => 'Liberia', - 'LY' => 'Libya', - 'LI' => 'Liechtenstein', - 'LT' => 'Lithuania', - 'LU' => 'Luxembourg', - 'MO' => 'Macao', - 'MK' => 'Macedonia, Republic of', - 'MG' => 'Madagascar', - 'MW' => 'Malawi', - 'MY' => 'Malaysia', - 'MV' => 'Maldives', - 'ML' => 'Mali', - 'MT' => 'Malta', - 'MQ' => 'Martinique', - 'MR' => 'Mauritania', - 'MU' => 'Mauritius', - 'YT' => 'Mayotte (France)', - 'MX' => 'Mexico', - 'MD' => 'Moldova', - 'MC' => 'Monaco (France)', - 'MN' => 'Mongolia', - 'MS' => 'Montserrat', - 'MA' => 'Morocco', - 'MZ' => 'Mozambique', - 'NA' => 'Namibia', - 'NR' => 'Nauru', - 'NP' => 'Nepal', - 'NL' => 'Netherlands', - 'AN' => 'Netherlands Antilles', - 'NC' => 'New Caledonia', - 'NZ' => 'New Zealand', - 'NI' => 'Nicaragua', - 'NE' => 'Niger', - 'NG' => 'Nigeria', - 'KP' => 'North Korea (Korea, Democratic People\'s Republic of)', - 'NO' => 'Norway', - 'OM' => 'Oman', - 'PK' => 'Pakistan', - 'PA' => 'Panama', - 'PG' => 'Papua New Guinea', - 'PY' => 'Paraguay', - 'PE' => 'Peru', - 'PH' => 'Philippines', - 'PN' => 'Pitcairn Island', - 'PL' => 'Poland', - 'PT' => 'Portugal', - 'QA' => 'Qatar', - 'RE' => 'Reunion', - 'RO' => 'Romania', - 'RU' => 'Russia', - 'RW' => 'Rwanda', - 'SH' => 'Saint Helena', - 'KN' => 'Saint Kitts (St. Christopher and Nevis)', - 'LC' => 'Saint Lucia', - 'PM' => 'Saint Pierre and Miquelon', - 'VC' => 'Saint Vincent and the Grenadines', - 'SM' => 'San Marino', - 'ST' => 'Sao Tome and Principe', - 'SA' => 'Saudi Arabia', - 'SN' => 'Senegal', - 'YU' => 'Serbia-Montenegro', - 'SC' => 'Seychelles', - 'SL' => 'Sierra Leone', - 'SG' => 'Singapore', - 'SK' => 'Slovak Republic', - 'SI' => 'Slovenia', - 'SB' => 'Solomon Islands', - 'SO' => 'Somalia', - 'ZA' => 'South Africa', - 'GS' => 'South Georgia (Falkland Islands)', - 'KR' => 'South Korea (Korea, Republic of)', - 'ES' => 'Spain', - 'LK' => 'Sri Lanka', - 'SD' => 'Sudan', - 'SR' => 'Suriname', - 'SZ' => 'Swaziland', - 'SE' => 'Sweden', - 'CH' => 'Switzerland', - 'SY' => 'Syrian Arab Republic', - 'TW' => 'Taiwan', - 'TJ' => 'Tajikistan', - 'TZ' => 'Tanzania', - 'TH' => 'Thailand', - 'TG' => 'Togo', - 'TK' => 'Tokelau (Union) Group (Western Samoa)', - 'TO' => 'Tonga', - 'TT' => 'Trinidad and Tobago', - 'TN' => 'Tunisia', - 'TR' => 'Turkey', - 'TM' => 'Turkmenistan', - 'TC' => 'Turks and Caicos Islands', - 'TV' => 'Tuvalu', - 'UG' => 'Uganda', - 'UA' => 'Ukraine', - 'AE' => 'United Arab Emirates', - 'UY' => 'Uruguay', - 'UZ' => 'Uzbekistan', - 'VU' => 'Vanuatu', - 'VA' => 'Vatican City', - 'VE' => 'Venezuela', - 'VN' => 'Vietnam', - 'WF' => 'Wallis and Futuna Islands', - 'WS' => 'Western Samoa', - 'YE' => 'Yemen', - 'ZM' => 'Zambia', - 'ZW' => 'Zimbabwe'); - - return $list; - } - } -?> diff --git a/catalog/includes/modules/shipping/zones.php b/catalog/includes/modules/shipping/zones.php index 52b1a603c..84d76dc6e 100644 --- a/catalog/includes/modules/shipping/zones.php +++ b/catalog/includes/modules/shipping/zones.php @@ -6,7 +6,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2003 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License @@ -94,6 +94,9 @@ */ + use OSC\OM\HTML; + use OSC\OM\Registry; + class zones { var $code, $title, $description, $enabled, $num_zones; @@ -162,7 +165,7 @@ function quote($method = '') { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } - if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); + if (tep_not_null($this->icon)) $this->quotes['icon'] = HTML::image($this->icon, $this->title); if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE; @@ -170,30 +173,85 @@ function quote($method = '') { } function check() { - if (!isset($this->_check)) { - $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'"); - $this->_check = tep_db_num_rows($check_query); - } - return $this->_check; + return defined('MODULE_SHIPPING_ZONES_STATUS'); } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Zones Method', + 'configuration_key' => 'MODULE_SHIPPING_ZONES_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to offer zone rate shipping?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Tax Class', + 'configuration_key' => 'MODULE_SHIPPING_ZONES_TAX_CLASS', + 'configuration_value' => '0', + 'configuration_description' => 'Use the following tax class on the shipping fee.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'use_function' => 'tep_get_tax_class_title', + 'set_function' => 'tep_cfg_pull_down_tax_classes(', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SHIPPING_ZONES_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + for ($i = 1; $i <= $this->num_zones; $i++) { $default_countries = ''; if ($i == 1) { $default_countries = 'US,CA'; } - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())"); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Zone ' . $i . ' Countries', + 'configuration_key' => 'MODULE_SHIPPING_ZONES_COUNTRIES_' . $i, + 'configuration_value' => $default_countries, + 'configuration_description' => 'Comma separated list of two character ISO country codes that are part of Zone ' . $i . '.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Zone ' . $i . ' Shipping Table', + 'configuration_key' => 'MODULE_SHIPPING_ZONES_COST_' . $i, + 'configuration_value' => '3:8.50,7:10.50,99:20.00', + 'configuration_description' => 'Shipping rates to Zone ' . $i . ' destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone ' . $i . ' destinations.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Zone ' . $i . ' Handling Fee', + 'configuration_key' => 'MODULE_SHIPPING_ZONES_HANDLING_' . $i, + 'configuration_value' => '0', + 'configuration_description' => 'Handling Fee for this shipping zone', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_digg.php b/catalog/includes/modules/social_bookmarks/sb_digg.php index 8f86fa14f..b3b359f91 100644 --- a/catalog/includes/modules/social_bookmarks/sb_digg.php +++ b/catalog/includes/modules/social_bookmarks/sb_digg.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_digg { var $code = 'sb_digg'; var $title; @@ -30,9 +33,7 @@ function sb_digg() { } function getOutput() { - global $HTTP_GET_VARS; - - return '' . tep_output_string_protected($this->public_title) . ''; + return '' . tep_output_string_protected($this->public_title) . ''; } function isEnabled() { @@ -52,12 +53,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Digg Module', 'MODULE_SOCIAL_BOOKMARKS_DIGG_STATUS', 'True', 'Do you want to allow products to be shared through Digg?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_DIGG_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Digg Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_DIGG_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be shared through Digg?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_DIGG_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_email.php b/catalog/includes/modules/social_bookmarks/sb_email.php index 8225a3036..1362b4b1e 100644 --- a/catalog/includes/modules/social_bookmarks/sb_email.php +++ b/catalog/includes/modules/social_bookmarks/sb_email.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_email { var $code = 'sb_email'; var $title; @@ -30,9 +33,7 @@ function sb_email() { } function getOutput() { - global $HTTP_GET_VARS; - - return '' . tep_output_string_protected($this->public_title) . ''; + return '' . tep_output_string_protected($this->public_title) . ''; } function isEnabled() { @@ -52,12 +53,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable E-Mail Module', 'MODULE_SOCIAL_BOOKMARKS_EMAIL_STATUS', 'True', 'Do you want to allow products to be shared through e-mail?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_EMAIL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable E-Mail Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_EMAIL_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be shared through e-mail?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_EMAIL_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_facebook.php b/catalog/includes/modules/social_bookmarks/sb_facebook.php index 125cf51cf..1085cb0c7 100644 --- a/catalog/includes/modules/social_bookmarks/sb_facebook.php +++ b/catalog/includes/modules/social_bookmarks/sb_facebook.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_facebook { var $code = 'sb_facebook'; var $title; @@ -30,9 +33,7 @@ function sb_facebook() { } function getOutput() { - global $HTTP_GET_VARS; - - return '' . tep_output_string_protected($this->public_title) . ''; + return '' . tep_output_string_protected($this->public_title) . ''; } function isEnabled() { @@ -52,12 +53,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Facebook Module', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_STATUS', 'True', 'Do you want to allow products to be shared through Facebook?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Facebook Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be shared through Facebook?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_facebook_like.php b/catalog/includes/modules/social_bookmarks/sb_facebook_like.php index e58c90539..ee2852c2a 100644 --- a/catalog/includes/modules/social_bookmarks/sb_facebook_like.php +++ b/catalog/includes/modules/social_bookmarks/sb_facebook_like.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_facebook_like { var $code = 'sb_facebook_like'; var $title; @@ -30,15 +33,13 @@ function sb_facebook_like() { } function getOutput() { - global $HTTP_GET_VARS; - $style = (MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STYLE == 'Standard') ? 'standard' : 'button_count'; $faces = (MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_FACES == 'True') ? 'true' : 'false'; $width = MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_WIDTH; $action = (MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_VERB == 'Like') ? 'like' : 'recommend'; $scheme = (MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SCHEME == 'Light') ? 'light' : 'dark'; - return ''; + return ''; } function isEnabled() { @@ -58,17 +59,86 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Facebook Like Module', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STATUS', 'True', 'Do you want to allow products to be shared through Facebook Like?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Layout Style', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STYLE', 'Standard', 'Determines the size and amount of social context next to the button.', '6', '1', 'tep_cfg_select_option(array(\'Standard\', \'Button Count\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Show Faces', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_FACES', 'False', 'Show profile pictures below the button?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Width', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_WIDTH', '125', 'The width of the iframe in pixels.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Verb to Display', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_VERB', 'Like', 'The verb to display in the button.', '6', '1', 'tep_cfg_select_option(array(\'Like\', \'Recommend\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Color Scheme', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SCHEME', 'Light', 'The color scheme of the button.', '6', '1', 'tep_cfg_select_option(array(\'Light\', \'Dark\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Facebook Like Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be shared through Facebook Like?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Layout Style', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_STYLE', + 'configuration_value' => 'Standard', + 'configuration_description' => 'Determines the size and amount of social context next to the button.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Standard\', \'Button Count\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Show Faces', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_FACES', + 'configuration_value' => 'False', + 'configuration_description' => 'Show profile pictures below the button?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Width', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_WIDTH', + 'configuration_value' => '125', + 'configuration_description' => 'The width of the iframe in pixels.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Verb to Display', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_VERB', + 'configuration_value' => 'Like', + 'configuration_description' => 'The verb to display in the button.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Like\', \'Recommend\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Color Scheme', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SCHEME', + 'configuration_value' => 'Light', + 'configuration_description' => 'The color scheme of the button.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Light\', \'Dark\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_FACEBOOK_LIKE_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_google_plus_one.php b/catalog/includes/modules/social_bookmarks/sb_google_plus_one.php index b9de29139..8993efb80 100644 --- a/catalog/includes/modules/social_bookmarks/sb_google_plus_one.php +++ b/catalog/includes/modules/social_bookmarks/sb_google_plus_one.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_google_plus_one { var $code = 'sb_google_plus_one'; var $title; @@ -30,7 +33,7 @@ function sb_google_plus_one() { } function getOutput() { - global $HTTP_GET_VARS, $lng, $languages_id; + global $lng; if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); @@ -38,13 +41,13 @@ function getOutput() { } foreach ($lng->catalog_languages as $lkey => $lvalue) { - if ($lvalue['id'] == $languages_id) { + if ($lvalue['id'] == $_SESSION['languages_id']) { $language_code = $lkey; break; } } - $output = '
if ( typeof window.___gcfg == "undefined" ) { window.___gcfg = { }; } @@ -88,16 +91,75 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Google+ +1 Button Module', 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_STATUS', 'True', 'Do you want to allow products to be recommended through Google+ +1 Button?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Button Size', 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SIZE', 'Small', 'Sets the size of the button.', '6', '1', 'tep_cfg_select_option(array(\'Small\', \'Medium\', \'Standard\', \'Tall\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Annotation', 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION', 'None', 'The annotation to display next to the button.', '6', '1', 'tep_cfg_select_option(array(\'None\', \'Bubble\', \'Inline\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Inline Width', 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_WIDTH', '120', 'The width of the inline annotation in pixels (minimum 120).', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Inline Alignment', 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ALIGN', 'Left', 'The alignment of the inline annotation.', '6', '1', 'tep_cfg_select_option(array(\'Left\', \'Right\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Google+ +1 Button Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be recommended through Google+ +1 Button?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Button Size', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SIZE', + 'configuration_value' => 'Small', + 'configuration_description' => 'Sets the size of the button.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Small\', \'Medium\', \'Standard\', \'Tall\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Annotation', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ANNOTATION', + 'configuration_value' => 'None', + 'configuration_description' => 'The annotation to display next to the button.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'None\', \'Bubble\', \'Inline\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Inline Width', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_WIDTH', + 'configuration_value' => '120', + 'configuration_description' => 'The width of the inline annotation in pixels (minimum 120).', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Inline Alignment', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_ALIGN', + 'configuration_value' => 'Left', + 'configuration_description' => 'The alignment of the inline annotation.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Left\', \'Right\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_ONE_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_google_plus_share.php b/catalog/includes/modules/social_bookmarks/sb_google_plus_share.php index 9ab9bf5be..e1af23005 100644 --- a/catalog/includes/modules/social_bookmarks/sb_google_plus_share.php +++ b/catalog/includes/modules/social_bookmarks/sb_google_plus_share.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_google_plus_share { var $code = 'sb_google_plus_share'; var $title; @@ -30,7 +33,7 @@ function sb_google_plus_share() { } function getOutput() { - global $HTTP_GET_VARS, $lng, $languages_id; + global $lng; if (!isset($lng) || (isset($lng) && !is_object($lng))) { include(DIR_WS_CLASSES . 'language.php'); @@ -38,7 +41,7 @@ function getOutput() { } foreach ($lng->catalog_languages as $lkey => $lvalue) { - if ($lvalue['id'] == $languages_id) { + if ($lvalue['id'] == $_SESSION['languages_id']) { $language_code = $lkey; break; } @@ -50,7 +53,7 @@ function getOutput() { $button_height = 60; } - $output = '
0) { $output .= ' data-width="' . (int)MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_WIDTH . '"'; @@ -58,7 +61,7 @@ function getOutput() { $output .= ' data-height="' . $button_height . '" data-align="' . strtolower(MODULE_SOCIAL_BOOKMARKS_GOOGLE_PLUS_SHARE_ALIGN) . '">
'; - $output .= '', 'footer_scripts'); + $oscTemplate->addBlock('', 'footer_scripts'); $params = array(); // grab the product name (used for description) - $params['description'] = tep_get_products_name($HTTP_GET_VARS['products_id']); + $params['description'] = tep_get_products_name($_GET['products_id']); // and image (used for media) - $image_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); - $image = tep_db_fetch_array($image_query); + $Qimage = $OSCOM_Db->get('products', 'products_image', ['products_id' => (int)$_GET['products_id']]); - if (tep_not_null($image['products_image'])) { - $image_file = $image['products_image']; + if (!empty($Qimage->value('products_image'))) { + $image_file = $Qimage->value('products_image'); - $pi_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' order by sort_order"); + $Qimage = $OSCOM_Db->get('products_images', 'image', ['products_id' => (int)$_GET['products_id']], 'sort_order'); - if (tep_db_num_rows($pi_query) > 0) { - while ($pi = tep_db_fetch_array($pi_query)) { - if (tep_not_null($pi['image'])) { - $image_file = $pi['image']; // overwrite image with first multiple product image + if ($Qimage->fetch() !== false) { + do { + if (!empty($Qimage->value('image'))) { + $image_file = $Qimage->value('image'); // overwrite image with first multiple product image break; } - } + } while ($Qimage->fetch()); } - $params['media'] = tep_href_link(DIR_WS_IMAGES . $image_file, '', 'NONSSL', false); + $params['media'] = OSCOM::link(DIR_WS_IMAGES . $image_file, '', 'NONSSL', false); } // url - $params['url'] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false); + $params['url'] = OSCOM::link('product_info.php', 'products_id=' . $_GET['products_id'], 'NONSSL', false); $output = 'save('configuration', [ + 'configuration_title' => 'Enable Pinterest Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_PINTEREST_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow Pinterest Button?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Layout Position', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_PINTEREST_BUTTON_COUNT_POSITION', + 'configuration_value' => 'None', + 'configuration_description' => 'Horizontal or Vertical or None', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Horizontal\', \'Vertical\', \'None\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_PINTEREST_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_twitter.php b/catalog/includes/modules/social_bookmarks/sb_twitter.php index 14c84f81d..9ae1cd0c1 100644 --- a/catalog/includes/modules/social_bookmarks/sb_twitter.php +++ b/catalog/includes/modules/social_bookmarks/sb_twitter.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_twitter { var $code = 'sb_twitter'; var $title; @@ -30,9 +33,7 @@ function sb_twitter() { } function getOutput() { - global $HTTP_GET_VARS; - - return '' . tep_output_string_protected($this->public_title) . ''; + return '' . tep_output_string_protected($this->public_title) . ''; } function isEnabled() { @@ -52,12 +53,32 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Twitter Module', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_STATUS', 'True', 'Do you want to allow products to be shared through Twitter?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Twitter Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be shared through Twitter?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/social_bookmarks/sb_twitter_button.php b/catalog/includes/modules/social_bookmarks/sb_twitter_button.php index a7303b720..22e46a901 100644 --- a/catalog/includes/modules/social_bookmarks/sb_twitter_button.php +++ b/catalog/includes/modules/social_bookmarks/sb_twitter_button.php @@ -5,11 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\OSCOM; + use OSC\OM\Registry; + class sb_twitter_button { var $code = 'sb_twitter_button'; var $title; @@ -30,9 +33,7 @@ function sb_twitter_button() { } function getOutput() { - global $HTTP_GET_VARS; - - $params = array('url=' . urlencode(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL', false))); + $params = array('url=' . urlencode(OSCOM::link('product_info.php', 'products_id=' . $_GET['products_id'], 'NONSSL', false))); if ( strlen(MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_ACCOUNT) > 0 ) { $params[] = 'via=' . urlencode(MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_ACCOUNT); @@ -70,16 +71,73 @@ function check() { } function install() { - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Twitter Button Module', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_STATUS', 'True', 'Do you want to allow products to be shared through Twitter Button?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shop Owner Twitter Account', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_ACCOUNT', '', 'The Twitter account to attribute the tweet to and is recommended to the user to follow.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Related Twitter Account', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_RELATED_ACCOUNT', '', 'A related Twitter account that is also recommended to the user to follow.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Related Twitter Account Description', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_RELATED_ACCOUNT_DESC', '', 'A description for the related Twitter account.', '6', '0', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Count Position', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_COUNT_POSITION', 'Horizontal', 'The position of the counter.', '6', '0', 'tep_cfg_select_option(array(\'Horizontal\', \'Vertical\', \'None\'), ', now())"); - tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); + $OSCOM_Db = Registry::get('Db'); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Enable Twitter Button Module', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_STATUS', + 'configuration_value' => 'True', + 'configuration_description' => 'Do you want to allow products to be shared through Twitter Button?', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Shop Owner Twitter Account', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_ACCOUNT', + 'configuration_value' => '', + 'configuration_description' => 'The Twitter account to attribute the tweet to and is recommended to the user to follow.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Related Twitter Account', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_RELATED_ACCOUNT', + 'configuration_value' => '', + 'configuration_description' => 'A related Twitter account that is also recommended to the user to follow.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Related Twitter Account Description', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_RELATED_ACCOUNT_DESC', + 'configuration_value' => '', + 'configuration_description' => 'A description for the related Twitter account.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Count Position', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_COUNT_POSITION', + 'configuration_value' => 'Horizontal', + 'configuration_description' => 'The position of the counter.', + 'configuration_group_id' => '6', + 'sort_order' => '1', + 'set_function' => 'tep_cfg_select_option(array(\'Horizontal\', \'Vertical\', \'None\'), ', + 'date_added' => 'now()' + ]); + + $OSCOM_Db->save('configuration', [ + 'configuration_title' => 'Sort Order', + 'configuration_key' => 'MODULE_SOCIAL_BOOKMARKS_TWITTER_BUTTON_SORT_ORDER', + 'configuration_value' => '0', + 'configuration_description' => 'Sort order of display. Lowest is displayed first.', + 'configuration_group_id' => '6', + 'sort_order' => '0', + 'date_added' => 'now()' + ]); } function remove() { - tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); + return Registry::get('Db')->query('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")')->rowCount(); } function keys() { diff --git a/catalog/includes/modules/templates/new_products.php b/catalog/includes/modules/templates/new_products.php new file mode 100644 index 000000000..e9cf2791e --- /dev/null +++ b/catalog/includes/modules/templates/new_products.php @@ -0,0 +1,20 @@ + +
+
+ value('products_image'), $Qnew->value('products_name'), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT); ?> +
+

value('products_name'); ?>

+
+

display_price($Qnew->value('products_price'), tep_get_tax_rate($Qnew->value('products_tax_class_id'))); ?>

+
+
+ + +
+
+
+
+
diff --git a/catalog/includes/modules/upcoming_products.php b/catalog/includes/modules/upcoming_products.php index 63e433865..182dce209 100644 --- a/catalog/includes/modules/upcoming_products.php +++ b/catalog/includes/modules/upcoming_products.php @@ -5,34 +5,40 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ - $expected_query = tep_db_query("select p.products_id, pd.products_name, products_date_available as date_expected from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where to_days(products_date_available) >= to_days(now()) and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . " limit " . MAX_DISPLAY_UPCOMING_PRODUCTS); - if (tep_db_num_rows($expected_query) > 0) { -?> + use OSC\OM\OSCOM; -
-
- - -
+ $Qupcoming = $OSCOM_Db->prepare('select p.products_id, pd.products_name, products_date_available as date_expected from :table_products p, :table_products_description pd where to_days(p.products_date_available) >= to_days(now()) and p.products_id = pd.products_id and pd.language_id = :language_id order by ' . EXPECTED_PRODUCTS_FIELD . ' ' . EXPECTED_PRODUCTS_SORT . ' limit :limit'); + $Qupcoming->bindInt(':language_id', $_SESSION['languages_id']); + $Qupcoming->bindInt(':limit', MAX_DISPLAY_UPCOMING_PRODUCTS); + $Qupcoming->execute(); -
- + if ($Qupcoming->fetch() !== false) { +?> +
+
+
+ + + + + + + ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n"; - } + do { + echo ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n" . + ' ' . "\n"; + } while ($Qupcoming->fetch()); ?> - -
' . $expected['products_name'] . '' . tep_date_short($expected['date_expected']) . '
' . $Qupcoming->value('products_name') . '' . tep_date_short($Qupcoming->value('date_expected')) . '
-
+ +
-
+
hasBlocks('boxes_column_left')) { ?> -
- getBlocks('boxes_column_left'); ?> -
+
+ getBlocks('boxes_column_left'); ?> +
hasBlocks('boxes_column_right')) { ?> -
- getBlocks('boxes_column_right'); ?> -
+
+ getBlocks('boxes_column_right'); ?> +
- +
-
+
-getBlocks('footer_scripts'); ?> + + + + + getBlocks('footer_scripts'); ?> diff --git a/catalog/includes/template_top.php b/catalog/includes/template_top.php index ce768a998..5cd720fd3 100644 --- a/catalog/includes/template_top.php +++ b/catalog/includes/template_top.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -23,37 +23,39 @@ > - + + + <?php echo tep_output_string_protected($oscTemplate->getTitle()); ?> - - - - + - - - - + + + + + - + + + - - + + -960_24_col.css" /> - getBlocks('header_tags'); ?> -
+ getContent('navigation'); ?> + +
+ +
- + -
+
diff --git a/catalog/index.php b/catalog/index.php index 9c744a81e..df4e2f07b 100644 --- a/catalog/index.php +++ b/catalog/index.php @@ -5,24 +5,31 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\HTML; + use OSC\OM\OSCOM; + require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { - $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); - $categories_products = tep_db_fetch_array($categories_products_query); - if ($categories_products['total'] > 0) { + $Qcheck = $OSCOM_Db->prepare('select products_id from :table_products_to_categories where categories_id = :categories_id limit 1'); + $Qcheck->bindInt(':categories_id', $current_category_id); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { $category_depth = 'products'; // display products } else { - $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); - $category_parent = tep_db_fetch_array($category_parent_query); - if ($category_parent['total'] > 0) { + $Qcheck = $OSCOM_Db->prepare('select categories_id from :table_categories where parent_id = :parent_id'); + $Qcheck->bindInt(':parent_id', $current_category_id); + $Qcheck->execute(); + + if ($Qcheck->fetch() !== false) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message @@ -30,68 +37,83 @@ } } - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); + require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/index.php'); - require(DIR_WS_INCLUDES . 'template_top.php'); + require('includes/template_top.php'); if ($category_depth == 'nested') { - $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); - $category = tep_db_fetch_array($category_query); + $Qcategory = $OSCOM_Db->prepare('select cd.categories_name, c.categories_image from :table_categories c, :table_categories_description cd where c.categories_id = :categories_id and c.categories_id = cd.categories_id and cd.language_id = :language_id'); + $Qcategory->bindInt(':categories_id', $current_category_id); + $Qcategory->bindInt(':language_id', $_SESSION['languages_id']); + $Qcategory->execute(); ?> -

+ + +size('product_action') > 0) { + echo $messageStack->output('product_action'); + } +?>
- - +
prepare('select c.categories_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id'); + $Qcheck->bindInt(':parent_id', $category_links[$i]); + $Qcheck->bindInt(':language_id', $_SESSION['languages_id']); + $Qcheck->execute(); + + if ($Qcheck->fetch() === false) { // do nothing, go through the loop } else { - $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); + $deepest_category_id = $category_links[$i]; break; // we've found the deepest category the customer is in } } - } else { - $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); } - $number_of_categories = tep_db_num_rows($categories_query); - - $rows = 0; - while ($categories = tep_db_fetch_array($categories_query)) { - $rows++; - $cPath_new = tep_get_path($categories['categories_id']); - $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; - echo '
' . "\n"; - if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { - echo ' ' . "\n"; - echo ' ' . "\n"; - } + $Qcategories = $OSCOM_Db->prepare('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by sort_order, cd.categories_name'); + $Qcategories->bindInt(':parent_id', $deepest_category_id); + $Qcategories->bindInt(':language_id', $_SESSION['languages_id']); + $Qcategories->execute(); + + while ($Qcategories->fetch()) { + $cPath_new = tep_get_path($Qcategories->valueInt('categories_id')); + + echo ''; } // needed for the new products module shown below $new_products_category_id = $current_category_id; ?> - -
' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '
' . $categories['categories_name'] . '
+
-
+
- +
PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, @@ -105,137 +127,175 @@ asort($define_list); $column_list = array(); - reset($define_list); - while (list($key, $value) = each($define_list)) { + foreach($define_list as $key => $value) { if ($value > 0) $column_list[] = $key; } - $select_column_list = ''; + $search_query = 'select SQL_CALC_FOUND_ROWS'; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PRODUCT_LIST_MODEL': - $select_column_list .= 'p.products_model, '; + $search_query .= ' p.products_model,'; break; case 'PRODUCT_LIST_NAME': - $select_column_list .= 'pd.products_name, '; + $search_query .= ' pd.products_name,'; break; case 'PRODUCT_LIST_MANUFACTURER': - $select_column_list .= 'm.manufacturers_name, '; + $search_query .= ' m.manufacturers_name,'; break; case 'PRODUCT_LIST_QUANTITY': - $select_column_list .= 'p.products_quantity, '; + $search_query .= ' p.products_quantity,'; break; case 'PRODUCT_LIST_IMAGE': - $select_column_list .= 'p.products_image, '; + $search_query .= ' p.products_image,'; break; case 'PRODUCT_LIST_WEIGHT': - $select_column_list .= 'p.products_weight, '; + $search_query .= ' p.products_weight,'; break; } } // show the products of a specified manufacturer - if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) { - if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { + if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) { + if (isset($_GET['filter_id']) && tep_not_null($_GET['filter_id'])) { // We are asked to show only a specific category - $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; + $search_query .= ' p.products_id, SUBSTRING_INDEX(pd.products_description, " ", 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from :table_products p left join :table_specials s on p.products_id = s.products_id, :table_products_description pd, :table_manufacturers m, :table_products_to_categories p2c where p.products_status = "1" and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = :manufacturers_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = :language_id and p2c.categories_id = :categories_id'; } else { // We show them all - $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; + $search_query .= ' p.products_id, SUBSTRING_INDEX(pd.products_description, " ", 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from :table_products p left join :table_specials s on p.products_id = s.products_id, :table_products_description pd, :table_manufacturers m where p.products_status = "1" and pd.products_id = p.products_id and pd.language_id = :language_id and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = :manufacturers_id'; } } else { // show the products in a given categorie - if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { + if (isset($_GET['filter_id']) && tep_not_null($_GET['filter_id'])) { // We are asked to show only specific catgeory - $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; + $search_query .= ' p.products_id, SUBSTRING_INDEX(pd.products_description, " ", 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from :table_products p left join :table_specials s on p.products_id = s.products_id, :table_products_description pd, :table_manufacturers m, :table_products_to_categories p2c where p.products_status = "1" and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = :manufacturers_id and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = :language_id and p2c.categories_id = :categories_id'; } else { // We show them all - $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; + $search_query .= ' p.products_id, SUBSTRING_INDEX(pd.products_description, " ", 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from :table_products_description pd, :table_products p left join :table_manufacturers m on p.manufacturers_id = m.manufacturers_id left join :table_specials s on p.products_id = s.products_id, :table_products_to_categories p2c where p.products_status = "1" and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = :language_id and p2c.categories_id = :categories_id'; } } - if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { + if ( (!isset($_GET['sort'])) || (!preg_match('/^[1-8][ad]$/', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { - $HTTP_GET_VARS['sort'] = $i+1 . 'a'; - $listing_sql .= " order by pd.products_name"; + $_GET['sort'] = $i+1 . 'a'; + $search_query .= ' order by pd.products_name'; break; } } } else { - $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); - $sort_order = substr($HTTP_GET_VARS['sort'], 1); + $sort_col = substr($_GET['sort'], 0 , 1); + $sort_order = substr($_GET['sort'], 1); switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': - $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by p.products_model ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_NAME': - $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); + $search_query .= ' order by pd.products_name ' . ($sort_order == 'd' ? 'desc' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': - $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by m.manufacturers_name ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_QUANTITY': - $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by p.products_quantity ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_IMAGE': - $listing_sql .= " order by pd.products_name"; + $search_query .= ' order by pd.products_name'; break; case 'PRODUCT_LIST_WEIGHT': - $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by p.products_weight ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; case 'PRODUCT_LIST_PRICE': - $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; + $search_query .= ' order by final_price ' . ($sort_order == 'd' ? 'desc' : '') . ', pd.products_name'; break; } } + $search_query .= ' limit :page_set_offset, :page_set_max_results'; + + $Qlisting = $OSCOM_Db->prepare($search_query); + + if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) { + if (isset($_GET['filter_id']) && tep_not_null($_GET['filter_id'])) { + $Qlisting->bindInt(':manufacturers_id', $_GET['manufacturers_id']); + $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); + $Qlisting->bindInt(':categories_id', $_GET['filter_id']); + } else { + $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); + $Qlisting->bindInt(':manufacturers_id', $_GET['manufacturers_id']); + } + } else { + if (isset($_GET['filter_id']) && tep_not_null($_GET['filter_id'])) { + $Qlisting->bindInt(':manufacturers_id', $_GET['filter_id']); + $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); + $Qlisting->bindInt(':categories_id', $current_category_id); + } else { + $Qlisting->bindInt(':language_id', $_SESSION['languages_id']); + $Qlisting->bindInt(':categories_id', $current_category_id); + } + } + + $Qlisting->setPageSet(MAX_DISPLAY_SEARCH_RESULTS); + $Qlisting->execute(); + $catname = HEADING_TITLE; - if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) { - $image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); - $image = tep_db_fetch_array($image); - $catname = $image['catname']; + if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) { + $Qtitle = $OSCOM_Db->prepare('select manufacturers_image, manufacturers_name as catname from :table_manufacturers where manufacturers_id = :manufacturers_id'); + $Qtitle->bindInt(':manufacturers_id', $_GET['manufacturers_id']); + $Qtitle->execute(); + + $catname = $Qtitle->value('catname'); } elseif ($current_category_id) { - $image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); - $image = tep_db_fetch_array($image); - $catname = $image['catname']; + $Qtitle = $OSCOM_Db->prepare('select c.categories_image, cd.categories_name as catname from :table_categories c, :table_categories_description cd where c.categories_id = :categories_id and c.categories_id = cd.categories_id and cd.language_id = :language_id'); + $Qtitle->bindInt(':categories_id', $current_category_id); + $Qtitle->bindInt(':language_id', $_SESSION['languages_id']); + $Qtitle->execute(); + + $catname = $Qtitle->value('catname'); } ?> -

+
0) { - if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) { - $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name"; + if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) { + $Qfilter = $OSCOM_Db->prepare('select SQL_CALC_FOUND_ROWS distinct c.categories_id as id, cd.categories_name as name from :table_products p, :table_products_to_categories p2c, :table_categories c, :table_categories_description cd where p.manufacturers_id = :manufacturers_id and p.products_status = "1" and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by cd.categories_name'); + $Qfilter->bindInt(':language_id', $_SESSION['languages_id']); + $Qfilter->bindInt(':manufacturers_id', $_GET['manufacturers_id']); + $Qfilter->execute(); } else { - $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name"; + $Qfilter = $OSCOM_Db->prepare('select SQL_CALC_FOUND_ROWS distinct m.manufacturers_id as id, m.manufacturers_name as name from :table_products p, :table_products_to_categories p2c, :table_manufacturers m where p.products_status = 1 and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = :categories_id order by m.manufacturers_name'); + $Qfilter->bindInt(':categories_id', $current_category_id); + $Qfilter->execute(); } - $filterlist_query = tep_db_query($filterlist_sql); - if (tep_db_num_rows($filterlist_query) > 1) { - echo '
' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . '

' . TEXT_SHOW . ' '; - if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) { - echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']); + + if ($Qfilter->getPageSetTotalRows() > 1) { + echo '

' . HTML::form('filter', OSCOM::link('index.php', '', $request_type, false), 'get', null, ['session_id' => true]) . '

' . TEXT_SHOW . ' '; + if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) { + echo HTML::hiddenField('manufacturers_id', $_GET['manufacturers_id']); $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)); } else { - echo tep_draw_hidden_field('cPath', $cPath); + echo HTML::hiddenField('cPath', $cPath); $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)); } - echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']); - while ($filterlist = tep_db_fetch_array($filterlist_query)) { - $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); + echo HTML::hiddenField('sort', $_GET['sort']); + while ($Qfilter->fetch()) { + $options[] = array('id' => $Qfilter->valueInt('id'), 'text' => $Qfilter->value('name')); } - echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); - echo tep_hide_session_id() . '

' . "\n"; + echo HTML::selectField('filter_id', $options, (isset($_GET['filter_id']) ? $_GET['filter_id'] : ''), 'onchange="this.form.submit()"'); + echo '

' . "\n"; } } - include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); + include('includes/modules/product_listing.php'); ?>
@@ -244,10 +304,18 @@ } else { // default page ?> -

+ + +size('product_action') > 0) { + echo $messageStack->output('product_action'); + } +?>
-
+
@@ -262,8 +330,8 @@
@@ -271,6 +339,6 @@ diff --git a/catalog/info_shopping_cart.php b/catalog/info_shopping_cart.php deleted file mode 100644 index 4babc042d..000000000 --- a/catalog/info_shopping_cart.php +++ /dev/null @@ -1,38 +0,0 @@ -remove_current_page(); - - require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_INFO_SHOPPING_CART); -?> - -> - - -<?php echo TITLE; ?> - - - - -


-


-


-


-

- - - diff --git a/catalog/install/images/failed.gif b/catalog/install/images/failed.gif deleted file mode 100644 index bc76b815c..000000000 Binary files a/catalog/install/images/failed.gif and /dev/null differ diff --git a/catalog/install/images/progress.gif b/catalog/install/images/progress.gif deleted file mode 100644 index a54d2e97f..000000000 Binary files a/catalog/install/images/progress.gif and /dev/null differ diff --git a/catalog/install/images/success.gif b/catalog/install/images/success.gif deleted file mode 100644 index 510d66599..000000000 Binary files a/catalog/install/images/success.gif and /dev/null differ diff --git a/catalog/install/includes/application.php b/catalog/install/includes/application.php index b219b3f90..d9021eccd 100644 --- a/catalog/install/includes/application.php +++ b/catalog/install/includes/application.php @@ -5,16 +5,21 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2007 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ -// Set the level of error reporting - error_reporting(E_ALL & ~E_NOTICE); + use OSC\OM\OSCOM; - require('includes/functions/compatibility.php'); - require('includes/functions/general.php'); - require('includes/functions/database.php'); - require('includes/functions/html_output.php'); +// set the level of error reporting + error_reporting(E_ALL | E_STRICT); + ini_set('display_errors', true); // TODO remove on release + + define('OSCOM_BASE_DIR', realpath(__DIR__ . '/../../includes/') . '/'); + + require(OSCOM_BASE_DIR . 'OSC/OM/OSCOM.php'); + spl_autoload_register('OSC\\OM\\OSCOM::autoload'); + + OSCOM::initialize(); ?> diff --git a/catalog/install/includes/functions/compatibility.php b/catalog/install/includes/functions/compatibility.php deleted file mode 100644 index 93e59430f..000000000 --- a/catalog/install/includes/functions/compatibility.php +++ /dev/null @@ -1,29 +0,0 @@ -= 4.1) { - $HTTP_GET_VARS =& $_GET; - $HTTP_POST_VARS =& $_POST; - $HTTP_COOKIE_VARS =& $_COOKIE; - $HTTP_SESSION_VARS =& $_SESSION; - $HTTP_SERVER_VARS =& $_SERVER; - } else { - if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array(); - if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array(); - if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array(); - } - -// set default timezone if none exists (PHP 5.3 throws an E_WARNING) - if ((strlen(ini_get('date.timezone')) < 1) && function_exists('date_default_timezone_set')) { - date_default_timezone_set(@date_default_timezone_get()); - } -?> diff --git a/catalog/install/includes/functions/database.php b/catalog/install/includes/functions/database.php deleted file mode 100644 index d786f222f..000000000 --- a/catalog/install/includes/functions/database.php +++ /dev/null @@ -1,191 +0,0 @@ - diff --git a/catalog/install/includes/functions/general.php b/catalog/install/includes/functions/general.php deleted file mode 100644 index 175b10515..000000000 --- a/catalog/install/includes/functions/general.php +++ /dev/null @@ -1,99 +0,0 @@ -HashPassword($plain); - } - -//// -// Wrapper function for is_writable() for Windows compatibility - function osc_is_writable($file) { - if (strtolower(substr(PHP_OS, 0, 3)) === 'win') { - if (file_exists($file)) { - $file = realpath($file); - if (is_dir($file)) { - $result = @tempnam($file, 'osc'); - if (is_string($result) && file_exists($result)) { - unlink($result); - return (strpos($result, $file) === 0) ? true : false; - } - } else { - $handle = @fopen($file, 'r+'); - if (is_resource($handle)) { - fclose($handle); - return true; - } - } - } else{ - $dir = dirname($file); - if (file_exists($dir) && is_dir($dir) && osc_is_writable($dir)) { - return true; - } - } - return false; - } else { - return is_writable($file); - } - } - -//// -// Parse the data used in the html tags to ensure the tags will not break - function osc_parse_input_field_data($data, $parse) { - return strtr(trim($data), $parse); - } - - function osc_output_string($string, $translate = false, $protected = false) { - if ($protected == true) { - return htmlspecialchars($string); - } else { - if ($translate == false) { - return osc_parse_input_field_data($string, array('"' => '"')); - } else { - return osc_parse_input_field_data($string, $translate); - } - } - } -?> \ No newline at end of file diff --git a/catalog/install/includes/functions/html_output.php b/catalog/install/includes/functions/html_output.php deleted file mode 100644 index 8112d82f2..000000000 --- a/catalog/install/includes/functions/html_output.php +++ /dev/null @@ -1,195 +0,0 @@ -'; - - return $field; - } - - function osc_draw_password_field($name, $parameters = null) { - return osc_draw_input_field($name, null, $parameters, false, 'password'); - } - - function osc_draw_hidden_field($name, $value) { - return ''; - } - - function osc_draw_select_menu($name, $values, $default = null, $parameters = null) { - global $HTTP_GET_VARS, $HTTP_POST_VARS; - - $group = false; - - if ( isset($HTTP_GET_VARS[$name]) ) { - $default = $HTTP_GET_VARS[$name]; - } elseif ( isset($HTTP_POST_VARS[$name]) ) { - $default = $HTTP_POST_VARS[$name]; - } - - $field = ''; - - return $field; - } - - function osc_draw_time_zone_select_menu($name, $default = null) { - if ( !isset($default) ) { - $default = date_default_timezone_get(); - } - - $time_zones_array = array(); - - foreach ( timezone_identifiers_list() as $id ) { - $tz_string = str_replace('_', ' ', $id); - - $id_array = explode('/', $tz_string, 2); - - $time_zones_array[$id_array[0]][$id] = isset($id_array[1]) ? $id_array[1] : $id_array[0]; - } - - $result = array(); - - foreach ( $time_zones_array as $zone => $zones_array ) { - foreach ( $zones_array as $key => $value ) { - $result[] = array('id' => $key, - 'text' => $value, - 'group' => $zone); - } - } - - return osc_draw_select_menu($name, $result, $default); - } - -//// -// Output a jQuery UI Button - function osc_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) { - static $button_counter = 1; - - $types = array('submit', 'button', 'reset'); - - if ( !isset($params['type']) ) { - $params['type'] = 'submit'; - } - - if ( !in_array($params['type'], $types) ) { - $params['type'] = 'submit'; - } - - if ( ($params['type'] == 'submit') && isset($link) ) { - $params['type'] = 'button'; - } - - if (!isset($priority)) { - $priority = 'secondary'; - } - - $button = ''; - - if ( ($params['type'] == 'button') && isset($link) ) { - $button .= ''; - - $button_counter++; - - return $button; - } -?> diff --git a/catalog/install/index.php b/catalog/install/index.php index ab57e2996..6d11d17e1 100644 --- a/catalog/install/index.php +++ b/catalog/install/index.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2007 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ diff --git a/catalog/install/install.php b/catalog/install/install.php index 3aa7a746f..13ae42534 100644 --- a/catalog/install/install.php +++ b/catalog/install/install.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2007 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ @@ -14,8 +14,8 @@ $page_contents = 'install.php'; - if (isset($HTTP_GET_VARS['step']) && is_numeric($HTTP_GET_VARS['step'])) { - switch ($HTTP_GET_VARS['step']) { + if (isset($_GET['step']) && is_numeric($_GET['step'])) { + switch ($_GET['step']) { case '2': $page_contents = 'install_2.php'; break; diff --git a/catalog/install/oscommerce.sql b/catalog/install/oscommerce.sql index a483627f1..330aa5a4e 100644 --- a/catalog/install/oscommerce.sql +++ b/catalog/install/oscommerce.sql @@ -3,7 +3,7 @@ # osCommerce, Open Source E-Commerce Solutions # http://www.oscommerce.com # -# Copyright (c) 2014 osCommerce +# Copyright (c) 2015 osCommerce # # Released under the GNU General Public License # @@ -336,6 +336,7 @@ CREATE TABLE orders_products ( final_price decimal(15,4) NOT NULL, products_tax decimal(7,4) NOT NULL, products_quantity int(2) NOT NULL, + products_full_id varchar(64) NOT NULL, PRIMARY KEY (orders_products_id), KEY idx_orders_products_orders_id (orders_id), KEY idx_orders_products_products_id (products_id) @@ -694,32 +695,26 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Cart After Adding Product', 'DISPLAY_CART', 'true', 'Display the shopping cart after adding a product (or return back to their origin)', '1', '14', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Allow Guest To Tell A Friend', 'ALLOW_GUEST_TO_TELL_A_FRIEND', 'false', 'Allow guests to tell a friend about a product', '1', '15', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Default Search Operator', 'ADVANCED_SEARCH_DEFAULT_OPERATOR', 'and', 'Default search operators', '1', '17', 'tep_cfg_select_option(array(\'and\', \'or\'), ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Store Address and Phone', 'STORE_NAME_ADDRESS', 'Store Name\nAddress\nCountry\nPhone', 'This is the Store Name, Address and Phone used on printable documents and displayed online', '1', '18', 'tep_cfg_textarea(', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Show Category Counts', 'SHOW_COUNTS', 'true', 'Count recursively how many products are in each category', '1', '19', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Tax Decimal Places', 'TAX_DECIMAL_PLACES', '0', 'Pad the tax value this amount of decimal places', '1', '20', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Prices with Tax', 'DISPLAY_PRICE_WITH_TAX', 'false', 'Display prices with tax included (true) or add the tax at the end (false)', '1', '21', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Store Address', 'STORE_ADDRESS', 'Address\nCountry', 'This is the Store Address used on printable documents and displayed online', '1', '18', 'tep_cfg_textarea(', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Store Phone', 'STORE_PHONE', '01 234 5678', 'This is the Store Phone used on printable documents and displayed online', '1', '19', 'tep_cfg_textarea(', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Tax Decimal Places', 'TAX_DECIMAL_PLACES', '0', 'Pad the tax value this amount of decimal places', '1', '21', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display Prices with Tax', 'DISPLAY_PRICE_WITH_TAX', 'false', 'Display prices with tax included (true) or add the tax at the end (false)', '1', '22', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('First Name', 'ENTRY_FIRST_NAME_MIN_LENGTH', '2', 'Minimum length of first name', '2', '1', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Last Name', 'ENTRY_LAST_NAME_MIN_LENGTH', '2', 'Minimum length of last name', '2', '2', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Date of Birth', 'ENTRY_DOB_MIN_LENGTH', '10', 'Minimum length of date of birth', '2', '3', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('E-Mail Address', 'ENTRY_EMAIL_ADDRESS_MIN_LENGTH', '6', 'Minimum length of e-mail address', '2', '4', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Street Address', 'ENTRY_STREET_ADDRESS_MIN_LENGTH', '5', 'Minimum length of street address', '2', '5', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Company', 'ENTRY_COMPANY_MIN_LENGTH', '2', 'Minimum length of company name', '2', '6', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Post Code', 'ENTRY_POSTCODE_MIN_LENGTH', '4', 'Minimum length of post code', '2', '7', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('City', 'ENTRY_CITY_MIN_LENGTH', '3', 'Minimum length of city', '2', '8', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('State', 'ENTRY_STATE_MIN_LENGTH', '2', 'Minimum length of state', '2', '9', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Telephone Number', 'ENTRY_TELEPHONE_MIN_LENGTH', '3', 'Minimum length of telephone number', '2', '10', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Password', 'ENTRY_PASSWORD_MIN_LENGTH', '5', 'Minimum length of password', '2', '11', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Credit Card Owner Name', 'CC_OWNER_MIN_LENGTH', '3', 'Minimum length of credit card owner name', '2', '12', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Credit Card Number', 'CC_NUMBER_MIN_LENGTH', '10', 'Minimum length of credit card number', '2', '13', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Review Text', 'REVIEW_TEXT_MIN_LENGTH', '50', 'Minimum length of review text', '2', '14', now()); + INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Best Sellers', 'MIN_DISPLAY_BESTSELLERS', '1', 'Minimum number of best sellers to display', '2', '15', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Also Purchased', 'MIN_DISPLAY_ALSO_PURCHASED', '1', 'Minimum number of products to display in the \'This Customer Also Purchased\' box', '2', '16', now()); - INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Address Book Entries', 'MAX_ADDRESS_BOOK_ENTRIES', '5', 'Maximum address book entries a customer is allowed to have', '3', '1', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Search Results', 'MAX_DISPLAY_SEARCH_RESULTS', '20', 'Amount of products to list', '3', '2', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Products List', 'MAX_DISPLAY_SEARCH_RESULTS', '20', 'Amount of products to list', '3', '2', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Page Links', 'MAX_DISPLAY_PAGE_LINKS', '5', 'Number of \'number\' links use for page-sets', '3', '3', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Special Products', 'MAX_DISPLAY_SPECIAL_PRODUCTS', '9', 'Maximum number of products on special to display', '3', '4', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('New Products Module', 'MAX_DISPLAY_NEW_PRODUCTS', '9', 'Maximum number of new products to display in a category', '3', '5', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Products Expected', 'MAX_DISPLAY_UPCOMING_PRODUCTS', '10', 'Maximum number of products expected to display', '3', '6', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Manufacturers List', 'MAX_DISPLAY_MANUFACTURERS_IN_A_LIST', '0', 'Used in manufacturers box; when the number of manufacturers exceeds this number, a drop-down list will be displayed instead of the default list', '3', '7', now()); @@ -729,8 +724,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Selection of Random Reviews', 'MAX_RANDOM_SELECT_REVIEWS', '10', 'How many records to select from to choose one random product review', '3', '10', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Selection of Random New Products', 'MAX_RANDOM_SELECT_NEW', '10', 'How many records to select from to choose one random new product to display', '3', '11', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Selection of Products on Special', 'MAX_RANDOM_SELECT_SPECIALS', '10', 'How many records to select from to choose one random product special to display', '3', '12', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Categories To List Per Row', 'MAX_DISPLAY_CATEGORIES_PER_ROW', '3', 'How many categories to list per row', '3', '13', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('New Products Listing', 'MAX_DISPLAY_PRODUCTS_NEW', '10', 'Maximum number of new products to display in new products page', '3', '14', now()); + INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Best Sellers', 'MAX_DISPLAY_BESTSELLERS', '10', 'Maximum number of best sellers to display', '3', '15', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Also Purchased', 'MAX_DISPLAY_ALSO_PURCHASED', '6', 'Maximum number of products to display in the \'This Customer Also Purchased\' box', '3', '16', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Customer Order History Box', 'MAX_DISPLAY_PRODUCTS_IN_ORDER_HISTORY_BOX', '6', 'Maximum number of products to display in the customer order history box', '3', '17', now()); @@ -816,7 +810,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Product Price', 'PRODUCT_LIST_PRICE', '3', 'Do you want to display the Product Price', '8', '5', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Product Quantity', 'PRODUCT_LIST_QUANTITY', '0', 'Do you want to display the Product Quantity?', '8', '6', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Product Weight', 'PRODUCT_LIST_WEIGHT', '0', 'Do you want to display the Product Weight?', '8', '7', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Buy Now column', 'PRODUCT_LIST_BUY_NOW', '4', 'Do you want to display the Buy Now column?', '8', '8', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Buy Now Button', 'PRODUCT_LIST_BUY_NOW', '4', 'Do you want to display the Buy Now Button?', '8', '8', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Category/Manufacturer Filter (0=disable; 1=enable)', 'PRODUCT_LIST_FILTER', '1', 'Do you want to display the Category/Manufacturer Filter?', '8', '9', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Location of Prev/Next Navigation Bar (1-top, 2-bottom, 3-both)', 'PREV_NEXT_BAR_LOCATION', '2', 'Sets the location of the Prev/Next Navigation Bar (1-top, 2-bottom, 3-both)', '8', '10', now()); @@ -859,6 +853,11 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Last Update Check Time', 'LAST_UPDATE_CHECK_TIME', '', 'Last time a check for new versions of osCommerce was run', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) VALUES ('Store Logo', 'STORE_LOGO', 'store_logo.png', 'This is the filename of your Store Logo. This should be updated at Admin > Configuration > Store Logo', '6', '0', NULL, now()); + +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Bootstrap Container', 'BOOTSTRAP_CONTAINER', 'container-fluid', 'What type of container should the page content be shown in? See http://getbootstrap.com/css/#overview-container', '16', '1', 'tep_cfg_select_option(array(\'container-fluid\', \'container\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Bootstrap Content', 'BOOTSTRAP_CONTENT', '8', 'What width should the page content default to? (8 = two thirds width, 6 = half width, 4 = one third width) Note that the Side Column(s) - if installed - will adjust automatically.', '16', '2', 'tep_cfg_select_option(array(\'8\', \'6\', \'4\'), ', now()); + INSERT INTO configuration_group VALUES ('1', 'My Store', 'General information about my store', '1', '1'); INSERT INTO configuration_group VALUES ('2', 'Minimum Values', 'The minimum values for functions / data', '2', '1'); INSERT INTO configuration_group VALUES ('3', 'Maximum Values', 'The maximum values for functions / data', '3', '1'); @@ -874,6 +873,7 @@ INSERT INTO configuration_group VALUES ('12', 'E-Mail Options', 'General setting INSERT INTO configuration_group VALUES ('13', 'Download', 'Downloadable products options', '13', '1'); INSERT INTO configuration_group VALUES ('14', 'GZip Compression', 'GZip compression options', '14', '1'); INSERT INTO configuration_group VALUES ('15', 'Sessions', 'Session options', '15', '1'); +INSERT INTO configuration_group VALUES ('16', 'Bootstrap Setup', 'Bootstrap Options', '16', '1'); INSERT INTO countries VALUES (1,'Afghanistan','AF','AFG','1'); INSERT INTO countries VALUES (2,'Albania','AL','ALB','1'); @@ -1576,7 +1576,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_SORT_ORDER', '820', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); # Boxes -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_BOXES_INSTALLED', 'bm_categories.php;bm_manufacturers.php;bm_search.php;bm_whats_new.php;bm_information.php;bm_card_acceptance.php;bm_shopping_cart.php;bm_manufacturer_info.php;bm_order_history.php;bm_best_sellers.php;bm_product_notifications.php;bm_product_social_bookmarks.php;bm_specials.php;bm_reviews.php;bm_languages.php;bm_currencies.php', 'List of box module filenames separated by a semi-colon. This is automatically updated. No need to edit.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_BOXES_INSTALLED', 'bm_categories.php;bm_manufacturers.php;bm_search.php;bm_whats_new.php;bm_card_acceptance.php;bm_shopping_cart.php;bm_manufacturer_info.php;bm_order_history.php;bm_best_sellers.php;bm_product_notifications.php;bm_product_social_bookmarks.php;bm_specials.php;bm_reviews.php;bm_languages.php;bm_currencies.php', 'List of box module filenames separated by a semi-colon. This is automatically updated. No need to edit.', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Best Sellers Module', 'MODULE_BOXES_BEST_SELLERS_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_BEST_SELLERS_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_BEST_SELLERS_SORT_ORDER', '5030', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); @@ -1586,9 +1586,6 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Currencies Module', 'MODULE_BOXES_CURRENCIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_CURRENCIES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_CURRENCIES_SORT_ORDER', '5090', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_INFORMATION_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now()); -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_INFORMATION_SORT_ORDER', '1050', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Languages Module', 'MODULE_BOXES_LANGUAGES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_LANGUAGES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_LANGUAGES_SORT_ORDER', '5080', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); @@ -1631,7 +1628,8 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Template Block Groups', 'TEMPLATE_BLOCK_GROUPS', 'boxes;header_tags', 'This is automatically updated. No need to edit.', '6', '0', now()); # Content Modules -INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Modules', 'MODULE_CONTENT_INSTALLED', 'account/cm_account_set_password;checkout_success/cm_cs_redirect_old_order;checkout_success/cm_cs_thank_you;checkout_success/cm_cs_product_notifications;checkout_success/cm_cs_downloads;login/cm_login_form;login/cm_create_account_link', 'This is automatically updated. No need to edit.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Installed Modules', 'MODULE_CONTENT_INSTALLED', 'account/cm_account_set_password;checkout_success/cm_cs_redirect_old_order;checkout_success/cm_cs_thank_you;checkout_success/cm_cs_product_notifications;checkout_success/cm_cs_downloads;login/cm_login_form;login/cm_create_account_link;navigation/cm_navbar;header/cm_header_logo;header/cm_header_buttons;header/cm_header_breadcrumb;header/cm_header_messagestack;footer/cm_footer_information_links;footer_suffix/cm_footer_extra_copyright;footer_suffix/cm_footer_extra_icons', 'This is automatically updated. No need to edit.', '6', '0', now()); + INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Set Account Password', 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_STATUS', 'True', 'Do you want to enable the Set Account Password module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Local Passwords', 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_ALLOW_PASSWORD', 'True', 'Allow local account passwords to be set.', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SORT_ORDER', '100', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); @@ -1650,3 +1648,27 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable New User Module', 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_STATUS', 'True', 'Do you want to enable the new user module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_CONTENT_WIDTH', 'Half', 'Should the content be shown in a full or half width container?', '6', '1', 'tep_cfg_select_option(array(\'Full\', \'Half\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_CREATE_ACCOUNT_LINK_SORT_ORDER', '2000', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); + +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Navbar Module', 'MODULE_CONTENT_NAVBAR_STATUS', 'True', 'Should the Navbar be shown? ', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_NAVBAR_SORT_ORDER', '10', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Header Logo Module', 'MODULE_CONTENT_HEADER_LOGO_STATUS', 'True', 'Do you want to enable the Logo content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_HEADER_LOGO_CONTENT_WIDTH', '6', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_LOGO_SORT_ORDER', '10', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Header Buttons Module', 'MODULE_CONTENT_HEADER_BUTTONS_STATUS', 'True', 'Do you want to enable the Buttons content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_HEADER_BUTTONS_CONTENT_WIDTH', '6', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_BUTTONS_SORT_ORDER', '20', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Header Breadcrumb Module', 'MODULE_CONTENT_HEADER_BREADCRUMB_STATUS', 'True', 'Do you want to enable the Breadcrumb content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER', '30', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Message Stack Notifications Module', 'MODULE_CONTENT_HEADER_MESSAGESTACK_STATUS', 'True', 'Should the Message Stack Notifications be shown in the header when needed? ', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_MESSAGESTACK_SORT_ORDER', '40', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Links Footer Module', 'MODULE_CONTENT_FOOTER_INFORMATION_STATUS', 'True', 'Do you want to enable the Information Links content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_FOOTER_INFORMATION_CONTENT_WIDTH', '3', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_FOOTER_INFORMATION_SORT_ORDER', '10', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Contact Us Footer Module', 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_STATUS', 'True', 'Do you want to enable the Copyright content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_CONTENT_WIDTH', '6', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_FOOTER_EXTRA_COPYRIGHT_SORT_ORDER', '10', 'Sort order of display. Lowest is displayed first.', '6', '1', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Contact Us Footer Module', 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_STATUS', 'True', 'Do you want to enable the Payment Icons content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_CONTENT_WIDTH', '6', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_FOOTER_EXTRA_ICONS_SORT_ORDER', '20', 'Sort order of display. Lowest is displayed first.', '6', '1', now()); + diff --git a/catalog/install/rpc.php b/catalog/install/rpc.php index 378798285..bbdfe9739 100644 --- a/catalog/install/rpc.php +++ b/catalog/install/rpc.php @@ -5,11 +5,13 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2013 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ + use OSC\OM\Db; + header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); @@ -17,56 +19,75 @@ $dir_fs_www_root = dirname(__FILE__); - if (isset($HTTP_GET_VARS['action']) && !empty($HTTP_GET_VARS['action'])) { - switch ($HTTP_GET_VARS['action']) { - case 'dbCheck': - $db = array('DB_SERVER' => trim(rawurldecode($HTTP_GET_VARS['server'])), - 'DB_SERVER_USERNAME' => trim(rawurldecode($HTTP_GET_VARS['username'])), - 'DB_SERVER_PASSWORD' => trim(rawurldecode($HTTP_GET_VARS['password'])), - 'DB_DATABASE' => trim(rawurldecode($HTTP_GET_VARS['name'])) - ); - - $db_error = false; - osc_db_connect($db['DB_SERVER'], $db['DB_SERVER_USERNAME'], $db['DB_SERVER_PASSWORD']); + $result = false; - if ($db_error == false) { - osc_db_select_db($db['DB_DATABASE']); + if (isset($_GET['action']) && !empty($_GET['action'])) { + switch ($_GET['action']) { + case 'dbCheck': + try { + $OSCOM_Db = Db::initialize($_GET['server'], $_GET['username'], $_GET['password'], $_GET['name']); + } catch (\Exception $e) { + $result = $e->getCode() . '|' . $e->getMessage(); } - if ($db_error != false) { - echo '[[0|' . $db_error . ']]'; + if ($result === false) { + $result = true; } else { - echo '[[1]]'; - } + $error = explode('|', $result, 2); - exit; - break; + if (($error[0] == '1049') && isset($_GET['createDb']) && ($_GET['createDb'] == 'true')) { + $result = false; - case 'dbImport': - $db = array('DB_SERVER' => trim(rawurldecode($HTTP_GET_VARS['server'])), - 'DB_SERVER_USERNAME' => trim(rawurldecode($HTTP_GET_VARS['username'])), - 'DB_SERVER_PASSWORD' => trim(rawurldecode($HTTP_GET_VARS['password'])), - 'DB_DATABASE' => trim(rawurldecode($HTTP_GET_VARS['name'])), - ); + try { + $OSCOM_Db = Db::initialize($_GET['server'], $_GET['username'], $_GET['password'], ''); + + $OSCOM_Db->exec('create database ' . Db::prepareIdentifier($_GET['name']) . ' character set utf8 collate utf8_unicode_ci'); + } catch (\Exception $e) { + $result = $e->getCode() . '|' . $e->getMessage(); + } - osc_db_connect($db['DB_SERVER'], $db['DB_SERVER_USERNAME'], $db['DB_SERVER_PASSWORD']); + if ($result === false) { + $result = true; + } + } + } - $db_error = false; - $sql_file = $dir_fs_www_root . '/oscommerce.sql'; + break; - osc_set_time_limit(0); - osc_db_install($db['DB_DATABASE'], $sql_file); + case 'dbImport': + try { + $OSCOM_Db = Db::initialize($_GET['server'], $_GET['username'], $_GET['password'], $_GET['name']); + $OSCOM_Db->importSQL($dir_fs_www_root . '/oscommerce.sql'); + } catch (\Exception $e) { + $result = $e->getCode() . '|' . $e->getMessage(); + } - if ($db_error != false) { - echo '[[0|' . $db_error . ']]'; - } else { - echo '[[1]]'; + if ($result === false) { + $result = true; } - exit; break; } } - echo '[[-100|noActionError]]'; + if ($result === true) { + echo '[[1|success]]'; + } else { + $error_no = '-100'; + $error_msg = 'noActionError'; + + if ($result !== false) { + $error = explode('|', $result, 2); + + if (count($error) === 2) { + $error_no = $error[0]; + $error_msg = $error[1]; + } else { + $error_code = 0; + $error_msg = $error[0]; + } + } + + echo '[[' . $error_no . '|' . $error_msg . ']]'; + } ?> diff --git a/catalog/install/templates/main_page.php b/catalog/install/templates/main_page.php index 1cbac2d74..a027c8571 100644 --- a/catalog/install/templates/main_page.php +++ b/catalog/install/templates/main_page.php @@ -5,44 +5,65 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2015 osCommerce Released under the GNU General Public License */ ?> - - - + + + + osCommerce, Starting Your Online Business - + + + - - + + + + + + -