Exemple #1
0
                    for ($count=2, $n=$sizeof; $count<$n; $count++) {
                      $qty = $array_keys[$count];
                      $whats_new_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 {
            $whats_new_price = $currencies->display_price($products_prices[0][0]['regular'], $products_tax_rate);
            $products_prices[0]['special_status'] == 1 && $products_prices[0][0]['special'] > 0 ? $whats_new_price_special = $currencies->display_price($products_prices[0][0]['special'], $products_tax_rate) : ($whats_new_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];
                      $whats_new_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_product['products_name'] = xos_get_products_name($random_product['products_id']);
        $random_new_product_image = xos_get_product_images($random_product['products_image']);
        $smarty->assign(array('box_whats_new_link_filename_products_new' => xos_href_link(FILENAME_PRODUCTS_NEW), 'box_whats_new_link_filename_product_info' => xos_href_link(FILENAME_PRODUCT_INFO, 'p=' . $random_product['products_id']), 'box_whats_new_product_image' => xos_image(DIR_WS_IMAGES . 'products/small/' . rawurlencode($random_new_product_image['name']), $random_product['products_name']), 'box_whats_new_product_name' => $random_product['products_name'], 'box_whats_new_product_price' => $whats_new_price, 'box_whats_new_product_price_special' => $whats_new_price_special, 'box_whats_new_products_tax_description' => xos_get_products_tax_description($random_product['products_tax_class_id'], $products_tax_rate), 'box_whats_new_product_price_breaks' => $whats_new_price_breaks_array));
        $output_whats_new = $smarty->fetch(SELECTED_TPL . '/includes/boxes/whats_new.tpl');
        $smarty->assign('box_whats_new', $output_whats_new);
    }
}
Exemple #2
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);
        }
    }
}
        }
        $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');
}
if (!(@(include DIR_FS_SMARTY . 'admin/templates/' . ADMIN_TPL . '/php/includes/modules/product_preview.php') == 'overwrite_all')) {
    $product_query = xos_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_info, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int) $_GET['pID'] . "'");
    $product = xos_db_fetch_array($product_query);
    $pInfo = new objectInfo($product);
    $product_image = xos_get_product_images($pInfo->products_image);
    $products_prices = xos_get_product_prices($pInfo->products_price);
    $languages = xos_get_languages();
    $products_array = array();
    for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
        $pInfo->products_url = xos_get_products_url($pInfo->products_id, $languages[$i]['id']);
        if ($pInfo->products_date_available > date('Y-m-d')) {
            $date = sprintf(TEXT_PRODUCT_DATE_AVAILABLE, xos_date_long($pInfo->products_date_available));
        } else {
            $date = sprintf(TEXT_PRODUCT_DATE_ADDED, xos_date_long($pInfo->products_date_added));
        }
        $products_array[] = array('lang_image' => xos_image(DIR_WS_CATALOG_IMAGES . 'catalog/templates/' . DEFAULT_TPL . '/' . $languages[$i]['directory'] . '/' . $languages[$i]['image'], $languages[$i]['name']), 'name' => xos_get_products_name($pInfo->products_id, $languages[$i]['id']), 'price' => $currencies->format($products_prices[0][0]['regular']), 'image' => $product_image['name'] ? xos_image(DIR_WS_CATALOG_IMAGES . 'products/small/' . $product_image['name'], $pInfo->products_name, '', '', 'align="right" hspace="5" vspace="5"') : '', 'info' => xos_get_products_info($pInfo->products_id, $languages[$i]['id']), 'description' => xos_get_products_description($pInfo->products_id, $languages[$i]['id']), 'info_url' => $pInfo->products_url ? sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url) : '', 'date_available_or_date_added' => $date);
    }
    if (isset($_GET['origin'])) {
        $pos_params = strpos($_GET['origin'], '?', 0);
        if ($pos_params != false) {
            $back_url = substr($_GET['origin'], 0, $pos_params);
            $back_url_params = substr($_GET['origin'], $pos_params + 1);
        } else {
            $back_url = $_GET['origin'];
            $back_url_params = '';
        }
    } else {
        $back_url = FILENAME_CATEGORIES;
        $back_url_params = 'cPath=' . $cPath . '&pID=' . $pInfo->products_id;
    }
    $smarty->assign(array('products' => $products_array, 'link_back' => xos_href_link($back_url, $back_url_params)));
         if (xos_not_null($cInfo->last_modified)) {
             $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . xos_date_short($cInfo->last_modified));
         }
         $contents[] = array('text' => '<br />' . xos_info_image('categories/small/' . $cInfo->categories_image, $cInfo->categories_or_pages_name) . '<br />' . $cInfo->categories_image);
         $contents[] = array('text' => '<br />' . TEXT_SUBCATEGORIES . ' ' . $cInfo->children_count . '<br />' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
     } elseif (isset($pInfo) && is_object($pInfo)) {
         // product info box contents
         $category_path_string = '';
         $category_path = xos_generate_category_path($pInfo->products_id, 'product');
         for ($i = 0, $n = sizeof($category_path[0]); $i < $n; $i++) {
             $category_path_string .= $category_path[0][$i]['id'] . '_';
         }
         $category_path_string = substr($category_path_string, 0, -1);
         $product_image = xos_get_product_images($pInfo->products_image);
         $products_prices = xos_get_product_prices($pInfo->products_price);
         $heading_title = '<b>' . xos_get_products_name($pInfo->products_id, $_SESSION['used_lng_id']) . '</b>';
         $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_CATEGORIES, 'cPath=' . $category_path_string . '&pID=' . $pInfo->products_id . '&action=new_product') . '" 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_CATEGORIES, 'cPath=' . $category_path_string . '&pID=' . $pInfo->products_id . '&action=delete_product') . '" 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_CATEGORIES, 'cPath=' . $category_path_string . '&pID=' . $pInfo->products_id . '&action=move_product') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_MOVE . ' "><span>' . BUTTON_TEXT_MOVE . '</span></a><a href="' . xos_href_link(FILENAME_CATEGORIES, 'cPath=' . $category_path_string . '&pID=' . $pInfo->products_id . '&action=copy_to') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_COPY_TO . ' "><span>' . BUTTON_TEXT_COPY_TO . '</span></a><a href="' . xos_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'cPath=' . $category_path_string . '&pID=' . $pInfo->products_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_PRODUCTS_ATTRIBUTES . ' "><span>' . BUTTON_TEXT_PRODUCTS_ATTRIBUTES . '</span></a>');
         $contents[] = array('text' => '<br />' . TEXT_DATE_ADDED . ' ' . xos_date_short($pInfo->products_date_added));
         if (xos_not_null($pInfo->products_last_modified)) {
             $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . xos_date_short($pInfo->products_last_modified));
         }
         if (date('Y-m-d') < $pInfo->products_date_available) {
             $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . xos_date_short($pInfo->products_date_available));
         }
         $contents[] = array('text' => '<br />' . xos_info_image('products/small/' . $product_image['name'], $pInfo->products_name) . '<br />' . $product_image['name']);
         $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($products_prices[0][0]['regular']) . '<br />' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
         $contents[] = array('text' => '<br />' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
     }
 } else {
     $heading_title = '<b>' . EMPTY_CATEGORY . '</b>';
     $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
function xos_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $add_get_language = true, $add_get_currency = true, $add_get_tpl = true)
{
    global $session_started, $request_type, $cats, $mans, $cots, $lng, $lang_code;
    $add_parameter = false;
    if (!xos_not_null($page)) {
        die('<br /><br /><span style="color : #ff0000;"><b>Error!</b></span><br /><br /><b>Unable to determine the page link!</b><br /><br />');
    }
    if ($connection == 'REQUEST_TYPE') {
        $connection = $request_type;
    }
    if ($connection == 'NONSSL') {
        $link = HTTP_SERVER . DIR_WS_CATALOG;
    } elseif ($connection == 'SSL') {
        if (ENABLE_SSL == 'true') {
            $link = HTTPS_SERVER . DIR_WS_CATALOG;
        } else {
            $link = HTTP_SERVER . DIR_WS_CATALOG;
        }
    } else {
        die('<br /><br /><span style="color : #ff0000;"><b>Error!</b></span><br /><br /><b>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</b><br /><br />');
    }
    if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' && $search_engine_safe == true && xos_not_null($parameters)) {
        $parameters = str_replace(array('&amp;', '%2F', '%5C'), array('&', '_.~', '~._'), $parameters);
    }
    if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' && $search_engine_safe == true) {
        if (!isset($cats)) {
            $all_cat_query = xos_db_query("select c.categories_or_pages_id as id, cpd.categories_or_pages_name as name from " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_CATEGORIES_OR_PAGES_DATA . " cpd where c.categories_or_pages_id = cpd.categories_or_pages_id and cpd.language_id = '" . (int) $_SESSION['languages_id'] . "' and c.categories_or_pages_status = '1'");
            while ($cat = xos_db_fetch_array($all_cat_query)) {
                $cats[$cat['id']] = $cat['name'];
            }
        }
        if (!isset($mans)) {
            $all_man_query = xos_db_query("select manufacturers_id as id, manufacturers_name as name from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int) $_SESSION['languages_id'] . "'");
            while ($man = xos_db_fetch_array($all_man_query)) {
                $mans[$man['id']] = $man['name'];
            }
        }
        if (!isset($cots)) {
            $all_content_query = xos_db_query("select content_id as id, name from " . TABLE_CONTENTS_DATA . " where language_id = '" . (int) $_SESSION['languages_id'] . "'");
            while ($cot = xos_db_fetch_array($all_content_query)) {
                $cots[$cot['id']] = $cot['name'];
            }
        }
        parse_str($parameters, $param_array);
        $lng_code = '';
        // enable this lines if language code is needed
        // if (sizeof($lng->catalog_languages) > 1) {
        //   if (!empty($lang_code)) {
        //     $lng_code = $lang_code . '/';
        //   } else if (!empty($_SESSION['languages_code'])) {
        //     $lng_code = $_SESSION['languages_code'] . '/';
        //   }
        // }
        switch ($page) {
            case FILENAME_DEFAULT:
                if (array_key_exists('c', $param_array)) {
                    foreach (explode('_', $param_array['c']) as $value) {
                        $c_name_array[] = $cats[$value];
                    }
                    $name_str = implode('^', $c_name_array);
                } elseif (array_key_exists('m', $param_array)) {
                    $name_str = $mans[$param_array['m']];
                } else {
                    $name_str = HEADER_TITLE_HOME;
                }
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/a' : FILENAME_DEFAULT;
                break;
            case FILENAME_PRODUCT_INFO:
                if (array_key_exists('c', $param_array)) {
                    foreach (explode('_', $param_array['c']) as $value) {
                        $c_name_array[] = $cats[$value];
                    }
                    $name_str = implode('^', $c_name_array);
                } elseif (array_key_exists('p', $param_array)) {
                    if (array_key_exists('m', $param_array)) {
                        $name_str = $mans[$param_array['m']];
                    } else {
                        $c_id_str = xos_get_product_path($param_array['p']);
                        foreach (explode('_', $c_id_str) as $value) {
                            $c_name_array[] = $cats[$value];
                        }
                        $name_str = implode('^', $c_name_array);
                    }
                }
                $name_str = $name_str . '^' . htmlspecialchars_decode(xos_get_products_name($param_array['p']));
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/b' : FILENAME_PRODUCT_INFO;
                break;
            case FILENAME_CONTENT:
                if (array_key_exists('co', $param_array)) {
                    $name_str = $cots[$param_array['co']];
                }
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/c' : FILENAME_CONTENT;
                break;
            case FILENAME_SPECIALS:
                $name_str = SEF_URL_NAME_SPECIALS;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/d' : FILENAME_SPECIALS;
                break;
            case FILENAME_PRODUCTS_NEW:
                $name_str = SEF_URL_NAME_NEW_PRODUCTS;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/e' : FILENAME_PRODUCTS_NEW;
                break;
            case FILENAME_NEWSLETTER_SUBSCRIBE:
                $name_str = SEF_URL_NAME_SUBSCRIBE_NEWSLETTER;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/f' : FILENAME_NEWSLETTER_SUBSCRIBE;
                break;
            case FILENAME_REVIEWS:
                $name_str = SEF_URL_NAME_REVIEWS;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/g' : FILENAME_REVIEWS;
                break;
            case FILENAME_PRODUCT_REVIEWS:
                if (array_key_exists('m', $param_array)) {
                    $name_str = $mans[$param_array['m']];
                } else {
                    $c_id_str = xos_get_product_path($param_array['p']);
                    foreach (explode('_', $c_id_str) as $value) {
                        $c_name_array[] = $cats[$value];
                    }
                    $name_str = implode('^', $c_name_array);
                }
                $name_str = $name_str . '^' . htmlspecialchars_decode(xos_get_products_name($param_array['p'])) . '^' . SEF_URL_NAME_REVIEWS;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/h' : FILENAME_PRODUCT_REVIEWS;
                break;
            case FILENAME_PRODUCT_REVIEWS_INFO:
                if (array_key_exists('m', $param_array)) {
                    $name_str = $mans[$param_array['m']];
                } else {
                    $c_id_str = xos_get_product_path($param_array['p']);
                    foreach (explode('_', $c_id_str) as $value) {
                        $c_name_array[] = $cats[$value];
                    }
                    $name_str = implode('^', $c_name_array);
                }
                $name_str = $name_str . '^' . htmlspecialchars_decode(xos_get_products_name($param_array['p'])) . '^' . SEF_URL_NAME_REVIEWS;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/i' : FILENAME_PRODUCT_REVIEWS_INFO;
                break;
            case FILENAME_TELL_A_FRIEND:
                if (array_key_exists('m', $param_array)) {
                    $name_str = $mans[$param_array['m']];
                } else {
                    $c_id_str = xos_get_product_path($param_array['p']);
                    foreach (explode('_', $c_id_str) as $value) {
                        $c_name_array[] = $cats[$value];
                    }
                    $name_str = implode('^', $c_name_array);
                }
                $name_str = $name_str . '^' . htmlspecialchars_decode(xos_get_products_name($param_array['p'])) . '^' . SEF_URL_NAME_TELL_A_FRIEND;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/k' : FILENAME_TELL_A_FRIEND;
                break;
            case FILENAME_SHOPPING_CART:
                $name_str = SEF_URL_NAME_SHOPPING_CART;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/l' : FILENAME_SHOPPING_CART;
                break;
            case FILENAME_LOGIN:
                $name_str = SEF_URL_NAME_LOGIN;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/m' : FILENAME_LOGIN;
                break;
            case FILENAME_CREATE_ACCOUNT:
                $name_str = SEF_URL_NAME_CREATE_ACCOUNT;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/n' : FILENAME_CREATE_ACCOUNT;
                break;
            case FILENAME_PASSWORD_FORGOTTEN:
                $name_str = SEF_URL_NAME_PASSWORD_FORGOTTEN;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/o' : FILENAME_PASSWORD_FORGOTTEN;
                break;
            case FILENAME_ADVANCED_SEARCH_AND_RESULTS:
                $name_str = SEF_URL_NAME_ADVANCED_SEARCH_AND_RESULTS;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/p' : FILENAME_ADVANCED_SEARCH_AND_RESULTS;
                break;
            case FILENAME_SEARCH_RESULT:
                $name_str = SEF_URL_NAME_SEARCH_RESULT;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/q' : FILENAME_SEARCH_RESULT;
                break;
            case FILENAME_COOKIE_USAGE:
                $name_str = SEF_URL_NAME_COOKIE_USAGE;
                $page = ($trail_string = xos_sef_url_trail_converter($name_str)) ? $lng_code . $trail_string . '.html/r' : FILENAME_COOKIE_USAGE;
                break;
        }
    }
    if (xos_not_null($parameters)) {
        $link .= $page . '?' . xos_output_string($parameters);
        $add_parameter = true;
        $separator = '&';
    } else {
        $link .= $page;
        $separator = '?';
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    if (!$session_started && xos_not_null($_GET['cur']) && $add_get_currency == true) {
        $link .= $separator . xos_output_string('cur=' . $_GET['cur']);
        $add_parameter = true;
        $separator = '&';
    }
    if (!$session_started && xos_not_null($_GET['lnc']) && $add_get_language == true) {
        $link .= $separator . xos_output_string('lnc=' . $_GET['lnc']);
        $add_parameter = true;
        $separator = '&';
    }
    if (!$session_started && xos_not_null($_GET['tpl']) && $add_get_tpl == true) {
        $link .= $separator . xos_output_string('tpl=' . $_GET['tpl']);
        $add_parameter = true;
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SESSID is not empty
    if ($add_session_id == true && $session_started == true && SESSION_FORCE_COOKIE_USE == 'false') {
        if (SESSID) {
            $_sid = SESSID;
        } elseif (($request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == 'true' || $request_type == 'SSL' && $connection == 'NONSSL' && ENABLE_SSL == 'true') && HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
            $_sid = xos_session_name() . '=' . xos_session_id();
        }
    }
    if (isset($_sid)) {
        $add_parameter = true;
        $link .= $separator . xos_output_string($_sid);
    }
    if (SEARCH_ENGINE_FRIENDLY_URLS == 'true' && $search_engine_safe == true) {
        $link = str_replace(array('=%20', '&&', '=&', '/?', '?', '&', '='), array('=', '&', '/^/', '/', '/', '/', '/'), $link);
        if ($add_parameter) {
            $link = $link . '/';
        }
    } else {
        $link = str_replace(array('&amp;', '&'), array('&', '&amp;'), $link);
    }
    return $link;
}