Example #1
0
 function quote($method = '')
 {
     global $order;
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLAT_TEXT_WAY, 'cost' => MODULE_SHIPPING_FLAT_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = xos_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (xos_not_null($this->icon)) {
         $this->quotes['icon'] = xos_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
Example #2
0
 function add($class, $message, $type = 'error')
 {
     if ($type == 'error') {
         $this->messages[] = array('class' => $class, 'text' => '  <tr class="messageStackError">' . "\n" . '    <td valign="top" class="messageStackError" width="1">' . xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/error.gif', ICON_TITLE_ERROR) . '</td>' . "\n" . '    <td class="messageStackError">' . $message . '</td>' . "\n" . '  </tr>' . "\n");
     } elseif ($type == 'warning') {
         $this->messages[] = array('class' => $class, 'text' => '  <tr class="messageStackWarning">' . "\n" . '    <td valign="top" class="messageStackWarning" width="1">' . xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/warning.gif', ICON_TITLE_WARNING) . '</td>' . "\n" . '    <td class="messageStackWarning">' . $message . '</td>' . "\n" . '  </tr>' . "\n");
     } elseif ($type == 'success') {
         $this->messages[] = array('class' => $class, 'text' => '  <tr class="messageStackSuccess">' . "\n" . '    <td valign="top" class="messageStackSuccess" width="1">' . xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/success.gif', ICON_TITLE_SUCCESS) . '</td>' . "\n" . '    <td class="messageStackSuccess">' . $message . '</td>' . "\n" . '  </tr>' . "\n");
     } else {
         $this->messages[] = array('class' => $class, 'text' => '  <tr class="messageStackError">' . "\n" . '    <td colspan="2" class="messageStackError">' . $message . '&nbsp;</td>' . "\n" . '  </tr>' . "\n");
     }
 }
Example #3
0
 function add($class, $message, $type = 'error')
 {
     if ($type == 'error') {
         $this->messages[] = array('class' => $class, 'type' => $type, 'text' => "\n" . '  <div class="message-stack-error" style="width: 100%;">' . "\n" . '    <div style="float: left; padding: 2px;">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/error.gif', ICON_ERROR) . '</div>' . "\n" . '    <div style="float: left; padding: 2px; max-width: 95%;">' . $message . '</div>' . "\n" . '    <div class="clear">&nbsp;</div>' . "\n" . '  </div>' . "\n");
     } elseif ($type == 'warning') {
         $this->messages[] = array('class' => $class, 'type' => $type, 'text' => "\n" . '  <div class="message-stack-warning" style="width: 100%;">' . "\n" . '    <div style="float: left; padding: 2px;">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/warning.gif', ICON_WARNING) . '</div>' . "\n" . '    <div style="float: left; padding: 2px; max-width: 95%;">' . $message . '</div>' . "\n" . '    <div class="clear">&nbsp;</div>' . "\n" . '  </div>' . "\n");
     } elseif ($type == 'success') {
         $this->messages[] = array('class' => $class, 'type' => $type, 'text' => "\n" . '  <div class="message-stack-success" style="width: 100%;">' . "\n" . '    <div style="float: left; padding: 2px;">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/success.gif', ICON_SUCCESS) . '</div>' . "\n" . '    <div style="float: left; padding: 2px; max-width: 95%;">' . $message . '</div>' . "\n" . '    <div class="clear">&nbsp;</div>' . "\n" . '  </div>' . "\n");
     } else {
         $this->messages[] = array('class' => $class, 'type' => $type, 'text' => "\n" . '  <div class="message-stack-error" style="width: 100%;">' . "\n" . '    <div style="padding: 2px;">' . $message . '&nbsp;</div>' . "\n" . '  </div>' . "\n");
     }
 }
Example #4
0
 require DIR_WS_INCLUDES . 'boxes.php';
 require DIR_WS_INCLUDES . 'header.php';
 require DIR_WS_INCLUDES . 'footer.php';
 if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
     $smarty->caching = 1;
     $cache_id = 'L3|cc_reviews|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'];
 }
 if (!$smarty->isCached(SELECTED_TPL . '/reviews.tpl', $cache_id)) {
     $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where c.categories_or_pages_status = '1' and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int) $_SESSION['languages_id'] . "' and rd.languages_id = '" . (int) $_SESSION['languages_id'] . "' order by r.reviews_id DESC";
     $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
     if ($reviews_split->number_of_rows > 0) {
         $reviews_query = xos_db_query($reviews_split->sql_query);
         $reviews_array = array();
         while ($reviews = xos_db_fetch_array($reviews_query)) {
             $product_image = xos_get_product_images($reviews['products_image']);
             $reviews_array[] = array('link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'p=' . $reviews['products_id'] . '&r=' . $reviews['reviews_id']), 'date_added' => xos_date_long($reviews['date_added']), 'products_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $reviews['products_name']), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'reviews_rating' => $reviews['reviews_rating'], 'review_text' => xos_break_string(xos_output_string_protected($reviews['reviews_text']), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'customers_name' => xos_output_string_protected($reviews['customers_name']), 'products_name' => $reviews['products_name']);
         }
         if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
             $smarty->assign('nav_bar_top', true);
         }
         if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
             $smarty->assign('nav_bar_bottom', true);
         }
         $smarty->assign('reviews', true);
     }
     $smarty->assign(array('nav_bar_number' => $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => TEXT_RESULT_PAGE . ' ' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))), 'nav_bar_result_in_pull_down_menu' => $reviews_split->display_links_in_pull_down_menu(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))), 'reviews_array' => $reviews_array));
     $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'reviews');
 }
 $output_reviews = $smarty->fetch(SELECTED_TPL . '/reviews.tpl', $cache_id);
 $smarty->assign('central_contents', $output_reviews);
 $smarty->caching = 0;
            $options = xos_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by products_options_name");
            while ($options_values = xos_db_fetch_array($options)) {
                if ($_GET['option_id'] == $options_values['products_options_id']) {
                    $inputs_options_name .= '<option value="' . $options_values['products_options_id'] . '" selected="selected">' . $options_values['products_options_name'] . '</option>';
                } else {
                    $inputs_options_name .= '<option value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>';
                }
            }
            $inputs_options_name .= '</select>';
            $error_message = '';
            $inputs_options_value = '';
            for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                if (isset($options_value_error_array[$languages[$i]['id']])) {
                    if (empty($options_value_error_array[$languages[$i]['id']]) && !$set_empty) {
                        $error_message .= sprintf(TEXT_OPTION_VALUE_NAME_ERROR_EMPTY, TEXT_OPTION_ERROR_EMPTY_MARK) . '<br />';
                        $set_empty = true;
                    } elseif ($options_value_error_array[$languages[$i]['id']] && !$set_not_empty) {
                        $error_message .= sprintf(TEXT_OPTION_VALUE_NAME_ERROR, TEXT_OPTION_ERROR_MARK) . '<br />';
                        $set_not_empty = true;
                    }
                }
                $inputs_options_value .= '<input type="text" name="value_name[' . $languages[$i]['id'] . ']" value="' . $options_value_array[$languages[$i]['id']] . '" class="smallText" size="20" />&nbsp;' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . (isset($options_value_error_array[$languages[$i]['id']]) ? empty($options_value_error_array[$languages[$i]['id']]) ? '<font color="red">&nbsp;' . TEXT_OPTION_ERROR_EMPTY_MARK . '</font>' : '<font color="red">&nbsp;' . TEXT_OPTION_ERROR_MARK . '</font>' : '') . '<br />';
            }
            $smarty->assign(array('form_begin_option' => '<form name="values" action="' . xos_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_option_values&options_page=1&' . $parameter_string) . '" method="post">', 'next_id' => $next_id, 'error_message' => $error_message, 'inputs_options_value' => $inputs_options_value, 'inputs_options_name' => $inputs_options_name, 'hidden_value_id' => '<input type="hidden" name="value_id" value="' . $next_id . '" />', 'form_end' => '</form>'));
        }
    }
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'products_attributes');
    $output_attributes_values = $smarty->fetch(ADMIN_TPL . '/includes/modules/attributes_values.tpl');
    $smarty->clearAssign(array('delete_option_value', 'products_linked', 'products', 'link_filename_products_attributes', 'link_filename_products_attributes_delete', 'products_options_values_name', 'split_page', 'previous_option_the_same', 'next_option_the_same', 'options', 'form_begin_option', 'next_id', 'error_message', 'inputs_options_value', 'inputs_options_name', 'hidden_value_id', 'form_end'));
    $smarty->assign('attributes_values', $output_attributes_values);
}
Example #6
0
     $coupon_description_query = xos_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_list['coupon_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
     $coupon_desc = xos_db_fetch_array($coupon_description_query);
     if ($cc_list['coupon_type'] == 'P') {
         // not floating point value, don't display decimal info
         $coupon_amount = ($cc_list['coupon_amount'] == round($cc_list['coupon_amount']) ? number_format($cc_list['coupon_amount']) : number_format($cc_list['coupon_amount'], 2)) . '%';
     } elseif ($cc_list['coupon_type'] == 'S') {
         $coupon_amount = TEXT_FREE_SHIPPING;
     } else {
         $coupon_amount = $currencies->format($cc_list['coupon_amount']);
     }
     $redemptions = xos_db_num_rows($redeem_query);
     $coupon_status = false;
     if ($cc_list['coupon_active'] == 'Y') {
         $coupon_status = true;
     }
     $cc_list_array[] = array('selected' => $selected, 'status' => $coupon_status, 'name' => $coupon_desc['coupon_name'], 'amount' => $coupon_amount, 'code' => $cc_list['coupon_code'], 'redemptions' => $redemptions, 'icon_status_green' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN), 'icon_status_red' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED), 'icon_status_green_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green_light.gif', ICON_TITLE_STATUS_GREEN_LIGHT), 'icon_status_red_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red_light.gif', ICON_TITLE_STATUS_RED_LIGHT), 'link_filename_coupon_admin_action_setflag_N' => xos_href_link(FILENAME_COUPON_ADMIN, 'action=setflag&flag=N&cid=' . $cc_list['coupon_id']), 'link_filename_coupon_admin_action_setflag_Y' => xos_href_link(FILENAME_COUPON_ADMIN, 'action=setflag&flag=Y&cid=' . $cc_list['coupon_id']), 'link_filename_coupon_admin' => xos_href_link(FILENAME_COUPON_ADMIN, xos_get_all_get_params(array('cid', 'action')) . 'cid=' . $cc_list['coupon_id']), 'link_filename_coupon_admin_edit' => $link_filename_coupon_admin_edit);
 }
 $smarty->assign('cc_list', $cc_list_array);
 $status_array[] = array('id' => 'Y', 'text' => TEXT_COUPON_ACTIVE);
 $status_array[] = array('id' => 'N', 'text' => TEXT_COUPON_INACTIVE);
 $status_array[] = array('id' => 'R', 'text' => TEXT_COUPON_REDEEMED);
 $status_array[] = array('id' => '*', 'text' => TEXT_COUPON_ALL);
 if ($_GET['status']) {
     $status = xos_db_prepare_input($_GET['status']);
 } else {
     // Changed from "Y" to "*" to see the Red Active and the Green Inactive status
     $status = '*';
 }
 if (SESSID) {
     $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
 }
             case 'PRODUCT_LIST_PRICE':
                 $popup_content_id = xos_get_delivery_times_values($listing['products_delivery_time_id'], 'popup_content_id');
                 $table_inner_array[] = array('case' => 'price', 'price_breaks' => $price_breaks, 'products_id' => $listing['products_id'], 'products_delivery_time' => xos_get_delivery_times_values($listing['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $listing['products_id'], $request_type) : '', 'tax_description' => xos_get_products_tax_description($listing['products_tax_class_id'], $products_tax_rate), 'price' => $product_price, 'price_special' => $product_price_special, 'price_breaks' => $price_breaks_array);
                 break;
             case 'PRODUCT_LIST_QUANTITY':
                 $table_inner_array[] = array('case' => 'quantity', 'products_quantity' => $listing['products_quantity'] > 0 ? $listing['products_quantity'] : '<span class="red-mark">' . $listing['products_quantity'] . '</span>');
                 break;
             case 'PRODUCT_LIST_WEIGHT':
                 $table_inner_array[] = array('case' => 'weight', 'products_weight' => $listing['products_weight']);
                 break;
             case 'PRODUCT_LIST_IMAGE':
                 $products_image_name = xos_get_product_images($listing['products_image']);
                 if (!empty($_GET['m'])) {
                     $table_inner_array[] = array('case' => 'image', 'products_image_small' => xos_lazy_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_image_medium' => xos_lazy_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_link_image' => xos_href_link(FILENAME_PRODUCT_INFO, 'm=' . $_GET['m'] . '&p=' . $listing['products_id']));
                 } else {
                     $table_inner_array[] = array('case' => 'image', 'products_image_small' => xos_lazy_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_image_medium' => xos_lazy_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block lazy" style="display: none;"') . '<noscript>' . xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), $listing['products_name'], '', '', 'class="img-responsive center-block"') . '</noscript>', 'products_link_image' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $listing['products_id']));
                 }
                 $smarty->assign('product_image', true);
                 break;
             case 'PRODUCT_LIST_BUY_NOW':
                 $table_inner_array[] = array('case' => 'buy_now', 'products_buy_form_begin' => xos_draw_form('cart_quantity_' . $rows, xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action')) . 'action=add_product', $request_type)), 'form_name' => 'cart_quantity_' . $rows, 'form_end' => '</form>', 'label_for_products_input_quantity' => 'products_quantity_' . $listing['products_id'], 'products_input_quantity' => xos_draw_input_field('products_quantity', '1', 'id="products_quantity_' . $listing['products_id'] . '" class="form-control input-quantity" maxlength="5"'), 'products_hidden_field' => xos_draw_hidden_field('p', $listing['products_id']));
                 break;
         }
     }
     $table_outer_array[] = array('table_inner' => $table_inner_array);
     unset($price_breaks_array);
     unset($table_inner_array);
 }
 if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
     $smarty->assign('nav_bar_top', true);
 }
         break;
     default:
         if (is_object($bInfo)) {
             $heading_title = '<b>' . $bInfo->banners_title . '</b>';
             $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=new') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
             $contents[] = array('text' => '<br />' . TEXT_BANNERS_DATE_ADDED . ' ' . xos_date_short($bInfo->date_added));
             if (function_exists('imagecreate') && $dir_ok && $banner_extension) {
                 $banner_id = $bInfo->banners_id;
                 $days = '3';
                 include DIR_WS_INCLUDES . 'graphs/banner_infobox.php';
                 $contents[] = array('text' => '<br />' . xos_image(DIR_WS_ADMIN . DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banner_id . '.' . $banner_extension, '', '', '', 'id="banner_infobox"') . "\n" . '<script>' . "\n" . '  document.images.banner_infobox.src="' . DIR_WS_ADMIN . DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banner_id . '.' . $banner_extension . '?" + new Date().getTime();' . "\n" . '</script>' . "\n");
             } else {
                 include DIR_WS_FUNCTIONS . 'html_graphs.php';
                 $contents[] = array('text' => '<br />' . xos_banner_graph_infoBox($bInfo->banners_id, '3'));
             }
             $contents[] = array('text' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/graph_hbar_blue.gif', 'Blue', '5', '5') . ' ' . TEXT_BANNERS_BANNER_VIEWS . '<br />' . xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/graph_hbar_red.gif', 'Red', '5', '5') . ' ' . TEXT_BANNERS_BANNER_CLICKS);
             if ($bInfo->date_scheduled) {
                 $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_SCHEDULED_AT_DATE, xos_date_short($bInfo->date_scheduled)));
             }
             if ($bInfo->expires_date) {
                 $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, xos_date_short($bInfo->expires_date)));
             } elseif ($bInfo->expires_impressions) {
                 $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions));
             }
             if ($bInfo->date_status_change) {
                 $contents[] = array('text' => '<br />' . sprintf(TEXT_BANNERS_STATUS_CHANGE, xos_date_short($bInfo->date_status_change)));
             }
         }
         break;
 }
 $smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
Example #9
0
         $popup_img = DIR_WS_IMAGES . 'products/large/' . $products_img_name['name'];
         $pop_size = @GetImageSize("{$popup_img}");
         if ($pop_size[0] > $pop_width) {
             $pop_width = $pop_size[0];
         }
         if ($pop_size[1] > $pop_height) {
             $pop_height = $pop_size[1];
         }
     }
     if ($small_width_total > $pop_width) {
         $pop_width = $small_width_total;
     }
     $products_images_array = array();
     $i = 0;
     foreach ($products_image_name as $products_img_name) {
         $products_images_array[] = array('link_product_img' => xos_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&img_name=' . rawurlencode($products_img_name['name'])), 'link_product_img_noscript' => xos_href_link(FILENAME_IMAGES_WINDOW, 'pID=' . $product_info['products_id'], 'NONSSL', true, false, false, false, false), 'href_to_product_img_large' => xos_href_link(DIR_WS_IMAGES . 'products/large/' . rawurlencode($products_img_name['name']), '', 'NONSSL', false, false, false, false, false), 'src_product_img_medium' => xos_href_link(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_img_name['name']), '', 'NONSSL', false, false, false, false, false), 'product_img_medium' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_img_name['name']), addslashes($product_info['products_name']), '0', '0'), 'i' => $i);
         $i++;
     }
     $smarty->assign(array('box_width' => (int) ($pop_width + 50), 'box_height' => (int) ($pop_height + $small_height + 55), 'products_images' => $products_images_array));
 }
 if (xos_has_product_attributes((int) $_GET['p'])) {
     xos_not_null($product_info['attributes_combinations']) ? $combinations_string = $product_info['attributes_combinations'] : ($combinations_string = '');
     $attributes_quantity = xos_get_attributes_quantity($product_info['attributes_quantity']);
     if (xos_not_null($attributes_quantity) && $combinations_string != '' && STOCK_CHECK == 'true' && STOCK_ALLOW_CHECKOUT == 'false') {
         $combination_elements = explode('|', $combinations_string);
         for ($i = 0, $n = sizeof($combination_elements); $i < $n; $i++) {
             if ($attributes_quantity[$combination_elements[$i]] < 1) {
                 unset($combination_elements[$i]);
             }
         }
         ksort($combination_elements);
Example #10
0
                $reviews_text_query = xos_db_query("select r.reviews_read, r.customers_name, length(rd.reviews_text) as reviews_text_size from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int) $reviews['reviews_id'] . "' and r.reviews_id = rd.reviews_id");
                $reviews_text = xos_db_fetch_array($reviews_text_query);
                $products_image_query = xos_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int) $reviews['products_id'] . "'");
                $products_image = xos_db_fetch_array($products_image_query);
                $products_name_query = xos_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $reviews['products_id'] . "' and language_id = '" . (int) $_SESSION['used_lng_id'] . "'");
                $products_name = xos_db_fetch_array($products_name_query);
                $reviews_average_query = xos_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int) $reviews['products_id'] . "'");
                $reviews_average = xos_db_fetch_array($reviews_average_query);
                $review_info = array_merge((array) $reviews_text, (array) $reviews_average, (array) $products_name);
                $rInfo_array = array_merge((array) $reviews, (array) $review_info, (array) $products_image);
                $rInfo = new objectInfo($rInfo_array);
            }
            $selected = false;
            if (isset($rInfo) && is_object($rInfo) && $reviews['reviews_id'] == $rInfo->reviews_id) {
                $selected = true;
                $link_filename_reviews = xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview');
            } else {
                $link_filename_reviews = xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews['reviews_id']);
            }
            $reviews_array[] = array('selected' => $selected, 'link_filename_reviews_review' => xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews['reviews_id'] . '&action=preview'), 'products_name' => xos_get_products_name($reviews['products_id']), 'stars_image' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif'), 'date_added' => xos_date_short($reviews['date_added']), 'link_filename_reviews' => $link_filename_reviews);
        }
        $smarty->assign(array('reviews' => $reviews_array, 'nav_bar_number' => $reviews_split->display_count($reviews_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => $reviews_split->display_links($reviews_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'])));
        require DIR_WS_BOXES . 'infobox_reviews.php';
    }
    $smarty->assign('BODY_TAG_PARAMS', 'onload="SetFocus();"');
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'reviews');
    $output_reviews = $smarty->fetch(ADMIN_TPL . '/reviews.tpl');
    $smarty->assign('central_contents', $output_reviews);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}
//------------------------------------------------------------------------------
// this file is based on:
//              osCommerce, Open Source E-Commerce Solutions
//              http://www.oscommerce.com
//              Copyright (c) 2003 osCommerce
//              filename: product_notifications.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/product_notifications.php') == 'overwrite_all')) {
    if (isset($_GET['p'])) {
        $allowed_product_query = xos_db_query("select p.products_id total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES_OR_PAGES . " c where p.products_id = '" . (int) $_GET['p'] . "' and p.products_id = p2c.products_id and p2c.categories_or_pages_id = c.categories_or_pages_id and c.categories_or_pages_status = '1' and p.products_status = '1'");
        if (xos_db_num_rows($allowed_product_query)) {
            if (isset($_SESSION['customer_id'])) {
                $check_query = xos_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int) $_GET['p'] . "' and customers_id = '" . (int) $_SESSION['customer_id'] . "'");
                $check = xos_db_fetch_array($check_query);
                $notification_exists = $check['count'] > 0 ? true : false;
            } else {
                $notification_exists = false;
            }
            if ($notification_exists == true) {
                $smarty->assign(array('box_product_notifications_notification_exists' => true, 'box_product_notifications_link_notify_notify_remove' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action', 'lnc', 'cur', 'tpl')) . 'action=notify_remove', $request_type), 'box_product_notifications_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/box_products_notifications_remove.gif', IMAGE_BUTTON_REMOVE_NOTIFICATIONS)));
            } else {
                $smarty->assign(array('box_product_notifications_notification_exists' => false, 'box_product_notifications_link_notify_notify_remove' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action', 'lnc', 'cur', 'tpl')) . 'action=notify', $request_type), 'box_product_notifications_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS)));
            }
            $smarty->assign(array('box_product_notifications_link_filename_account_notifications' => xos_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL'), 'box_product_notifications_product_name' => xos_get_products_name($_GET['p'])));
            $output_product_notifications = $smarty->fetch(SELECTED_TPL . '/includes/boxes/product_notifications.tpl');
            $smarty->assign('box_product_notifications', $output_product_notifications);
        }
    }
}
Example #12
0
             $country_query = xos_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int) $customers['entry_country_id'] . "'");
             $country = xos_db_fetch_array($country_query);
             $reviews_query = xos_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . (int) $customers['customers_id'] . "'");
             $reviews = xos_db_fetch_array($reviews_query);
             $customer_info = array_merge((array) $country, (array) $info, (array) $reviews);
             $cInfo_array = array_merge((array) $customers, (array) $customer_info);
             $cInfo = new objectInfo($cInfo_array);
         }
         $selected = false;
         if (isset($cInfo) && is_object($cInfo) && $customers['customers_id'] == $cInfo->customers_id) {
             $selected = true;
             $link_filename_customers = xos_href_link(FILENAME_CUSTOMERS, xos_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit');
         } else {
             $link_filename_customers = xos_href_link(FILENAME_CUSTOMERS, xos_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']);
         }
         $customers_array[] = array('selected' => $selected, 'link_filename_customers' => $link_filename_customers, 'company' => strlen($customers['entry_company']) > 16 ? "<acronym title=\"" . $customers['entry_company'] . "\">" . substr($customers['entry_company'], 0, 16) . "&nbsp;</acronym>" : $customers['entry_company'], 'lastname' => strlen($customers['customers_lastname']) > 15 ? "<acronym title=\"" . $customers['customers_lastname'] . "\">" . substr($customers['customers_lastname'], 0, 15) . "&nbsp;</acronym>" : $customers['customers_lastname'], 'firstname' => strlen($customers['customers_firstname']) > 15 ? "<acronym title=\"" . $customers['customers_firstname'] . "\">" . substr($customers['customers_firstname'], 0, 15) . "&nbsp;</acronym>" : $customers['customers_firstname'], 'group_name' => strlen($customers['customers_group_name']) > 17 ? "<acronym title=\"" . $customers['customers_group_name'] . "\"> " . substr($customers['customers_group_name'], 0, 17) . "&nbsp;</acronym>" : $customers['customers_group_name'], 'date_account_created' => xos_date_short($info['date_account_created']), 'group_ra_status_image' => $customers['customers_group_ra'] == '1' ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_GREEN) : xos_draw_separator('pixel_trans.gif', '10', '10'));
     }
     $smarty->assign(array('link_self_company_sort_asc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=company'), 'link_self_lastname_sort_asc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=lastname'), 'link_self_firstname_sort_asc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=firstname'), 'link_self_cg_name_sort_asc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=cg_name'), 'link_self_id_sort_asc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=id-asc'), 'link_self_ra_sort_asc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=ra'), 'link_self_company_sort_desc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=company-desc'), 'link_self_lastname_sort_desc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=lastname-desc'), 'link_self_firstname_sort_desc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=firstname-desc'), 'link_self_cg_name_sort_desc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=cg_name-desc'), 'link_self_id_sort_desc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=id-desc'), 'link_self_ra_sort_desc' => xos_href_link(FILENAME_CUSTOMERS, 'listing=ra-desc'), 'text_company_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . ENTRY_COMPANY . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'text_lastname_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . TABLE_HEADING_LASTNAME . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'text_firstname_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . TABLE_HEADING_FIRSTNAME . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'text_cg_name_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . TABLE_HEADING_CUSTOMERS_GROUPS . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'text_id_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . TABLE_HEADING_ACCOUNT_CREATED . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'text_ra_sort_asc' => ICON_TITLE_IC_UP_TEXT_SORT . ' ' . TABLE_HEADING_REQUEST_AUTHENTICATION . ' ' . ICON_TITLE_IC_UP_TEXT_FROM_TOP_ABC, 'text_company_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . ENTRY_COMPANY . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX, 'text_lastname_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . TABLE_HEADING_LASTNAME . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX, 'text_firstname_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . TABLE_HEADING_FIRSTNAME . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX, 'text_cg_name_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . TABLE_HEADING_CUSTOMERS_GROUPS . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX, 'text_id_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . TABLE_HEADING_ACCOUNT_CREATED . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX, 'text_ra_sort_desc' => ICON_TITLE_IC_DOWN_TEXT_SORT . ' ' . TABLE_HEADING_REQUEST_AUTHENTICATION . ' ' . ICON_TITLE_IC_DOWN_TEXT_FROM_TOP_ZYX));
     if (SESSID) {
         $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
     }
     $smarty->assign(array('form_begin_search' => xos_draw_form('search', FILENAME_CUSTOMERS, '', 'get'), 'input_search' => xos_draw_input_field('search'), 'form_end' => '</form>', 'customers' => $customers_array, 'nav_bar_number' => $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS), 'nav_bar_result' => $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], xos_get_all_get_params(array('page', 'info', 'x', 'y', 'cID')))));
     if (isset($_GET['search']) && xos_not_null($_GET['search'])) {
         $smarty->assign('link_filename_customers_reset', xos_href_link(FILENAME_CUSTOMERS));
     }
     require DIR_WS_BOXES . 'infobox_customers.php';
 }
 $smarty->assign('BODY_TAG_PARAMS', 'onload="SetFocus();"');
 $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'customers');
 $output_customers = $smarty->fetch(ADMIN_TPL . '/customers.tpl');
 $smarty->assign('central_contents', $output_customers);
                 $options_name = $attributes_values['products_options_name'];
             } else {
                 $options_name = '';
             }
             $current_attributes_values_array[$attributes_values['products_attributes_id']] = array('value_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']);
             $attributes_values_array[] = array('option_name' => $options_name, 'value_name' => $attributes_values['products_options_values_name'], 'input_value_price' => xos_draw_input_field('value_price_' . $attributes_values['products_attributes_id'], $attributes_values['options_values_price'], 'style="background: #fffffe;" size ="11" onkeyup="updateGross(\'value_price_' . $attributes_values['products_attributes_id'] . '\', \'value_price_gross_' . $attributes_values['products_attributes_id'] . '\')"'), 'input_value_price_gross' => xos_draw_input_field('value_price_gross_' . $attributes_values['products_attributes_id'], $attributes_values['options_values_price'], 'style="background: #fffffe;" size ="11" onkeyup="updateNet(\'value_price_gross_' . $attributes_values['products_attributes_id'] . '\', \'value_price_' . $attributes_values['products_attributes_id'] . '\')"'), 'input_price_prefix' => xos_draw_input_field('price_prefix_' . $attributes_values['products_attributes_id'], $attributes_values['price_prefix'], 'style="background: #fffffe; text-align:center;" size ="1"'));
             $update_gross_string .= 'updateGross(\'value_price_' . $attributes_values['products_attributes_id'] . '\', \'value_price_gross_' . $attributes_values['products_attributes_id'] . '\');' . "\n";
             $update_net_string .= 'updateNet(\'value_price_gross_' . $attributes_values['products_attributes_id'] . '\', \'value_price_' . $attributes_values['products_attributes_id'] . '\');' . "\n";
         }
     }
     ///////////////////////////////////////
     $javascript .= "\n" . 'function toggle(targetId, iState) {' . "\n" . '  var obj = document.getElementById(targetId).style;' . "\n" . '  if (obj.display == "none" && iState != 0 && iState != 1){' . "\n" . '    obj.display="";' . "\n" . '  } else if (iState != 0 && iState != 1){' . "\n" . '    obj.display="none";' . "\n" . '  }' . "\n" . '  if (iState == 1){' . "\n" . '    obj.display="";' . "\n" . '  } else if (iState == 0){' . "\n" . '    obj.display="none";' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function updateChecked(cuID) {' . "\n" . '  var selected = document.forms["' . $form_action . '"].elements["option[" + cuID + "]"].checked;' . "\n" . '  if (selected) {' . "\n" . '    toggle("box_" + cuID,1);' . "\n" . '  } else {' . "\n" . '    toggle("box_" + cuID,0);' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function doRound(x, places) {' . "\n" . '  return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);' . "\n" . '}' . "\n\n" . 'function getTaxRate() {' . "\n" . '  var selected_value = document.forms["' . $form_action . '"].tax_rates_final_id.selectedIndex;' . "\n" . '  var parameterVal = document.forms["' . $form_action . '"].tax_rates_final_id[selected_value].value;' . "\n\n" . '  if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {' . "\n" . '    return tax_rates[parameterVal];' . "\n" . '  } else {' . "\n" . '    return 0;' . "\n" . '  }' . "\n" . '}' . "\n\n" . 'function updateGross(inField, setField) {' . "\n" . '  var taxRate = getTaxRate();' . "\n" . '  var grossValue = document.forms["' . $form_action . '"].elements[inField].value;' . "\n\n" . '  if (taxRate > 0) {' . "\n" . '    grossValue = grossValue * ((taxRate / 100) + 1);' . "\n" . '  }' . "\n\n" . '  document.forms["' . $form_action . '"].elements[setField].value = doRound(grossValue, 4);' . "\n" . '}' . "\n\n" . 'function updateNet(inField, setField) {' . "\n" . '  var taxRate = getTaxRate();' . "\n" . '  var netValue = document.forms["' . $form_action . '"].elements[inField].value;' . "\n\n" . '  if (taxRate > 0) {' . "\n" . '    netValue = netValue / ((taxRate / 100) + 1);' . "\n" . '  }' . "\n\n" . '  document.forms["' . $form_action . '"].elements[setField].value = doRound(netValue, 4);' . "\n" . '}' . "\n\n" . 'function updatePrices(net, gross) {' . "\n\n" . '  if (gross) {' . "\n" . '    ' . $update_gross_string . "\n" . '  }' . "\n\n" . '  if (net) {' . "\n" . '    ' . $update_net_string . "\n" . '  }' . "\n\n" . '}' . "\n\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
     if ($product['products_status'] == '1') {
         $products_status_image = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN);
     } else {
         $products_status_image = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED);
     }
     if (isset($_GET['pID'])) {
         $smarty->assign('update', true);
     }
     if ($messageStack->size('price_error') > 0) {
         $smarty->assign('message_price_error', $messageStack->output('price_error'));
     }
     $smarty->assign(array('edit_prices' => true, 'product_id' => $product['products_id'], 'product_model' => $product['products_model'], 'product_status_image' => $products_status_image, 'product_name' => $product['products_name'], 'javascript' => $javascript, 'form_begin' => xos_draw_form($form_action, FILENAME_UPDATE_PRODUCTS_PRICES, 'product_ID=' . $product['products_id'] . '&categories_or_pages_id=' . $categories_or_pages_id . '&manufacturers_id=' . $manufacturers_id . '&max_rows=' . $_GET['max_rows'] . '&page=' . $_GET['page'] . ($_GET['specials_only'] ? '&specials_only=' . $_GET['specials_only'] : '') . '&action=' . $form_action, 'post', 'onsubmit="return confirm(\'' . JS_CONFIRM_UPDATE . '\')" enctype="multipart/form-data"'), 'pull_down_products_tax_class' => xos_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $product['products_tax_class_id']), 'pull_down_tax_rates' => xos_draw_pull_down_menu('tax_rates_final_id', $tax_rates_final_array, '', 'onchange="updatePrices(false, true)"'), 'update_prices' => 'updatePrices(true, true)', 'update_checked_string' => $update_checked_string, 'customers_groups' => $customers_groups_array, 'attributes_values' => $attributes_values_array, 'hidden_price_array' => xos_draw_hidden_field('price_array', $product['products_price']), 'hidden_attributes_price_array' => xos_draw_hidden_field('attributes_price_array', serialize($current_attributes_values_array)), 'link_filename_update_products_prices' => xos_href_link(FILENAME_UPDATE_PRODUCTS_PRICES, 'categories_or_pages_id=' . $categories_or_pages_id . '&manufacturers_id=' . $manufacturers_id . '&max_rows=' . $_GET['max_rows'] . '&page=' . $_GET['page'] . ($_GET['specials_only'] ? '&specials_only=' . $_GET['specials_only'] : ''))));
 }
 $smarty->assign('form_end', '</form>');
 $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'update_products_prices');
 $output_update_products_prices = $smarty->fetch(ADMIN_TPL . '/update_products_prices.tpl');
 $smarty->assign('central_contents', $output_update_products_prices);
 $smarty->display(ADMIN_TPL . '/frame.tpl');
 require DIR_WS_INCLUDES . 'application_bottom.php';
Example #14
0
<?php

$oID = xos_db_prepare_input($_GET['oID']);
$orders_query = xos_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int) $oID . "'");
include DIR_WS_CLASSES . 'order.php';
$order = new order($oID);
$javascript = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'function resize() {' . "\n" . '  window.resizeTo(900, 750);' . "\n" . '   self.focus();' . "\n" . '}' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
require DIR_WS_INCLUDES . 'html_header.php';
$order_products_array = array();
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
    if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
        $order_attributes_array = array();
        for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
            $order_attributes_array[] = array('option_name' => $order->products[$i]['attributes'][$j]['option'], 'option_value_name' => $order->products[$i]['attributes'][$j]['value']);
        }
    }
    $order_products_array[] = array('qty' => $order->products[$i]['qty'], 'model' => $order->products[$i]['model'], 'name' => $order->products[$i]['name'], 'packaging_unit' => $order->products[$i]['packaging_unit'], 'product_attributes' => $order_attributes_array);
    unset($order_attributes_array);
}
$smarty->assign(array('store_name_address' => nl2br(STORE_NAME_ADDRESS), 'shop_logo' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/shop_logo.gif', STORE_NAME), 'customer_address' => xos_address_format($order->customer['format_id'], $order->customer, 1, '', '<br />'), 'delivery_address' => xos_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />'), 'billing_address' => xos_address_format($order->billing['format_id'], $order->billing, 1, '', '<br />'), 'o_id' => $oID, 'c_id' => $order->customer['c_id'], 'customer_telephone' => $order->customer['telephone'], 'customer_email_address' => $order->customer['email_address'], 'payment_method' => $order->info['payment_method'], 'order_products' => $order_products_array));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'packingslip');
$language_directory_query = xos_db_query("select directory from " . TABLE_LANGUAGES . " where use_in_id > '1' and directory = '" . $order->info['language_directory'] . "'");
if (xos_db_num_rows($language_directory_query)) {
    $smarty->configLoad(DIR_FS_SMARTY . 'catalog/languages/' . $order->info['language_directory'] . '.conf', 'order_info');
}
$smarty->display(ADMIN_TPL . '/packingslip.tpl');
return 'overwrite_all';
        $contents[] = array('text' => '<br />' . $file_upload);
        $contents[] = array('text' => '<br />' . ($directory_writeable == true ? '<a href="" onclick="file.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPLOAD . ' "><span>' . BUTTON_TEXT_UPLOAD . '</span></a>' : '') . '<a href="' . xos_href_link(FILENAME_FILE_MANAGER, isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) : '') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
        break;
    default:
        if (isset($fInfo) && is_object($fInfo)) {
            $heading_title = '<b>' . $fInfo->name . '</b>';
            $ws_path = str_replace(DIR_FS_DOCUMENT_ROOT, DIR_WS_CATALOG, $_SESSION['current_path']);
            if (substr($ws_path, -1) != '/') {
                $ws_path = $ws_path . '/';
            }
            if (!($fInfo->is_dir || $fInfo->is_image)) {
                $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=edit') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_EDIT . ' "><span>' . BUTTON_TEXT_EDIT . '</span></a>');
            }
            if ($fInfo->is_image) {
                $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=view') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_REAL_IMAGE . ' "><span>' . BUTTON_TEXT_REAL_IMAGE . '</span></a>');
                $contents[] = array('text' => '<br />' . xos_image($ws_path . rawurlencode($fInfo->name), $fInfo->name, '', '', 'style="max-width: 250px; max-height: 250px;"'));
            }
            $contents[] = array('text' => '<br />' . TEXT_FILE_NAME . ' <b>' . $fInfo->name . '</b>');
            if ($fInfo->is_image) {
                $contents[] = !empty($fInfo->image_data['mime']) ? array('text' => '<br />' . TEXT_IMAGE_MIME_TYPE . ' <b>' . $fInfo->image_data['mime'] . '</b>') : array('text' => '<br />' . TEXT_IMAGE_MIME_TYPE . ' <b>' . TEXT_UNKNOWN . '</b>');
                $contents[] = !empty($fInfo->image_data[0]) ? array('text' => TEXT_IMAGE_WIDTH . ' <b>' . $fInfo->image_data[0] . ' px</b>') : array('text' => TEXT_IMAGE_WIDTH . ' <b>' . TEXT_UNKNOWN . '</b>');
                $contents[] = !empty($fInfo->image_data[1]) ? array('text' => TEXT_IMAGE_HEIGHT . ' <b>' . $fInfo->image_data[1] . ' px</b>') : array('text' => TEXT_IMAGE_HEIGHT . ' <b>' . TEXT_UNKNOWN . '</b>');
                $contents[] = array('text' => TEXT_FILE_SIZE . ' <b>' . $fInfo->size . '</b>');
            } elseif (!$fInfo->is_dir) {
                $contents[] = array('text' => '<br />' . TEXT_FILE_SIZE . ' <b>' . $fInfo->size . '</b>');
            }
            $contents[] = array('text' => '<br />' . TEXT_LAST_MODIFIED . ' ' . $fInfo->last_modified);
        }
}
$smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
$output_infobox_file_manager = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_file_manager.tpl');
Example #16
0
        }
        $product_images[] = array('img_no' => $img_no, 'selection_delete_image' => xos_draw_selection_field('delete_product_image_' . $i, 'checkbox', 'true'), 'radio_large_image_default_size' => xos_draw_radio_field('large_image_size_' . $i, 'default', true), 'radio_large_image_uploaded_size' => xos_draw_radio_field('large_image_size_' . $i, 'uploaded', false), 'radio_large_image_input_size' => xos_draw_radio_field('large_image_size_' . $i, 'input', false), 'input_large_image_max_width' => xos_draw_input_field('large_image_max_width_' . $i, '', 'style="background: #fffffe;" size ="2"'), 'input_large_image_max_height' => xos_draw_input_field('large_image_max_height_' . $i, '', 'style="background: #fffffe;" size ="2"'), 'small_product_image_max_height' => SMALL_PRODUCT_IMAGE_MAX_HEIGHT, 'image' => xos_image(DIR_WS_CATALOG_IMAGES . 'products/small/' . $products_image[$i]['name'], $pInfo->products_name), 'file_image' => xos_draw_file_field('products_image_' . $i), 'image_name' => $products_image[$i]['name'], 'large_img_width' => $large_img_size[0], 'large_img_height' => $large_img_size[1], 'large_img_base' => $products_image[$i]['large_image_max_width'] == 'default' ? 'default_size' : ($products_image[$i]['large_image_max_width'] == '0' ? 'origin_size' : ((int) $products_image[$i]['large_image_max_width'] > 0 ? 'self_selected_size' : '')), 'hidden_current_image' => xos_draw_hidden_field('current_product_image_' . $i, $products_image[$i]['name']));
        if (empty($products_image[$i]['name'])) {
            $more_images = true;
        }
    }
    $product_values = array();
    if (WYSIWYG_FOR_PRODUCT == 'true') {
        $smarty->assign(array('wysiwyg' => true, 'link_filename_popup_file_manager_link_selection' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents')), 'link_filename_popup_file_manager_image' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/image')), 'link_filename_popup_file_manager_flash' => str_replace('&amp;', '&', xos_href_link(FILENAME_POPUP_FILE_MANAGER, 'action=no_link_entrence&goto=' . DIR_FS_DOCUMENT_ROOT . 'contents/flash')), 'product_config' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/ckconfig/product_config.js', 'product_base_href' => ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER, 'lang_code' => xos_get_languages_code()));
    }
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        sizeof($languages) > 1 ? $sort_order = 'products_id' : ($sort_order = 'products_p_unit');
        $products_p_units_array = array(array('id' => '', 'text' => TEXT_NONE));
        $products_p_units_query = xos_db_query("select distinct products_p_unit from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '" . $languages[$i]['id'] . "' order by '" . $sort_order . "'");
        while ($products_p_units = xos_db_fetch_array($products_p_units_query)) {
            if (!empty($products_p_units['products_p_unit'])) {
                $products_p_units_array[] = array('id' => $products_p_units['products_p_unit'], 'text' => $products_p_units['products_p_unit']);
            }
        }
        $product_values[] = array('languages_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'input_name' => xos_draw_input_field('products_name[' . $languages[$i]['id'] . ']', isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : xos_get_products_name($pInfo->products_id, $languages[$i]['id']), 'size="30"'), 'input_description_tab_label' => xos_draw_input_field('products_description_tab_label[' . $languages[$i]['id'] . ']', isset($products_description_tab_label[$languages[$i]['id']]) ? stripslashes($products_description_tab_label[$languages[$i]['id']]) : xos_get_products_description_tab_label($pInfo->products_id, $languages[$i]['id']), 'size="90"'), 'pull_down_input_p_unit' => xos_draw_pull_down_menu('products_p_unit[' . $languages[$i]['id'] . ']', $products_p_units_array, isset($products_p_unit[$languages[$i]['id']]) ? stripslashes($products_p_unit[$languages[$i]['id']]) : xos_get_products_p_unit($pInfo->products_id, $languages[$i]['id']), 'style="width: 17em"'), 'input_new_p_unit' => xos_draw_input_field('products_new_p_unit[' . $languages[$i]['id'] . ']'), 'info_name' => 'products_info[' . $languages[$i]['id'] . ']', 'description_name' => 'products_description[' . $languages[$i]['id'] . ']', 'product_info_template_file' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN . 'includes/ckconfig/templates/' . $languages[$i]['directory'] . '/product_info_template.js', 'product_info_template_lang' => $languages[$i]['directory'] . '_default', 'product_description_template_file' => (ENABLE_SSL == 'true' ? $_SESSION['disable_ssl'] ? HTTP_SERVER : HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN . 'includes/ckconfig/templates/' . $languages[$i]['directory'] . '/product_description_template.js', 'product_description_template_lang' => $languages[$i]['directory'] . '_default', 'textarea_info' => xos_draw_textarea_field('products_info[' . $languages[$i]['id'] . ']', '90', '4', isset($products_info[$languages[$i]['id']]) ? stripslashes($products_info[$languages[$i]['id']]) : xos_get_products_info($pInfo->products_id, $languages[$i]['id'])), 'textarea_description' => xos_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', '90', '15', isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : xos_get_products_description($pInfo->products_id, $languages[$i]['id'])), 'input_url' => xos_draw_input_field('products_url[' . $languages[$i]['id'] . ']', isset($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : xos_get_products_url($pInfo->products_id, $languages[$i]['id'])));
    }
    if (isset($_GET['pID'])) {
        $smarty->assign('update', true);
    }
    if ($messageStack->size('price_error') > 0) {
        $smarty->assign('message_price_error', $messageStack->output('price_error'));
    }
    $smarty->assign(array('javascript' => $javascript, 'form_begin' => xos_draw_form($form_action, FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '') . '&action=' . $form_action, 'post', 'onsubmit="return confirm(\'' . ($form_action == 'insert_product' ? JS_CONFIRM_INSERT : JS_CONFIRM_UPDATE) . '\')" enctype="multipart/form-data"'), 'text_new_product' => sprintf(TEXT_NEW_PRODUCT_3, $form_action == 'insert_product' ? TEXT_NEW_PRODUCT_1 : TEXT_NEW_PRODUCT_2, xos_output_generated_category_path($current_category_id)), 'radio_products_status_1' => xos_draw_radio_field('products_status', '1', $in_status), 'radio_products_status_0' => xos_draw_radio_field('products_status', '0', $out_status), 'pull_down_manufacturers' => xos_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id), 'pull_down_delivery_times' => xos_draw_pull_down_menu('products_delivery_time_id', $delivery_times_array, $pInfo->products_delivery_time_id == '' ? DEFAULT_DELIVERY_TIMES_ID : $pInfo->products_delivery_time_id), 'pull_down_products_tax_class' => xos_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id), 'pull_down_tax_rates' => xos_draw_pull_down_menu('tax_rates_final_id', $tax_rates_final_array, '', 'onchange="updatePrices(false, true)"'), 'update_prices' => 'updatePrices(true, true)', 'update_checked_string' => $update_checked_string, 'customers_groups' => $customers_groups_array, 'attributes_values' => $attributes_values_array, 'input_products_date_available' => xos_draw_input_field('products_date_available', $pInfo->products_date_available, 'id="products_date_available" style="background: #ebebff; color : red;" size ="10"'), 'input_products_quantity' => STOCK_CHECK == 'true' ? $has_product_attributes ? '<span id="total_qty">' . $pInfo->products_quantity . '</span>&nbsp;<a href="" onclick="get_attributes_qty_list(\'' . xos_href_link(FILENAME_ATTRIBUTES_QTY_LIST, 'products_id=' . $pInfo->products_id) . '\'); return false">' . xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_arrow_down.gif', '', 24, 15) . '</a>' . xos_draw_hidden_field('products_quantity', $pInfo->products_quantity) : xos_draw_input_field('products_quantity', $pInfo->products_quantity, 'size ="8"') : $pInfo->products_quantity, 'input_products_sort_order' => xos_draw_input_field('products_sort_order', $pInfo->products_sort_order, 'size ="8"'), 'input_products_model' => xos_draw_input_field('products_model', $pInfo->products_model), 'hidden_image_array' => xos_draw_hidden_field('image_array', $pInfo->products_image), 'hidden_price_array' => xos_draw_hidden_field('price_array', $pInfo->products_price), 'hidden_attributes_price_array' => xos_draw_hidden_field('attributes_price_array', serialize($current_attributes_values_array)), 'has_attributes_quantities' => STOCK_CHECK == 'true' && $has_product_attributes ? true : false, 'product_images' => $product_images, 'more_images' => $more_images, 'product_values' => $product_values, 'input_products_weight' => xos_draw_input_field('products_weight', $pInfo->products_weight, 'size ="8"'), 'hidden_products_date_added' => xos_draw_hidden_field('products_date_added', xos_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d')), 'link_filename_categories' => xos_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($_GET['pID']) ? '&pID=' . $_GET['pID'] : '')), 'form_end' => '</form>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'categories');
    $output_new_product = $smarty->fetch(ADMIN_TPL . '/includes/modules/new_product.tpl');
}
        $reviews_query = xos_db_query($reviews_split->sql_query);
        $product_reviews_array = array();
        while ($reviews = xos_db_fetch_array($reviews_query)) {
            $product_reviews_array[] = array('link_filename_product_reviews_info' => xos_href_link(FILENAME_PRODUCT_REVIEWS_INFO, xos_get_all_get_params(array('lnc', 'cur', 'tpl')) . 'r=' . $reviews['reviews_id']), 'date_added' => xos_date_long($reviews['date_added']), 'reviews_rating' => $reviews['reviews_rating'], 'review_text' => xos_break_string(xos_output_string_protected($reviews['reviews_text']), 60, '-<br />'), 'stars_image' => xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'customers_name' => xos_output_string_protected($reviews['customers_name']));
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign(array('product_reviews_array' => $product_reviews_array, 'product_reviews' => true));
    }
    $products_image_name = xos_get_product_images($product_info['products_image']);
    if (xos_not_null($products_image_name)) {
        $smarty->assign(array('product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($products_image_name['name']), addslashes($product_info['products_name']), '', '', 'class="img-responsive"')));
    }
    $smarty->assign(array('products_name' => $product_info['products_name'], 'products_model' => $product_info['products_model'], 'link_filename_product_reviews_write' => xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'rmp')), 'SSL'), 'nav_bar_number' => $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS), 'nav_bar_result' => '<nav><ul class="pagination">' . $reviews_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>'));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews');
}
// link_back will not be cached (nocache)
$back = sizeof($_SESSION['navigation']->path) - 2;
if (!empty($_SESSION['navigation']->path[$back])) {
    $get_params_array = $_SESSION['navigation']->path[$back]['get'];
    $get_params_array['rmp'] = '0';
    $smarty->assign('link_back', xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']), true);
} else {
    $smarty->assign('link_back', 'javascript:history.go(-1)', true);
}
$output_product_reviews = $smarty->fetch(SELECTED_TPL . '/product_reviews.tpl', $cache_id);
$smarty->assign('central_contents', $output_product_reviews);
//------------------------------------------------------------------------------
// this file is based on:
//              osCommerce, Open Source E-Commerce Solutions
//              http://www.oscommerce.com
//              Copyright (c) 2003 osCommerce
//              filename: manufacturer_info.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/manufacturer_info.php') == 'overwrite_all')) {
    if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true')) {
        $smarty->caching = 1;
        $cache_id = 'L3|box_manufacturer_info|' . $_SESSION['language'] . '-' . $_GET['lnc'] . '-' . $_GET[session_name()] . '-' . $session_started . '-' . SELECTED_TPL . '-' . $_SESSION['currency'] . '-' . $_GET['p'];
    }
    if (!$smarty->isCached(SELECTED_TPL . '/includes/boxes/manufacturers_info.tpl', $cache_id)) {
        $manufacturer_query = xos_db_query("select m.manufacturers_id, m.manufacturers_image, mi.manufacturers_name, 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) $_SESSION['languages_id'] . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int) $_GET['p'] . "' and p.manufacturers_id = m.manufacturers_id");
        if (xos_db_num_rows($manufacturer_query)) {
            $manufacturer = xos_db_fetch_array($manufacturer_query);
            if (xos_not_null($manufacturer['manufacturers_image'])) {
                $smarty->assign('box_manufacturer_info_manufacturer_image', xos_image(DIR_WS_IMAGES . 'manufacturers/' . rawurlencode($manufacturer['manufacturers_image']), $manufacturer['manufacturers_name']));
            }
            if (xos_not_null($manufacturer['manufacturers_url'])) {
                $smarty->assign(array('box_manufacturer_info_link_to_the_manufacturer' => xos_href_link(FILENAME_REDIRECT, 'action=manufacturer&m=' . $manufacturer['manufacturers_id']), 'box_manufacturer_info_manufacturer_name' => $manufacturer['manufacturers_name']));
            }
            $smarty->assign(array('box_manufacturer_info_has_content' => true, 'box_manufacturer_info_link_filename_default' => xos_href_link(FILENAME_DEFAULT, 'm=' . $manufacturer['manufacturers_id'])));
        }
    }
    $output_manufacturer_info = $smarty->fetch(SELECTED_TPL . '/includes/boxes/manufacturers_info.tpl', $cache_id);
    $smarty->caching = 0;
    $smarty->assign('box_manufacturer_info', $output_manufacturer_info);
}
            $contents[] = array('text' => '<div class="checkbox"><label>' . xos_draw_checkbox_field('downloads_flag', '1', $oInfo->downloads_flag) . ' ' . TEXT_SET_DOWNLOADS_STATUS . '</label></div>');
            if (DEFAULT_ORDERS_STATUS_ID != $oInfo->orders_status_id) {
                $contents[] = array('text' => '<div class="checkbox"><label>' . xos_draw_checkbox_field('default') . ' ' . TEXT_SET_DEFAULT . '</label></div>');
            }
            $contents[] = array('text' => '<br /><a href="" onclick="status.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_UPDATE . ' ">' . BUTTON_TEXT_UPDATE . '</a><a href="' . xos_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
            break;
        case 'delete':
            $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_ORDERS_STATUS . '</b>';
            $form_tag = xos_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' => '<br /><b>' . $oInfo->orders_status_name . '</b>');
            $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a>' . ($remove_status ? '<a href="" onclick="status.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>' : '') . '<br />&nbsp;');
            break;
        default:
            if (isset($oInfo) && is_object($oInfo)) {
                $heading_title = '<b>' . $oInfo->orders_status_name . '</b>';
                $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id . '&action=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_ORDERS_STATUS, 'page=' . $_GET['page'] . '&oID=' . $oInfo->orders_status_id . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
                $orders_status_inputs_string = '';
                $languages = xos_get_languages();
                for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                    $orders_status_inputs_string .= '<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . xos_get_orders_status_name($oInfo->orders_status_id, $languages[$i]['id']);
                }
                $contents[] = array('text' => $orders_status_inputs_string);
            }
            break;
    }
    $smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
    $output_infobox_orders_status = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_orders_status.tpl');
    $smarty->clearAssign(array('info_box_heading_title', 'info_box_form_tag', 'info_box_contents'));
    $smarty->assign('infobox_orders_status', $output_infobox_orders_status);
}
Example #20
0
                } else {
                    $opt_rows_array[$ii] = $opt_rows_array[$ii] + 1;
                    $opt_out_array[$ii] = $opt_out_array[$ii] + 1;
                    if ($opt_out_array[$ii] % $opt_array[$ii]['options_values_qty'] == 0) {
                        $opt_out_array[$ii] = 0;
                    }
                }
                $opt_result_array[$i][$ii] = $opt_values_array[$opt_array[$ii]['options_id']][max(0, $opt_out_array[$ii])]['options_values_name'];
                $comb_string .= $opt_array[$ii]['options_id'] . ',' . $opt_values_array[$opt_array[$ii]['options_id']][max(0, $opt_out_array[$ii])]['options_values_id'] . '_';
                $serialized_options .= 'id[' . $opt_array[$ii]['options_id'] . ']=' . $opt_values_array[$opt_array[$ii]['options_id']][max(0, $opt_out_array[$ii])]['options_values_id'] . '&';
            }
            $onclick_update_options_string = '<a class="options-list" href="" onclick="updateOptions(\'' . xos_href_link(FILENAME_UPDATE_OPTIONS, 'p=' . xos_get_prid($_GET['p']), 'NONSSL', true, false) . '\',\'' . $serialized_options . '\'); toggle(\'box_products_options_overview\'); return false">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . 'pixel_trans.gif', TEXT_OPTION_TO_INSERT, '16', '16') . '</a>';
            $comb_string = substr($comb_string, 0, -1);
            if (isset($attributes_quantity[$comb_string])) {
                $opt_result_array[$i][sizeof($opt_values_array)] = STOCK_CHECK == 'true' ? isset($attributes_quantity[$comb_string]) ? $attributes_quantity[$comb_string] <= 0 ? STOCK_ALLOW_CHECKOUT == 'false' ? '<span class="red-mark options-list">0</span>' : '<span class="red-mark options-list">' . $attributes_quantity[$comb_string] . '</span>' : '<span class="options-list">' . $attributes_quantity[$comb_string] . '</span>' : '' : 'tick';
                $opt_result_array[$i][sizeof($opt_values_array) + 1] = STOCK_CHECK == 'true' ? isset($attributes_quantity[$comb_string]) ? $attributes_quantity[$comb_string] <= 0 ? STOCK_ALLOW_CHECKOUT == 'false' ? '<span class="options-list-draw-separator">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . 'pixel_trans.gif', '', '16', '16') . '</span>' : $onclick_update_options_string : $onclick_update_options_string : '<span class="options-list-draw-separator">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . 'pixel_trans.gif', '', '16', '16') . '</span>' : $onclick_update_options_string;
            } else {
                $opt_result_array[$i][sizeof($opt_values_array)] = STOCK_CHECK == 'true' ? '<span class="red-mark options-list">X</span>' : 'cross';
                $opt_result_array[$i][sizeof($opt_values_array) + 1] = '<span class="options-list-draw-separator">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . 'pixel_trans.gif', '', '16', '16') . '</span>';
                //      unset($opt_result_array[$i]);
            }
        }
        unset($opt_array['rows_total']);
        $combinations_array = array();
        $combinations_array['options_names'] = $opt_array;
        $combinations_array['options_values'] = $opt_result_array;
        $smarty->assign(array('products_options_overview' => $combinations_array, 'options_values_price' => $options_values_price, 'stock_allow_checkout' => STOCK_ALLOW_CHECKOUT, 'stock_check' => STOCK_CHECK));
    }
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_info');
    $smarty->display(SELECTED_TPL . '/options_list.tpl');
}
Example #21
0
//              GNU General Public License for more details.
//
//              You should have received a copy of the GNU General Public License
//              along with XOS-Shop.  If not, see <http://www.gnu.org/licenses/>.
//------------------------------------------------------------------------------
// this file is based on:
//              osCommerce, Open Source E-Commerce Solutions
//              http://www.oscommerce.com
//              Copyright (c) 2003 osCommerce
//              filename: languages.php
//
//              Released under the GNU General Public License
////////////////////////////////////////////////////////////////////////////////
if (!(@(include DIR_FS_SMARTY . 'catalog/templates/' . SELECTED_TPL . '/php/includes/boxes/languages.php') == 'overwrite_all')) {
    $languages_string = '';
    $languages_list = '';
    reset($lng->catalog_languages);
    if (sizeof($lng->catalog_languages) > 1) {
        while (list($lang_code, $value) = each($lng->catalog_languages)) {
            $languages_string .= ' <a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('lnc', 'dfrom', 'dto')) . 'lnc=' . $lang_code, $request_type, true, true, false, false, false) . '">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . $value['directory'] . '/' . $value['image'], $value['name']) . '</a> ';
            if ($value['id'] == $_SESSION['languages_id']) {
                $language_used .= '<span>' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . $value['directory'] . '/' . $value['image'], $value['name']) . '</span>';
            } else {
                $languages_list .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('lnc', 'dfrom', 'dto')) . 'lnc=' . $lang_code, $request_type, true, true, false, false, false) . '">' . xos_image(DIR_WS_IMAGES . 'catalog/templates/' . SELECTED_TPL . '/' . $value['directory'] . '/' . $value['image'], $value['name']) . '</a>';
            }
        }
        $smarty->assign(array('box_languages_language_used' => $language_used, 'box_languages_languages_string' => $languages_string, 'box_languages_languages_list' => $languages_list));
        $output_languages = $smarty->fetch(SELECTED_TPL . '/includes/boxes/languages.tpl');
        $smarty->assign('box_languages', $output_languages);
    }
}
Example #22
0
                 $onclick_link = 'info=' . urlencode($fInfo->name) . '&action=view';
             } else {
                 $onclick_link = 'info=' . urlencode($fInfo->name) . '&action=edit';
             }
         } else {
             $onclick_link = 'info=' . urlencode($contents[$i]['name']);
         }
         if ($contents[$i]['is_dir']) {
             if ($contents[$i]['name'] == '..') {
                 $icon = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/previous_level.gif', ICON_TITLE_PREVIOUS_LEVEL);
             } else {
                 $icon = isset($fInfo) && is_object($fInfo) && $contents[$i]['name'] == $fInfo->name ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/current_folder.gif', ICON_TITLE_CURRENT_FOLDER) : xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/folder.gif', ICON_TITLE_FOLDER);
             }
             $link = xos_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_link);
         } else {
             $icon = $contents[$i]['is_image'] ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/image_download.gif', ICON_TITLE_FILE_DOWNLOAD) : xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/file_download.gif', ICON_TITLE_FILE_DOWNLOAD);
             $link = xos_href_link(FILENAME_FILE_MANAGER, 'action=download&filename=' . urlencode($contents[$i]['name']));
         }
         if ($contents[$i]['name'] != '..') {
             $link_delete = xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name']) . '&action=delete');
         }
         $folders_and_files_array[] = array('selected' => $selected, 'link_onclick' => xos_href_link(FILENAME_FILE_MANAGER, $onclick_link), 'link' => $link, 'icon' => $icon, 'name' => $contents[$i]['name'], 'size' => $contents[$i]['is_dir'] ? '&nbsp;' : $contents[$i]['size'], 'permissions' => $contents[$i]['permissions'], 'user' => $contents[$i]['user'], 'group' => $contents[$i]['group'], 'last_modified' => $contents[$i]['last_modified'], 'link_delete' => $link_delete, 'link_filename_file_manager_info' => xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name'])));
     }
     $smarty->assign(array('folders_and_files' => $folders_and_files_array, 'link_filename_file_manager_reset' => xos_href_link(FILENAME_FILE_MANAGER, 'action=reset'), 'link_filename_file_manager_upload' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=upload'), 'link_filename_file_manager_new_file' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=new_file'), 'link_filename_file_manager_new_folder' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=new_folder')));
     require DIR_WS_BOXES . 'infobox_file_manager.php';
 }
 if (SESSID) {
     $smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
 }
 $smarty->assign(array('form_begin_goto' => xos_draw_form('goto', FILENAME_FILE_MANAGER, '', 'get'), 'current_path' => $_SESSION['current_path'], 'pull_down_goto' => xos_draw_pull_down_menu('goto', $goto_array, $_SESSION['current_path'], 'onchange="this.form.submit();"'), 'form_end' => '</form>'));
 $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'file_manager');
Example #23
0
                }
            } else {
                $product_price = $currencies->display_price($products_prices[0][0]['regular'], $products_tax_rate);
                $products_prices[0]['special_status'] == 1 && $products_prices[0][0]['special'] > 0 ? $product_price_special = $currencies->display_price($products_prices[0][0]['special'], $products_tax_rate) : ($product_price_special = '');
                $sizeof = count($products_prices[0]);
                if ($sizeof > 2) {
                    $array_keys = array_keys($products_prices[0]);
                    for ($count = 2, $n = $sizeof; $count < $n; $count++) {
                        $qty = $array_keys[$count];
                        $price_breaks_array[] = array('qty' => $qty, 'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate), 'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : '');
                    }
                }
            }
            $product_image = xos_get_product_images($products_new['products_image']);
            $popup_content_id = xos_get_delivery_times_values($products_new['products_delivery_time_id'], 'popup_content_id');
            $products_new_array[] = array('link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $products_new['products_id']), 'href_buy_now' => xos_href_link(FILENAME_PRODUCTS_NEW, xos_get_all_get_params(array('action')) . 'action=buy_now&p=' . $products_new['products_id']), 'date_added' => xos_date_long($products_new['products_date_added']), 'image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($product_image['name']), $products_new['products_name'], '', '', 'class="img-responsive"'), 'td_width_img' => SMALL_PRODUCT_IMAGE_MAX_WIDTH + 10, 'manufacturer' => $products_new['manufacturers_name'], 'tax_description' => xos_get_products_tax_description($products_new['products_tax_class_id'], $products_tax_rate), 'products_delivery_time' => xos_get_delivery_times_values($products_new['products_delivery_time_id']), 'link_filename_popup_content_products_delivery_time' => $popup_content_id > 0 ? xos_href_link(FILENAME_POPUP_CONTENT, 'co=' . $popup_content_id . '&p=' . $products_new['products_id'], $request_type) : '', 'price' => $product_price, 'price_special' => $product_price_special, 'price_breaks' => $price_breaks_array, 'info' => $products_new['products_info'], 'products_p_unit' => $products_new['products_p_unit'], 'products_model' => $products_new['products_model'], 'products_quantity' => $products_new['products_quantity'], 'name' => $products_new['products_name']);
            unset($price_breaks_array);
        }
        if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_top', true);
        }
        if (PREV_NEXT_BAR_LOCATION == '2' || PREV_NEXT_BAR_LOCATION == '3') {
            $smarty->assign('nav_bar_bottom', true);
        }
        $smarty->assign('new_products', true);
    }
    $smarty->assign(array('nav_bar_number' => $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW), 'nav_bar_result' => '<nav><ul class="pagination">' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, xos_get_all_get_params(array('page', 'info', 'lnc', 'cur', 'tpl', 'x', 'y'))) . '</ul></nav>', 'interval_days_back' => INTERVAL_DAYS_BACK, 'products_new' => $products_new_array));
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'products_new');
}
$output_products_new = $smarty->fetch(SELECTED_TPL . '/products_new.tpl', $cache_id);
$smarty->assign('central_contents', $output_products_new);
            break;
        case 'delete':
            $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_DELIVERY_TIME . '</b>';
            $form_tag = xos_draw_form('delivery_time', FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id . '&action=deleteconfirm');
            if ($remove_delivery_time) {
                $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
            }
            $contents[] = array('text' => '<br /><b>' . $dInfo->delivery_times_text . '</b>');
            $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a>' . ($remove_delivery_time ? '<a href="" onclick="delivery_time.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>' : '') . '<br />&nbsp;');
            break;
        default:
            if (isset($dInfo) && is_object($dInfo)) {
                $heading_title = '<b>' . $dInfo->delivery_times_text . '</b>';
                $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id . '&action=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_DELIVERY_TIMES, 'page=' . $_GET['page'] . '&dID=' . $dInfo->delivery_times_id . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
                $delivery_times_inputs_string = '';
                $languages = xos_get_languages();
                for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                    $delivery_times_inputs_string .= '<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . xos_get_delivery_times_values($dInfo->delivery_times_id, 'delivery_times_text', $languages[$i]['id']);
                }
                $contents[] = array('text' => $delivery_times_inputs_string);
                if ($dInfo->popup_content_id > 0) {
                    $contents[] = array('text' => '<br />' . TEXT_INFO_POPUP_CONTENT_ID . ' ' . $dInfo->popup_content_id);
                }
            }
            break;
    }
    $smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
    $output_infobox_delivery_times = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_delivery_times.tpl');
    $smarty->clearAssign(array('info_box_heading_title', 'info_box_form_tag', 'info_box_contents'));
    $smarty->assign('infobox_delivery_times', $output_infobox_delivery_times);
}
             }
         }
         $popup_img = DIR_WS_IMAGES . 'products/large/' . $products_img_name['name'];
         $pop_size = @GetImageSize("{$popup_img}");
         if ($pop_size[0] > $pop_width) {
             $pop_width = $pop_size[0];
         }
         if ($pop_size[1] > $pop_height) {
             $pop_height = $pop_size[1];
         }
     }
     if ($small_width_total > $pop_width) {
         $pop_width = $small_width_total;
     }
     $product_image = array_shift($products_image_name);
     $smarty->assign(array('box_width' => (int) ($pop_width + 50), 'box_height' => (int) ($pop_height + $small_height + 55), 'link_product_img' => xos_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&img_name=' . rawurlencode($product_image['name']), $request_type), 'link_product_img_noscript' => xos_href_link(FILENAME_IMAGES_WINDOW, 'pID=' . $product_info['products_id'], 'NONSSL', true, false, false, false, false), 'product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($product_image['name']), addslashes($product_info['products_name']), '', '', 'style="margin: 5px;"')));
 }
 $back = sizeof($_SESSION['navigation']->path) - 2;
 if (!empty($_SESSION['navigation']->path[$back])) {
     $get_params_array = $_SESSION['navigation']->path[$back]['get'];
     $get_params_array['rmp'] = '0';
     $back_link = xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']);
 } else {
     $back_link = 'javascript:history.go(-1)';
 }
 $smarty->assign(array('form_begin' => xos_draw_form('product_reviews_write', xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'action')) . 'action=process', 'SSL'), 'post', 'onsubmit="return checkForm();"', true), 'form_end' => '</form>', 'radio_fields' => xos_draw_radio_field('rating', '1') . ' ' . xos_draw_radio_field('rating', '2') . ' ' . xos_draw_radio_field('rating', '3') . ' ' . xos_draw_radio_field('rating', '4') . ' ' . xos_draw_radio_field('rating', '5'), 'textarea_field' => xos_draw_textarea_field('review', '60', '15'), 'customers_name' => xos_output_string_protected($customer['customers_firstname'] . ' ' . $customer['customers_lastname']), 'products_name' => $product_info['products_name'], 'products_p_unit' => $product_info['products_p_unit'], 'products_model' => $product_info['products_model'], 'products_price' => $product_price, 'products_price_special' => $product_price_special, 'products_price_breaks' => $price_breaks_array, 'products_tax_description' => xos_get_products_tax_description($product_info['products_tax_class_id'], $products_tax_rate), 'td_width_img' => MEDIUM_PRODUCT_IMAGE_MAX_WIDTH + 10, 'link_back' => $back_link, 'link_buy_now' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action')) . 'action=buy_now')));
 $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews_write');
 $output_product_reviews_write = $smarty->fetch(SELECTED_TPL . '/product_reviews_write.tpl');
 $smarty->assign('central_contents', $output_product_reviews_write);
 $smarty->display(SELECTED_TPL . '/frame.tpl');
 require DIR_WS_INCLUDES . 'application_bottom.php';
        if (xos_db_num_rows($check_query) != 1) {
            $form_tag = xos_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' => '<br /><b>' . $trInfo->tax_class_title . ' ' . number_format($trInfo->tax_rate, TAX_DECIMAL_PLACES) . '%</b>');
            $contents[] = array('text' => '<br /><a href="" onclick="rates.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
        } else {
            $contents[] = array('text' => TEXT_INFO_DELETE_NOT_ALLOWED . '<br /><br />');
            $contents[] = array('text' => '<br /><a href="' . xos_href_link(FILENAME_TAX_RATES, xos_get_all_get_params(array('action'))) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_BACK . ' "><span>' . BUTTON_TEXT_BACK . '</span></a><br />&nbsp;');
        }
        break;
    default:
        if (is_object($trInfo)) {
            $heading_title = '<b>' . $trInfo->tax_class_title . '</b>';
            $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=edit') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_EDIT . ' "><span>' . BUTTON_TEXT_EDIT . '</span></a><a href="' . xos_href_link(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $trInfo->tax_rates_id . '&action=delete') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a>');
            $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . xos_date_short($trInfo->date_added));
            $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . ' ' . xos_date_short($trInfo->last_modified));
            $tax_description_inputs_string = '';
            $languages = xos_get_languages();
            for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                $tax_description = xos_get_tax_rates_description($trInfo->tax_rates_id, $languages[$i]['id']);
                $tax_description_inputs_string .= '<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . $tax_description;
            }
            $contents[] = array('text' => '<br />' . TEXT_INFO_RATE_DESCRIPTION . '<br />' . $tax_description_inputs_string);
        }
        break;
}
$smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
$output_infobox_tax_rates = $smarty->fetch(ADMIN_TPL . '/includes/boxes/infobox_tax_rates.tpl');
$smarty->clearAssign(array('info_box_heading_title', 'info_box_form_tag', 'info_box_contents'));
$smarty->assign('infobox_tax_rates', $output_infobox_tax_rates);
return 'overwrite_all';
         break;
     case 'delete':
         $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_CURRENCY . '</b>';
         $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
         $contents[] = array('text' => '<br /><b>' . $cInfo->title . '</b>');
         $contents[] = array('text' => '<br />' . '<a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a>' . ($remove_currency ? '<a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>' : '') . '<br />&nbsp;');
         break;
     default:
         if (is_object($cInfo)) {
             $heading_title = '<b>' . $cInfo->title . '</b>';
             $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
             $languages = xos_get_languages();
             for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
                 $currency_query = xos_db_query("select title, symbol_left, symbol_right, decimal_point, thousands_point from " . TABLE_CURRENCIES . " where currencies_id = '" . $cInfo->currencies_id . "' and language_id = '" . (int) $languages[$i]['id'] . "'");
                 $currency = xos_db_fetch_array($currency_query);
                 $contents[] = array('text' => '<br />&nbsp;<br />' . xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']));
                 $contents[] = array('text' => TEXT_INFO_CURRENCY_TITLE . ' ' . $currency['title']);
                 $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENCY_SYMBOL_LEFT . ' ' . $currency['symbol_left']);
                 $contents[] = array('text' => TEXT_INFO_CURRENCY_SYMBOL_RIGHT . ' ' . $currency['symbol_right']);
                 $contents[] = array('text' => '<br />' . TEXT_INFO_CURRENCY_DECIMAL_POINT . ' ' . $currency['decimal_point']);
                 $contents[] = array('text' => TEXT_INFO_CURRENCY_THOUSANDS_POINT . ' ' . $currency['thousands_point']);
             }
             $contents[] = array('text' => '<br />&nbsp;<br />&nbsp;<br />' . TEXT_INFO_CURRENCY_CODE . ' ' . $cInfo->code);
             $contents[] = array('text' => TEXT_INFO_CURRENCY_DECIMAL_PLACES . ' ' . $cInfo->decimal_places);
             $contents[] = array('text' => TEXT_INFO_CURRENCY_VALUE . ' ' . number_format($cInfo->value, 8));
             $contents[] = array('text' => TEXT_INFO_CURRENCY_EXAMPLE . ' ' . $currencies->format('30') . ' = ' . $currencies->format('30', true, $cInfo->code));
             $contents[] = array('text' => TEXT_INFO_CURRENCY_LAST_UPDATED . ' ' . xos_date_short($cInfo->last_updated));
         }
         break;
 }
 $smarty->assign(array('info_box_heading_title' => $heading_title, 'info_box_form_tag' => $form_tag, 'info_box_contents' => $contents));
Example #28
0
                    $array_keys = array_keys($products_prices[$customer_group_id]);
                    for ($count=2, $n=$sizeof; $count<$n; $count++) {
                      $qty = $array_keys[$count];
                      $specials_price_breaks_array[]=array('qty' => $qty,
                                                           'price_break' => $currencies->display_price($products_prices[$customer_group_id][$qty]['regular'], $products_tax_rate),
                                                           'price_break_special' => $products_prices[$customer_group_id]['special_status'] == 1 && $products_prices[$customer_group_id][$qty]['special'] > 0 ? $currencies->display_price($products_prices[$customer_group_id][$qty]['special'], $products_tax_rate) : '');
                    }       
                  }
            */
        } else {
            $specials_product_price = $currencies->display_price($products_prices[0][0]['regular'], $products_tax_rate);
            $products_prices[0]['special_status'] == 1 && $products_prices[0][0]['special'] > 0 ? $specials_product_price_special = $currencies->display_price($products_prices[0][0]['special'], $products_tax_rate) : ($specials_product_price_special = '');
            $sizeof = count($products_prices[0]);
            /*      
                  if ($sizeof > 2) {      
                    $array_keys = array_keys($products_prices[0]);
                    for ($count=2, $n=$sizeof; $count<$n; $count++) {
                      $qty = $array_keys[$count];
                      $specials_price_breaks_array[]=array('qty' => $qty,
                                                           'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate),
                                                           'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : '');                                      
                    }                                           
                  } 
            */
        }
        $random_special_product_image = xos_get_product_images($random_product['products_image']);
        $smarty->assign(array('box_specials_link_filename_specials' => xos_href_link(FILENAME_SPECIALS), 'box_specials_link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $random_product["products_id"]), 'box_specials_product_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($random_special_product_image['name']), $random_product['products_name']), 'box_specials_product_name' => $random_product['products_name'], 'box_specials_product_price' => $specials_product_price, 'box_specials_product_price_special' => $specials_product_price_special, 'box_specials_products_tax_description' => xos_get_products_tax_description($random_product['products_tax_class_id'], $products_tax_rate), 'box_specials_product_price_breaks' => $specials_price_breaks_array));
        $output_specials = $smarty->fetch(SELECTED_TPL . '/includes/boxes/specials.tpl');
        $smarty->assign('box_specials', $output_specials);
    }
}
Example #29
0
                                                                    'price_break_special' => $products_prices[$customer_group_id]['special_status'] == 1 && $products_prices[$customer_group_id][$qty]['special'] > 0 ? $currencies->display_price($products_prices[$customer_group_id][$qty]['special'], $products_tax_rate) : '');
                                }       
                              }
                    */
                } else {
                    $xsell_product_price = $currencies->display_price($products_prices[0][0]['regular'], $products_tax_rate);
                    $products_prices[0]['special_status'] == 1 && $products_prices[0][0]['special'] > 0 ? $xsell_product_price_special = $currencies->display_price($products_prices[0][0]['special'], $products_tax_rate) : ($xsell_product_price_special = '');
                    $sizeof = count($products_prices[0]);
                    /*          
                              if ($sizeof > 2) {      
                                $array_keys = array_keys($products_prices[0]);
                                for ($count=2, $n=$sizeof; $count<$n; $count++) {
                                  $qty = $array_keys[$count];
                                  $xsell_price_breaks_array[]=array('qty' => $qty,
                                                                    'price_break' => $currencies->display_price($products_prices[0][$qty]['regular'], $products_tax_rate),
                                                                    'price_break_special' => $products_prices[0]['special_status'] == 1 && $products_prices[0][$qty]['special'] > 0 ? $currencies->display_price($products_prices[0][$qty]['special'], $products_tax_rate) : '');                                      
                                }                                           
                              } 
                    */
                }
                $xsell_products_image = xos_get_product_images($xsell['products_image']);
                $xsell_products_array[] = array('link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $xsell['products_id']), 'image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($xsell_products_image['name']), $xsell['products_name']), 'info' => $xsell['products_info'], 'price' => $xsell_product_price, 'price_special' => $xsell_product_price_special, 'price_breaks' => $xsell_price_breaks_array, 'tax_description' => xos_get_products_tax_description($xsell['products_tax_class_id'], $products_tax_rate), 'name' => $xsell['products_name']);
            }
            $smarty->assign('xsell_products', $xsell_products_array);
            $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'xsell_products');
            $output_xsell_products = $smarty->fetch(SELECTED_TPL . '/includes/modules/xsell_products.tpl');
            $smarty->clearAssign('xsell_products');
            $smarty->assign('xsell_products', $output_xsell_products);
        }
    }
}
Example #30
0
            $cross_products = xos_db_fetch_array($cross_products_query);
            $select = '<select name="' . $cross_products['products_id'] . '">';
            for ($y = 1; $y <= $ordering_size; $y++) {
                $select .= '<option value="' . $y . '"';
                if (!strcmp($y, $cross['sort_order'])) {
                    $select .= ' selected="selected"';
                }
                $select .= '>' . $y . '</option>';
            }
            $select .= '</select>';
            if ($cross_products['products_status'] == '1') {
                $products_status_image = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN);
            } else {
                $products_status_image = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED);
            }
            $cross_products_array[] = array('product_id' => $cross_products['products_id'], 'product_model' => $cross_products['products_model'], 'product_status_image' => $products_status_image, 'product_name' => $cross_products['products_name'], 'select_tag' => $select);
        }
        if ($product['products_status'] == '1') {
            $smarty->assign('product_status_image', xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN));
        } else {
            $smarty->assign('product_status_image', xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED));
        }
        $smarty->assign(array('sort_related_products' => true, 'form_begin_runing_update' => xos_draw_form('runing_update', FILENAME_XSELL_PRODUCTS, 'sort=1&add_related_product_ID=' . $_GET['add_related_product_ID'] . '&categories_or_pages_id=' . $categories_or_pages_id . '&manufacturers_id=' . $manufacturers_id . '&max_rows=' . $_GET['max_rows']), 'link_to_relating_products' => xos_href_link(FILENAME_XSELL_PRODUCTS, 'categories_or_pages_id=' . $categories_or_pages_id . '&manufacturers_id=' . $manufacturers_id . '&max_rows=' . $_GET['max_rows']), 'product_id' => $product['products_id'], 'product_name' => $product['products_name'], 'product_model' => $product['products_model'], 'product_image' => xos_info_image('products/small/' . $product_image['name'], $product['products_name']), 'cross_products' => $cross_products_array));
    }
    $smarty->assign('form_end', '</form>');
    $smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'xsell');
    $output_xsell = $smarty->fetch(ADMIN_TPL . '/xsell.tpl');
    $smarty->assign('central_contents', $output_xsell);
    $smarty->display(ADMIN_TPL . '/frame.tpl');
    require DIR_WS_INCLUDES . 'application_bottom.php';
}