Example #1
0
 function quote($method = '')
 {
     global $order, $cart, $shipping_weight, $shipping_num_boxes, $store_id;
     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
         $order_total = $cart->show_total($store_id);
     } else {
         $order_total = $shipping_weight;
     }
     $table_cost = split("[:,]", MODULE_SHIPPING_TABLE_COST);
     $size = sizeof($table_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($order_total <= $table_cost[$i]) {
             $shipping = $table_cost[$i + 1];
             break;
         }
     }
     if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
         $shipping = $shipping * $shipping_num_boxes;
     }
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_TABLE_TEXT_WAY, 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (smn_not_null($this->icon)) {
         $this->quotes['icon'] = smn_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
function getConfigValue($gID, $cID)
{
    global $filter;
    $configuration_query = smn_db_query("select configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . $cID . "' and configuration_group_id = '" . (int) $gID . "'" . $filter . " order by sort_order");
    $configuration = smn_db_fetch_array($configuration_query);
    if (smn_not_null($configuration['use_function'])) {
        $use_function = $configuration['use_function'];
        if (ereg('->', $use_function)) {
            $class_method = explode('->', $use_function);
            if (!is_object(${$class_method[0]})) {
                include DIR_WS_CLASSES . $class_method[0] . '.php';
                ${$class_method[0]} = new $class_method[0]();
            }
            $cfgValue = smn_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
        } else {
            $cfgValue = smn_call_function($use_function, $configuration['configuration_value']);
        }
    } else {
        $cfgValue = $configuration['configuration_value'];
    }
    if (empty($cfgValue) && !is_numeric($cfgValue)) {
        $cfgValue = '&nbsp;';
    }
    return $cfgValue;
}
Example #3
0
 function set_language($language)
 {
     if (smn_not_null($language) && isset($this->catalog_languages[$language])) {
         $this->language = $this->catalog_languages[$language];
     } else {
         $this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
     }
 }
Example #4
0
 function is_set($code)
 {
     if (isset($this->currencies[$code]) && smn_not_null($this->currencies[$code])) {
         return true;
     } else {
         return false;
     }
 }
 function smn_draw_form($name, $action, $method = 'post', $parameters = '')
 {
     $form = '<form name="' . smn_parse_input_field_data($name, array('"' => '&quot;')) . '" action="' . smn_parse_input_field_data($action, array('"' => '&quot;')) . '" method="' . smn_parse_input_field_data($method, array('"' => '&quot;')) . '"';
     if (smn_not_null($parameters)) {
         $form .= ' ' . $parameters;
     }
     $form .= '>';
     return $form;
 }
Example #6
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PICK_UP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PICK_UP_TEXT_WAY, 'cost' => MODULE_SHIPPING_PICK_UP_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (smn_not_null($this->icon)) {
         $this->quotes['icon'] = smn_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => '<FONT COLOR=FF0000><B>' . MODULE_SHIPPING_FREESHIPPER_TEXT_WAY . '</B></FONT>', 'cost' => SHIPPING_HANDLING + MODULE_SHIPPING_FREESHIPPER_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (smn_not_null($this->icon)) {
         $this->quotes['icon'] = smn_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
 function smn_validate_password($plain, $encrypted)
 {
     if (smn_not_null($plain) && smn_not_null($encrypted)) {
         // split apart the hash / salt
         $stack = explode(':', $encrypted);
         if (sizeof($stack) != 2) {
             return false;
         }
         if (md5($stack[1] . $plain) == $stack[0]) {
             return true;
         }
     }
     return false;
 }
Example #9
0
 function trail($separator = ' - ')
 {
     $trail_string = '';
     for ($i = 0, $n = sizeof($this->_trail); $i < $n; $i++) {
         if (isset($this->_trail[$i]['link']) && smn_not_null($this->_trail[$i]['link'])) {
             $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>';
         } else {
             $trail_string .= $this->_trail[$i]['title'];
         }
         if ($i + 1 < $n) {
             $trail_string .= $separator;
         }
     }
     return $trail_string;
 }
Example #10
0
 function SetSize($length = '', $width = '', $height = '', $units = '')
 {
     if (smn_not_null($length)) {
         $this->Length = $length;
     }
     if (smn_not_null($width)) {
         $this->Width = $width;
     }
     if (smn_not_null($height)) {
         $this->Height = $height;
     }
     if (smn_not_null($units)) {
         $this->DimUnit = $units;
     }
 }
Example #11
0
 function payment($module = '')
 {
     global $payment, $language, $PHP_SELF, $store_id, $cart;
     if (defined('MODULE_PAYMENT_INSTALLED') && smn_not_null(MODULE_PAYMENT_INSTALLED)) {
         $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
         $include_modules = array();
         $prepare_module_string = str_replace('.php', '', MODULE_PAYMENT_INSTALLED);
         $initial_module_string = str_replace(";", "' or page_name= '", $prepare_module_string);
         $text_contents_conditions = " and page_name= '" . $initial_module_string . "'";
         $content_query = smn_db_query("select text_key, text_content from " . TABLE_WEB_SITE_CONTENT . " where store_id = '" . $store_id . "' " . $text_contents_conditions);
         while ($text_contents = smn_db_fetch_array($content_query)) {
             define($text_contents['text_key'], $text_contents['text_content']);
         }
         if (smn_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) {
             $this->selected_module = $module;
             $include_modules[] = array('class' => $module, 'file' => $module . '.php');
             $text_contents_conditions = " and page_name= '" . $module . "'";
         } else {
             reset($this->modules);
             if (smn_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') and ($cart->show_total() == 0 and $cart->show_weight == 0)) {
                 $this->selected_module = $module;
                 $include_modules[] = array('class' => 'freecharger', 'file' => 'freecharger.php');
             } else {
                 // All Other Payment Modules
                 while (list(, $value) = each($this->modules)) {
                     $class = substr($value, 0, strrpos($value, '.'));
                     // Don't show Free Payment Module
                     if ($class != 'freecharger') {
                         $include_modules[] = array('class' => $class, 'file' => $value);
                     }
                 }
             }
         }
         for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
             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
         // $_POST['payment'] value which will be empty (no radio button selection possible)
         if (smn_count_payment_modules() == 1 && (!isset($GLOBALS[$payment]) || isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) {
             $payment = $include_modules[0]['class'];
         }
         if (smn_not_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
             $this->form_action_url = $GLOBALS[$module]->form_action_url;
         }
     }
 }
Example #12
0
 function saveSiteText()
 {
     global $messageStack, $jQuery;
     $text_key = smn_db_prepare_input($_POST['text_key']);
     $page_name = smn_db_prepare_input($_POST['page_name']);
     $hiddenAction = smn_db_prepare_input($_POST['hidden_action']);
     if ($hiddenAction == 'new' && smn_not_null($_POST['new_page_name'])) {
         $page_name = smn_db_prepare_input($_POST['new_page_name']);
     }
     $text_content = smn_db_prepare_input($_POST['text_content']);
     $error = false;
     $textExists = $this->exists($page_name, $text_key);
     if ($textExists && $hiddenAction == 'new') {
         $this->setJsonResponse('{
               success: false,
               error: "Duplicate Page/Key Combination Exsist."
           }');
         return false;
     }
     for ($i = 0, $n = sizeof($this->langArray); $i < $n; $i++) {
         $sql_data_array = array('store_id' => $this->storeID, 'page_name' => $page_name, 'text_key' => $text_key, 'language_id' => $this->langArray[$i]['id'], 'text_content' => $text_content[$this->langArray[$i]['id']], 'date_modified' => 'now()');
         if ($textExists === true) {
             smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_data_array, 'update', 'page_name = "' . $page_name . '" and text_key = "' . $text_key . '" and language_id = "' . $this->langArray[$i]['id'] . '" and store_id = "' . $this->storeID . '"');
             if (mysql_affected_rows() < 0) {
                 smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_data_array);
             }
         } else {
             smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_data_array);
         }
     }
     $Qcontent = smn_db_query('select page_name, text_key, date_modified from ' . TABLE_WEB_SITE_CONTENT . ' where language_id = "' . $this->languageID . '" and store_id = "' . $this->storeID . '" and page_name = "' . $page_name . '" and text_key = "' . $text_key . '"');
     $content = smn_db_fetch_array($Qcontent);
     $multiLanguage = array();
     for ($i = 0, $n = sizeof($this->langArray); $i < $n; $i++) {
         $multiLanguage[] = 'text_content_' . $this->langArray[$i]['id'] . ': "' . $jQuery->jsonHtmlPrepare($text_content[$this->langArray[$i]['id']]) . '"';
     }
     $this->setJsonResponse('{
           success: true,
           page_name: "' . $content['page_name'] . '",
           text_key: "' . $content['text_key'] . '",
           date_modified: "' . $content['date_modified'] . '",
           ' . implode(',', $multiLanguage) . '
       }');
     return true;
 }
Example #13
0
 function process()
 {
     global $order, $currencies;
     global $store;
     if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
         switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
             case 'national':
                 if ($order->delivery['country_id'] == $store->get_store_country()) {
                     $pass = true;
                 }
                 break;
             case 'international':
                 if ($order->delivery['country_id'] != $store->get_store_country()) {
                     $pass = true;
                 }
                 break;
             case 'both':
                 $pass = true;
                 break;
             default:
                 $pass = false;
                 break;
         }
         if ($pass == true && $order->info['total'] - $order->info['shipping_cost'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
             $order->info['shipping_method'] = FREE_SHIPPING_TITLE;
             $order->info['total'] -= $order->info['shipping_cost'];
             $order->info['shipping_cost'] = 0;
         }
     }
     $module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
     if (smn_not_null($order->info['shipping_method'])) {
         if ($GLOBALS[$module]->tax_class > 0) {
             $shipping_tax = smn_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
             $shipping_tax_description = smn_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
             $order->info['tax'] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
             $order->info['tax_groups']["{$shipping_tax_description}"] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
             $order->info['total'] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
             if (DISPLAY_PRICE_WITH_TAX == 'true') {
                 $order->info['shipping_cost'] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
             }
         }
         $this->output[] = array('title' => $order->info['shipping_method'] . ':', 'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']), 'value' => $order->info['shipping_cost']);
     }
 }
 function display_links($max_page_links, $parameters = '')
 {
     global $PHP_SELF, $request_type;
     $display_links_string = '';
     $class = 'class="pageResults"';
     if (smn_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // previous button - not displayed on first page
     if ($this->current_page_number > 1) {
         $display_links_string .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a>&nbsp;&nbsp;';
     }
     // check if number_of_pages > $max_page_links
     $cur_window_num = intval($this->current_page_number / $max_page_links);
     if ($this->current_page_number % $max_page_links) {
         $cur_window_num++;
     }
     $max_window_num = intval($this->number_of_pages / $max_page_links);
     if ($this->number_of_pages % $max_page_links) {
         $max_window_num++;
     }
     // previous window of pages
     if ($cur_window_num > 1) {
         $display_links_string .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($cur_window_num - 1) * $max_page_links, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';
     }
     // page nn button
     for ($jump_to_page = 1 + ($cur_window_num - 1) * $max_page_links; $jump_to_page <= $cur_window_num * $max_page_links && $jump_to_page <= $this->number_of_pages; $jump_to_page++) {
         if ($jump_to_page == $this->current_page_number) {
             $display_links_string .= '&nbsp;<b>' . $jump_to_page . '</b>&nbsp;';
         } else {
             $display_links_string .= '&nbsp;<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' "><u>' . $jump_to_page . '</u></a>&nbsp;';
         }
     }
     // next window of pages
     if ($cur_window_num < $max_window_num) {
         $display_links_string .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($cur_window_num * $max_page_links + 1), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>&nbsp;';
     }
     // next button
     if ($this->current_page_number < $this->number_of_pages && $this->number_of_pages != 1) {
         $display_links_string .= '&nbsp;<a href="' . smn_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a>&nbsp;';
     }
     return $display_links_string;
 }
Example #15
0
 function process()
 {
     $order_total_array = array();
     if (is_array($this->modules)) {
         reset($this->modules);
         while (list(, $value) = each($this->modules)) {
             $class = substr($value, 0, strrpos($value, '.'));
             if ($GLOBALS[$class]->enabled) {
                 $GLOBALS[$class]->output = array();
                 $GLOBALS[$class]->process();
                 for ($i = 0, $n = sizeof($GLOBALS[$class]->output); $i < $n; $i++) {
                     if (smn_not_null($GLOBALS[$class]->output[$i]['title']) && smn_not_null($GLOBALS[$class]->output[$i]['text'])) {
                         $order_total_array[] = 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);
                     }
                 }
             }
         }
     }
     return $order_total_array;
 }
 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     global $PHP_SELF;
     if (smn_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = ceil($query_numrows / $max_rows_per_page);
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = smn_draw_form('pages', basename($PHP_SELF), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, smn_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onChange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
         } else {
             $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
         }
         if ($parameters != '') {
             if (substr($parameters, -1) == '&') {
                 $parameters = substr($parameters, 0, -1);
             }
             $pairs = explode('&', $parameters);
             while (list(, $pair) = each($pairs)) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= smn_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         $display_links .= smn_hide_session_id() . '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
Example #17
0
 function quote($method = '')
 {
     global $order, $cart, $shipping_weight;
     $dest_country = $order->delivery['country']['id'];
     $currency = $order->info['currency'];
     if ($shipping_weight > MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX) {
         $this->quotes['error'] = MODULE_SHIPPING_FREEAMOUNT_TEXT_TO_HEIGHT . ' (' . $shipping_weight . ') ' . MODULE_SHIPPING_FREEAMOUNT_TEXT_UNIT;
     }
     if ($cart->show_total() < MODULE_SHIPPING_FREEAMOUNT_AMOUNT) {
         if (MODULE_SHIPPING_FREEAMOUNT_DISPLAY == 'False') {
             return;
         } else {
             $this->quotes['error'] = MODULE_SHIPPING_FREEAMOUNT_TEXT_ERROR;
         }
     } else {
         $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREEAMOUNT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREEAMOUNT_TEXT_WAY, 'cost' => MODULE_SHIPPING_FREEAMOUNT_COST)));
     }
     if (smn_not_null($this->icon)) {
         $this->quotes['icon'] = smn_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
  Copyright (c) 2002 - 2006 SystemsManager.Net
  SystemsManager Technologies
  oscMall System Version 4
  http://www.systemsmanager.net
  Portions Copyright (c) 2002 osCommerce

  This source file is subject to version 2.0 of the GPL license,   
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
global $page_name, $store;
$action = isset($_GET['action']) ? $_GET['action'] : '';
if (!smn_session_is_registered('customer_id')) {
    if (isset($_POST) && !empty($_POST) && smn_not_null($action)) {
        echo '{success:false}';
        exit;
    }
    $navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, 'ID=' . $store_id, 'NONSSL'));
}
if ($action == 'getZones' && isset($_GET['country'])) {
    $country = $_GET['country'];
    $Qzones = smn_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "' order by zone_name");
    if (smn_db_num_rows($Qzones)) {
        $zones_array = array();
        while ($zones = smn_db_fetch_array($Qzones)) {
            $zones_array[] = '"' . $zones['zone_name'] . '": "' . $zones['zone_name'] . '"';
        }
        echo '{
Example #19
0
        $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . smn_draw_input_field('tax_class_description', $tcInfo->tax_class_description));
        $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . smn_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
    case 'delete':
        $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_TAX_CLASS . '</b>');
        $contents = array('form' => smn_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' => '<br><b>' . $tcInfo->tax_class_title . '</b>');
        $contents[] = array('align' => 'center', 'text' => '<br>' . smn_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . smn_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . smn_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
        break;
    default:
        if (isset($tcInfo) && is_object($tcInfo)) {
            $heading[] = array('text' => '<b>' . $tcInfo->tax_class_title . '</b>');
            $contents[] = array('align' => 'center', 'text' => '<a href="' . smn_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '">' . smn_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . smn_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=delete') . '">' . smn_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
            $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . smn_date_short($tcInfo->date_added));
            $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . smn_date_short($tcInfo->last_modified));
            $contents[] = array('text' => '<br>' . TEXT_INFO_CLASS_DESCRIPTION . '<br>' . $tcInfo->tax_class_description);
        }
        break;
}
if (smn_not_null($heading) && smn_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
}
?>
          </tr>
        </table></td>
      </tr>
    </table>
                $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $pID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . smn_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $pID, 'NONSSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . smn_date_long($check_status['affiliate_payment_date']) . "\n\n" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $payments_status_array[$status]);
                smn_mail($check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], $check_status['affiliate_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS);
                $affiliate_notified = '1';
            }
            smn_db_query("insert into " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " (affiliate_payment_id, affiliate_new_value, affiliate_old_value, affiliate_date_added, affiliate_notified) values ('" . smn_db_input($pID) . "', '" . smn_db_input($status) . "', '" . $check_status['affiliate_payment_status'] . "', now(), '" . $affiliate_notified . "')");
            $order_updated = true;
        }
        if ($order_updated) {
            $messageStack->add_session(SUCCESS_PAYMENT_UPDATED, 'success');
        }
        smn_redirect(smn_href_link(FILENAME_AFFILIATE_PAYMENT, smn_get_all_get_params(array('action')) . 'action=edit'));
        break;
    case 'deleteconfirm':
        $pID = smn_db_prepare_input($_GET['pID']);
        smn_db_query("delete from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . smn_db_input($pID) . "'");
        smn_db_query("delete from " . TABLE_AFFILIATE_PAYMENT_STATUS_HISTORY . " where affiliate_payment_id = '" . smn_db_input($pID) . "'");
        smn_redirect(smn_href_link(FILENAME_AFFILIATE_PAYMENT, smn_get_all_get_params(array('pID', 'action'))));
        break;
}
if ($_GET['action'] == 'edit' && smn_not_null($_GET['pID'])) {
    $pID = smn_db_prepare_input($_GET['pID']);
    $payments_query = smn_db_query("select p.*,  a.affiliate_payment_check, a.affiliate_payment_paypal, a.affiliate_payment_bank_name, a.affiliate_payment_bank_branch_number, a.affiliate_payment_bank_swift_code, a.affiliate_payment_bank_account_name, a.affiliate_payment_bank_account_number from " . TABLE_AFFILIATE_PAYMENT . " p, " . TABLE_AFFILIATE . " a where affiliate_payment_id = '" . smn_db_input($pID) . "' and a.affiliate_id = p.affiliate_id");
    $payments_exists = true;
    if (!($payments = smn_db_fetch_array($payments_query))) {
        $payments_exists = false;
        $messageStack->add(sprintf(ERROR_PAYMENT_DOES_NOT_EXIST, $pID), 'error');
    }
}
$content_page = basename($_SERVER['PHP_SELF']);
require 'templates/default/layout.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
Example #21
0
 function smn_set_store_category_id($sPath)
 {
     global $sPath_array;
     if (smn_not_null($sPath)) {
         $sPath = implode('_', $sPath_array);
         return $current_store_category_id = $sPath_array[sizeof($sPath_array) - 1];
     } else {
         return $current_store_category_id = 0;
     }
 }
 function checkdnsrr($host, $type)
 {
     if (smn_not_null($host) && smn_not_null($type)) {
         @exec("nslookup -type={$type} {$host}", $output);
         while (list($k, $line) = each($output)) {
             if (eregi("^{$host}", $line)) {
                 return true;
             }
         }
     }
     return false;
 }
</td>
      </tr>
      <tr>
        <td>
<?php 
$invoices_query = smn_db_query("select count(*) as total from " . TABLE_ORDERS_INVOICE . " oi, " . TABLE_ORDERS . " o, " . TABLE_STORE_MAIN . " sm where sm.customer_id='" . $customer_id . "' and sm.store_id=o.store_id and o.orders_id=oi.orders_id");
$tot_invoices = smn_db_fetch_array($invoices_query);
$orders_total = $tot_invoices['total'];
if ($orders_total > 0) {
    $history_query_raw = "select o.orders_id, o.store_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," . TABLE_ORDERS_INVOICE . " oi," . TABLE_STORE_MAIN . " sm where o.store_id=sm.store_id and sm.customer_id = '" . (int) $customer_id . "' and o.orders_id=oi.orders_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 . "' order by orders_id DESC";
    $history_split = new splitPageResults($history_query_raw, MAX_DISPLAY_ORDER_HISTORY);
    $history_query = smn_db_query($history_split->sql_query);
    while ($history = smn_db_fetch_array($history_query)) {
        $products_query = smn_db_query("select count(*) as count from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $history['orders_id'] . "'");
        $products = smn_db_fetch_array($products_query);
        if (smn_not_null($history['delivery_name'])) {
            $order_type = TEXT_ORDER_SHIPPED_TO;
            $order_name = $history['delivery_name'];
        } else {
            $order_type = TEXT_ORDER_BILLED_TO;
            $order_name = $history['billing_name'];
        }
        ?>
          <table border="0" width="100%" cellspacing="0" cellpadding="2">
            <tr>
              <td class="main"><?php 
        echo '<b>' . TEXT_ORDER_NUMBER . '</b> ' . $history['orders_id'];
        ?>
</td>
              <td class="main" align="right"><?php 
        echo '<b>' . TEXT_ORDER_STATUS . '</b> ' . $history['orders_status_name'];
             $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
         }
     }
 }
 for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
     if ($i / 2 == floor($i / 2)) {
         $info_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
         $info_box_contents[] = array('params' => 'class="productListing-odd"');
     }
     $cur_row = sizeof($info_box_contents) - 1;
     $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => smn_draw_checkbox_field('cart_delete[]', $products[$i]['id']));
     $products_name = '<table border="0" cellspacing="2" cellpadding="2">' . '  <tr>' . '    <td class="productListing-data" align="center"><a href="' . smn_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . smn_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . '    <td class="productListing-data" valign="top"><a href="' . smn_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';
     if (STOCK_CHECK == 'true') {
         $stock_check = smn_check_stock($products[$i]['id'], $products[$i]['quantity']);
         if (smn_not_null($stock_check)) {
             $any_out_of_stock = 1;
             $products_name .= $stock_check;
         }
     }
     if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
         reset($products[$i]['attributes']);
         while (list($option, $value) = each($products[$i]['attributes'])) {
             $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
         }
     }
     $products_name .= '    </td>' . '  </tr>' . '</table>';
     $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"', 'text' => $products_name);
     $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => smn_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . smn_draw_hidden_field('products_id[]', $products[$i]['id']));
     $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], smn_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
 }
Example #25
0
 function confirmation()
 {
     global $_POST;
     $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, 'fields' => array(array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER, 'field' => $_POST['ipayment_cc_owner']), array('title' => MODULE_PAYMENT_IPAYMENT_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_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES, 'field' => strftime('%B, %Y', mktime(0, 0, 0, $_POST['ipayment_cc_expires_month'], 1, '20' . $_POST['ipayment_cc_expires_year'])))));
     if (smn_not_null($_POST['ipayment_cc_checkcode'])) {
         $confirmation['fields'][] = array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER, 'field' => $_POST['ipayment_cc_checkcode']);
     }
     return $confirmation;
 }
 $rowData = array('"' . $storeNames[$listing['store_id']] . '"');
 for ($col = 0, $n = sizeof($column_list); $col < $n; $col++) {
     $lc_align = '';
     $store_images = 'images/' . $listing['store_id'] . '_images/';
     switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
             $rowData[$col] = '"' . $listing['products_model'] . '"';
             break;
         case 'PRODUCT_LIST_NAME':
             $rowData[$col] = '"' . $listing['products_name'] . '"';
             break;
         case 'PRODUCT_LIST_MANUFACTURER':
             $rowData[$col] = '"' . $listing['manufacturers_name'] . '"';
             break;
         case 'PRODUCT_LIST_PRICE':
             if (smn_not_null($listing['specials_new_products_price'])) {
                 $rowData[$col] = '"' . $listing['specials_new_products_price'] . '"';
             } else {
                 $rowData[$col] = '"' . $listing['products_price'] . '"';
             }
             break;
         case 'PRODUCT_LIST_QUANTITY':
             $rowData[$col] = '"' . $listing['products_quantity'] . '"';
             break;
         case 'PRODUCT_LIST_WEIGHT':
             $rowData[$col] = '"' . $listing['products_weight'] . '"';
             break;
     }
 }
 $rowData[] = '"' . smn_get_products_description($listing['products_id'], $languages_id) . '"';
 $rowData[] = '"' . DIR_WS_IMAGES . $listing['products_image'] . '"';
                <td class="main"><?php 
echo ENTRY_PASSWORD;
?>
</td>
                <td class="main"><?php 
echo smn_draw_password_field('password') . '&nbsp;' . (smn_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>' : '');
?>
</td>
              </tr>
              <tr>
                <td class="main"><?php 
echo ENTRY_PASSWORD_CONFIRMATION;
?>
</td>
                <td class="main"><?php 
echo smn_draw_password_field('confirmation') . '&nbsp;' . (smn_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>' : '');
?>
</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><?php 
echo smn_draw_separator('pixel_trans.gif', '100%', '10');
?>
</td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
     $messageStack->add(ERROR_VENDORS_CANT_ADD_VOUCHERS, 'error');
     $allow_insert = 'false';
   } else {
     if (isset($_GET['pID'])) $products_id = smn_db_prepare_input($_GET['pID']);
     $products_date_available = smn_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('store_id' => $store_id,
                             'products_quantity' => smn_db_prepare_input($_POST['products_quantity']),
                             'products_model' => smn_db_prepare_input($_POST['products_model']),
                             'products_price' => smn_db_prepare_input($_POST['products_price']),
                             'products_date_available' => $products_date_available,
                             'products_weight' => smn_db_prepare_input($_POST['products_weight']),
                             'products_status' => smn_db_prepare_input($_POST['products_status']),
                             'products_tax_class_id' => smn_db_prepare_input($_POST['products_tax_class_id']),
                             'manufacturers_id' => smn_db_prepare_input($_POST['manufacturers_id']));
     if (isset($_POST['products_image']) && smn_not_null($_POST['products_image']) && ($_POST['products_image'] != 'none')) {
       $sql_data_array['products_image'] = smn_db_prepare_input($_POST['products_image']);
     } 
     if (($action == 'insert_product') && ($allow_insert == 'true'))  {
 
       $insert_sql_data = array('products_date_added' => 'now()');
       $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
       smn_db_perform(TABLE_PRODUCTS, $sql_data_array);
       $products_id = smn_db_insert_id();
     if($store_id != 1){
       # create loop here to insert rows for multiple main mall categories
 $selected_catids =  smn_db_prepare_input($_POST['main_category_id']);
 if(($selected_catids != '') && ($selected_catids > 0)) smn_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (store_id, products_id, categories_id) values ('1', '" . (int)$products_id . "', '" . (int)$selected_catids . "')");
     }
       smn_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (store_id, products_id, categories_id) values ('" . (int)$store_id . "', '" . (int)$products_id . "', '" . (int)$current_category_id . "')");
     } elseif ($action == 'update_store_product') {
  that is bundled with this package in the file LICENSE. If you
  did not receive a copy of the oscMall System license and are unable 
  to obtain it through the world-wide-web, please send a note to    
  license@systemsmanager.net so we can mail you a copy immediately.
*/
if (!smn_session_is_registered('customer_id')) {
    //$navigation->set_snapshot();
    smn_redirect(smn_href_link(FILENAME_LOGIN, 'ID=' . $store_id, 'SSL'));
}
$set = isset($_GET['set']) ? $_GET['set'] : 'payment';
$action = isset($_GET['action']) ? $_GET['action'] : '';
require DIR_WS_CLASSES . 'store_modules.php';
$paymentModules = new store_modules('payment');
$shippingModules = new store_modules('shipping');
$orderTotalModules = new store_modules('order_total');
if (smn_not_null($action)) {
    $moduleType = $_GET['moduleType'];
    $moduleName = $_GET['moduleName'];
    require DIR_WS_LANGUAGES . 'install/' . $moduleType . '/' . $language . '.php';
    switch ($action) {
        case 'getInstallArray':
            $moduleInfo = new store_modules($moduleType);
            $notInstalled = $moduleInfo->getNotInstalledModules();
            $json = array();
            for ($i = 0, $n = sizeof($notInstalled); $i < $n; $i++) {
                $json[] = '["' . $notInstalled[$i]['id'] . '", "' . $notInstalled[$i]['text'] . '"]';
            }
            echo '{
                   success: true,
                   arr: [' . implode(',', $json) . ']
               }';
if ($endDateG) {
    $endDate = mktime(0, 0, 0, $eMon, $eDay + 1, $eYear);
} else {
    $endDate = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
}
/**/
if ($HTTP_GET_VARS['separator'] && smn_not_null($HTTP_GET_VARS['separator'])) {
    $srSeparator = $HTTP_GET_VARS['separator'];
}
if ($HTTP_GET_VARS['billing'] && smn_not_null($HTTP_GET_VARS['billing'])) {
    $srBilling = $HTTP_GET_VARS['billing'];
}
if ($HTTP_GET_VARS['delivery'] && smn_not_null($HTTP_GET_VARS['delivery'])) {
    $srDelivery = $HTTP_GET_VARS['delivery'];
}
if ($HTTP_GET_VARS['customer'] && smn_not_null($HTTP_GET_VARS['customer'])) {
    $srCustomer = $HTTP_GET_VARS['customer'];
}
require DIR_WS_CLASSES . FILENAME_ORDERS_TRACKING;
$sr = new sales_report($srView, $startDate, $endDate, $srSort, $srStatus, $srFilter);
$startDate = $sr->startDate;
$endDate = $sr->endDate;
if ($srExp == 2) {
    $file_created = $sr->DownloadFile($srStatus, $startDate, $endDate, $srDownload, $srCustomer, $srDelivery, $srSeparator, $srBilling);
    if ($file_created == 'true') {
        header('Content-type: application/x-octet-stream');
        header('Content-disposition: attachment; filename=orders.csv');
        readfile(DIR_FS_ADMIN . 'orders.csv');
        unlink(DIR_FS_ADMIN . 'orders.csv');
    }
} elseif ($srExp == 3) {