Пример #1
0
     } else {
         $online = false;
         $offline = true;
     }
     $contents[] = array('text' => '<br>' . TEXT_CATEGORIES_STATUS . '<br>' . tep_draw_radio_field('categories_status', 1, $online) . ON . '<br>' . tep_draw_radio_field('categories_status', 0, $offline) . OFF);
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'edit_category':
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</b>');
     $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => TEXT_EDIT_INTRO);
     $category_inputs_string = '';
     $languages = tep_get_languages();
     //	echo "HIER".DIR_WS_CATALOG_IMAGES . $cInfo->categories_image. $cInfo->categories_name;
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $category_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
     }
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $category_short_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('short_description[' . $languages[$i]['id'] . ']', tep_get_category_short_description($cInfo->categories_id, $languages[$i]['id']));
     }
     $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
     $contents[] = array('text' => '<br>' . TEXT_EDIT_SHORT_DESCRIPTION . $category_short_inputs_string);
     $contents[] = array('text' => '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_name) . '<br>' . DIR_WS_CATALOG_IMAGES . '<br><b>' . $cInfo->categories_image . '</b>');
     $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_IMAGE . '<br>' . tep_draw_file_field('categories_image'));
     $contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
     if ($cInfo->categories_status == 1) {
         $online = true;
         $offline = false;
     } else {
         $online = false;
         $offline = true;
Пример #2
0
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $category_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']');
     }
     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_NAME . $category_inputs_string);
     $contents[] = array('text' => '<br />' . TEXT_CATEGORIES_IMAGE . '<br />' . tep_draw_file_field('categories_image'));
     $contents[] = array('text' => '<br />' . TEXT_SORT_ORDER . '<br />' . tep_draw_input_field('sort_order', '', 'size="2"'));
     $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath)));
     break;
 case 'edit_category':
     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</strong>');
     $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath, 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => TEXT_EDIT_INTRO);
     $category_inputs_string = '';
     $languages = tep_get_languages();
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $category_inputs_string .= '<br />' . tep_image(tep_catalog_href_link(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], '', 'SSL'), $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
     }
     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
     $contents[] = array('text' => '<br />' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $cInfo->categories_image, $cInfo->categories_name) . '<br />' . DIR_WS_CATALOG_IMAGES . '<br /><strong>' . $cInfo->categories_image . '</strong>');
     $contents[] = array('text' => '<br />' . TEXT_EDIT_CATEGORIES_IMAGE . '<br />' . tep_draw_file_field('categories_image'));
     $contents[] = array('text' => '<br />' . TEXT_EDIT_SORT_ORDER . '<br />' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
     $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id)));
     break;
 case 'delete_category':
     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_DELETE_CATEGORY . '</strong>');
     $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
     $contents[] = array('text' => '<br /><strong>' . $cInfo->categories_name . '</strong>');
     if ($cInfo->childs_count > 0) {
         $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
     }
Пример #3
0
require 'includes/application_top.php';
die;
tep_set_time_limit(6000);
$k = 0;
$products_query = tep_db_query("select products_id, categories_id from " . TABLE_TEMP_PRODUCTS_INFO . " where 1");
while ($products = tep_db_fetch_array($products_query)) {
    $products_id = $products['products_id'];
    $categories_id = $products['categories_id'];
    $category_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int) $products_id . "' and categories_id > '0' order by categories_id limit 1");
    $category = tep_db_fetch_array($category_query);
    if (!is_array($category)) {
        $category = array();
    }
    if ($category['categories_id'] != $categories_id && (int) $category['categories_id'] > 0) {
        tep_db_query("update " . TABLE_TEMP_PRODUCTS_INFO . " set categories_name = '" . tep_db_input(tep_get_category_name($category['categories_id'], $languages_id)) . "', categories_id = '" . (int) $category['categories_id'] . "' where products_id = '" . (int) $products_id . "'");
        $k++;
    }
}
echo 'updated: ' . $k . "\n";
die;
tep_set_time_limit(36000);
tep_db_query("delete from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '1' and products_name = ''");
$fields = array('products_name', 'products_description');
$products_query = tep_db_query("select products_id, products_name, products_description, products_model, authors_name, categories_name, manufacturers_name, series_name from " . TABLE_PRODUCTS_INFO . " where products_id not in (select products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where language_id = '1') order by rand()");
while ($products = tep_db_fetch_array($products_query)) {
    $products_id = $products['products_id'];
    $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $products_id . "' and language_id = '1'");
    $check = tep_db_fetch_array($check_query);
    if ($check['total'] == 0) {
        reset($fields);
Пример #4
0
function tep_cfg_show_multicategories($key_value = '')
{
    global $languages_id;
    $cat_str = '';
    if (tep_not_null($key_value)) {
        $value_array = explode(', ', $key_value);
        for ($i = 0, $x = sizeof($value_array); $i < $x; $i++) {
            $cat_str .= tep_get_category_name((int) $value_array[$i], $languages_id) . ', ';
        }
        $cat_str = substr($cat_str, 0, -2);
    }
    return $cat_str;
}
Пример #5
0
         $delivery_name = preg_replace('/\\s+/', ' ', trim($order->delivery['name']));
         //				$delivery_name = preg_replace('/([^\s]+)\s([^\s]+)\s?(.*)/', '$3 $1 $2', $delivery_name);
         list($fname, $mname, $lname) = explode(' ', $delivery_name);
         if ($lname == '') {
             $lname = $mname;
             $mname = '';
         }
         $delivery_name = preg_replace('/\\s+/', ' ', trim($lname . ' ' . $fname . ' ' . $mname));
         if ($product_info['type'] == '1') {
             $product_type_info_query = tep_db_query("select products_types_name from " . TABLE_PRODUCTS_TYPES . " where products_types_id = '" . (int) $product_info['type'] . "' and language_id = '" . (int) $languages_id . "'");
             $product_type_info = tep_db_fetch_array($product_type_info_query);
             $product_type_name = $product_type_info['products_types_name'];
         } else {
             $category_info_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int) $product_info['id'] . "' order by categories_id desc limit 1");
             $category_info = tep_db_fetch_array($category_info_query);
             $product_type_name = tep_get_category_name($category_info['categories_id'], $languages_id);
         }
         $order_csv_array = array($orders['orders_id'], tep_date_short($order->info['date_purchased']), $order->customer['id'], $delivery_name, $delivery_address, '', '&nbsp;' . (tep_not_null($order->delivery['telephone']) ? $order->delivery['telephone'] : $order->customer['telephone']) . '&nbsp;', $product_info['name'], $product_info['qty'] . '&nbsp;', $delivery_method, $order->delivery['city'], $comments, $order->info['payment_method'], '', '', '', $product_price, $product_price_discount, $original_price, $original_price_discount, $currency_value, $product_delivery_price, '', '', '', '', '', '', $product_type_name, $product_array['products_model'], $product_array['products_name'], $product_array['authors_name'], $product_array['manufacturers_name'], $product_array['series_name'], $product_array['products_year'], $product_array['products_covers_name'], $product_array['products_formats_name'], $product_array['products_pages_count'], str_replace('.', ',', $product_array['products_weight']), $order->customer['id'], $order->customer['email_address'], $order->delivery['street_address'], $order->delivery['city'], $order->delivery['suburb'], $order->delivery['state'], '&nbsp;' . $order->delivery['postcode'] . '&nbsp;');
     } else {
         $order_csv_array = array($orders['orders_id'], $order->delivery['name'], '&nbsp;' . (tep_not_null($order->delivery['telephone']) ? $order->delivery['telephone'] : $order->customer['telephone']) . '&nbsp;', $order->delivery['country'], '&nbsp;' . $order->delivery['postcode'] . '&nbsp;', $order->delivery['state'], $order->delivery['city'], $order->delivery['street_address'], $delivery_method, $delivery_price, $order->info['payment_method'], $status_info['orders_status_name'], $product_info['name'], $product_info['model'], $product_array['manufacturers_name'], $product_info['qty'] . '&nbsp;', $product_price, tep_round($product_info['final_price'], $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']), $order_total_price, $currencies->currencies[$order->info['currency']]['title'], tep_round(1 / $order->info['currency_value'], 4));
     }
     reset($order_csv_array);
     while (list($k, $order_csv) = each($order_csv_array)) {
         $order_csv_array[$k] = html_entity_decode($order_csv, ENT_QUOTES);
     }
     fputcsv($out, $order_csv_array, ';', '"');
 }
 //			if (DOMAIN_ZONE!='ua') {
 //			  $order_csv_array = array('');
 //			  fputcsv($out, $order_csv_array, ';');
 //			}
Пример #6
0
function tep_show_products_carousel($products_array, $carousel_id, $exclude_array = array(), $carousel_type = 'js', $show_category_name = false)
{
    global $languages_id, $currencies, $cart, $active_products_types_array;
    $customer_discount = $cart->get_customer_discount();
    if (!is_array($products_array)) {
        $products_array = explode(',', $products_array);
    }
    $products_array = array_map('tep_string_to_int', $products_array);
    ob_start();
    if (tep_not_null($exclude_array)) {
        if (!is_array($exclude_array)) {
            $exclude_array = explode(',', $exclude_array);
        }
        $exclude_array = array_map('tep_string_to_int', $exclude_array);
    }
    $ul_string = '';
    $ul_string_1 = '';
    $products_query = tep_db_query("select products_id, authors_id, products_price, products_purchase_cost, products_image, products_tax_class_id, products_listing_status, products_date_available, products_types_id, products_periodicity from " . TABLE_PRODUCTS . " where products_id in ('" . implode("', '", $products_array) . "') and products_status = '1' and products_types_id in ('" . implode("', '", $active_products_types_array) . "')" . (tep_not_null($exclude_array) ? " and products_id not in ('" . implode("', '", $exclude_array) . "')" : ""));
    $products_count = tep_db_num_rows($products_query);
    if ($products_count > 0) {
        if ($carousel_type != 'table') {
            ?>
  <script type="text/javascript" language="javascript"><!--
<?php 
        }
        $show_products_info = array();
        $counter = 0;
        $i = 0;
        while ($product_info = tep_db_fetch_array($products_query)) {
            $special_info_query = tep_db_query("select if((status and specials_new_products_price > 0), specials_new_products_price, null) as specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int) $product_info['products_id'] . "' and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "' and specials_new_products_price > 0 order by specials_date_added desc limit 1");
            $special_info = tep_db_fetch_array($special_info_query);
            if (!is_array($special_info)) {
                $special_info = array();
            }
            $product_description_info_query = tep_db_query("select products_name, manufacturers_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $product_info['products_id'] . "' and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "'");
            $product_description_info = tep_db_fetch_array($product_description_info_query);
            if (!is_array($product_description_info)) {
                $product_description_info = array();
            }
            $author_info_query = tep_db_query("select authors_name from authors where authors_id = '" . (int) $product_info['authors_id'] . "' and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "'");
            $author_info = tep_db_fetch_array($author_info_query);
            if (!is_array($author_info)) {
                $author_info = array();
            }
            $category_info = array('category' => '');
            if ($show_category_name) {
                $category_info_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int) $product_info['products_id'] . "' order by categories_id limit 1");
                $category_info_row = tep_db_fetch_array($category_info_query);
                $category_info['category'] = '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $category_info_row['categories_id']) . '">' . tep_get_category_name($category_info_row['categories_id'], DEFAULT_LANGUAGE_ID) . '</a>';
            }
            $product_info = array_merge($product_info, $special_info, $product_description_info, $author_info, $category_info);
            reset($product_info);
            while (list($k, $v) = each($product_info)) {
                while (strpos($v, "\\'") !== false) {
                    $v = str_replace("\\'", "'", $v);
                }
                while (strpos($v, '\\"') !== false) {
                    $v = str_replace('\\"', '"', $v);
                }
                $v = str_replace("'", '&#039;', $v);
                $show_products_info[$counter][$k] = $v;
            }
            $show_products_info[$counter]['products_url'] = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id']);
            $product_image_link = '';
            if (tep_not_null($product_info['products_image'])) {
                //		  $product_image_link = DIR_WS_IMAGES . 'thumbs/' . $product_info['products_image'];
                $product_image_link = 'http://149.126.96.163/thumbs/' . $product_info['products_image'];
            } else {
                $product_image_link = DIR_WS_TEMPLATES_IMAGES . 'nofoto.gif';
            }
            $show_products_info[$counter]['products_image'] = tep_image($product_image_link, $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
            if ($product_info['products_periodicity'] > '0') {
                $product_price = $currencies->display_price($product_info['products_price'] * $product_info['products_periodicity'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ' / ' . TEXT_SUBSCRIBE_TO_YEAR;
            } else {
                list($available_year, $available_month, $available_day) = explode('-', preg_replace('/^([^\\s]+)\\s/', '$1', $product_info['products_date_available']));
                if ($product_info['products_listing_status'] == '0') {
                    $available_soon_check_query = tep_db_query("select count(*) as total from " . TABLE_SPECIALS . " where products_id = '" . (int) $product_info['products_id'] . "' and specials_types_id = '4'");
                    $available_soon_check = tep_db_fetch_array($available_soon_check_query);
                    if ($product_info['products_date_available'] > date('Y-m-d')) {
                        $product_price = sprintf(TEXT_PRODUCT_NOT_AVAILABLE, $monthes_array[(int) $available_month] . ' ' . $available_year);
                    } elseif ($available_soon_check['total'] > 0) {
                        $product_price = TEXT_PRODUCT_NOT_AVAILABLE_2;
                    } else {
                        $product_price = TEXT_PRODUCT_NOT_AVAILABLE_SHORT;
                        $product_price = '';
                    }
                } else {
                    if ($product_info['specials_new_products_price'] > 0 && $product_info['specials_new_products_price'] < $product_info['products_price']) {
                        $product_price = '<div class="row_product_price_old" style="display: inline; font-weight: normal; padding-right: 5px;">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</div>' . $currencies->display_price($product_info['specials_new_products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '';
                    } elseif ($customer_discount['type'] == 'purchase' && $product_info['products_purchase_cost'] > 0) {
                        $product_price = $currencies->display_price($product_info['products_purchase_cost'] * (1 + $customer_discount['value'] / 100), tep_get_tax_rate($product_info['products_tax_class_id']));
                    } else {
                        $product_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
                    }
                    //			$product_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
                }
            }
            $show_products_info[$counter]['products_price'] = $product_price;
            $products_short_name = $product_info['products_name'];
            if (mb_strlen($products_short_name, 'CP1251') > 40) {
                $products_short_name = mb_substr($products_short_name, 0, 45, 'CP1251');
                $products_short_name_parts = explode(' ', $products_short_name);
                unset($products_short_name_parts[sizeof($products_short_name_parts) - 1]);
                $products_short_name = trim(implode(' ', $products_short_name_parts));
                $last_letter = mb_substr($products_short_name, -1, mb_strlen($products_short_name, 'CP1251'), 'CP1251');
                if (!in_array($last_letter, array(':', ',', '.', '!', '?', '(', ')', '-', '*', '/'))) {
                    $products_short_name .= ' ';
                    $last_letter = ' ';
                }
                if (in_array($last_letter, array(' ', ':', ',', '.', '!', '?', '(', ')', '-', '*', '/'))) {
                    $products_short_name = mb_substr($products_short_name, 0, -1, 'CP1251') . '...';
                }
            }
            $show_products_info[$counter]['products_short_name'] = $products_short_name;
            $show_products_info[$counter]['products_author'] = $show_products_info[$counter]['products_types_id'] == '1' ? '<a href="' . tep_href_link(FILENAME_AUTHORS, 'authors_id=' . $show_products_info[$counter]['authors_id']) . '">' . $show_products_info[$counter]['authors_name'] . '</a>' : '' . $show_products_info[$counter]['manufacturers_name'];
            $counter++;
        }
        $carousel_string = '';
        if ($carousel_type == 'table') {
            reset($show_products_info);
            while (list($counter, $product_info) = each($show_products_info)) {
                if ($counter > 0) {
                    $ul_string .= '    <td rowspan="2">' . tep_draw_separator('pixel_trans.gif', 11, 1) . '</td>' . "\n";
                }
                $ul_string .= '    <td valign="top" align="center" width="132" class="jcarousel-list">' . "\n" . '<div class="row_product_img"><a href="' . $product_info['products_url'] . '">' . $product_info['products_image'] . '</a></div>' . "\n" . (tep_not_null($product_info['category']) ? '		<div class="row_product_name">' . $product_info['category'] . ':</div>' . "\n" : '') . '		<div class="row_product_name"><a href="' . $product_info['products_url'] . '" title="' . $product_info['products_name'] . '">' . $product_info['products_short_name'] . '</a></div></td>' . "\n";
                $ul_string_1 .= '    <td valign="bottom" align="center" width="132" class="jcarousel-list"><div class="row_product_price">' . $product_info['products_price'] . '</div></td>' . "\n";
                if ($counter >= 3) {
                    break;
                }
            }
        } elseif ($carousel_type == 'html') {
            reset($show_products_info);
            while (list($counter, $product_info) = each($show_products_info)) {
                $ul_string .= '	  <li><div class="row_product_carousel">' . "\n" . '		<div class="row_product_img"><a href="' . $product_info['products_url'] . '">' . $product_info['products_image'] . '</a></div>' . "\n" . '		<div class="row_product_top">' . "\n" . (tep_not_null($product_info['category']) ? '		<div class="row_product_name">' . $product_info['category'] . ':</div>' . "\n" : '') . '		  <div class="row_product_name"><a href="' . $product_info['products_url'] . '" title="' . $product_info['products_name'] . '">' . $product_info['products_short_name'] . '</a></div>' . "\n" . '		  <div class="row_product_author">' . $product_info['products_author'] . '</div>' . "\n" . '		</div>' . "\n" . '		<div class="row_product_price">' . $product_info['products_price'] . '</div>' . "\n" . '	  </div></li>' . "\n";
            }
        } else {
            ?>
	var <?php 
            echo $carousel_id;
            ?>
_itemList = [
<?php 
            reset($show_products_info);
            while (list($counter, $product_info) = each($show_products_info)) {
                ?>
	  {url: '<?php 
                echo $product_info['products_url'];
                ?>
', category: '<?php 
                echo $product_info['category'];
                ?>
', image: '<?php 
                echo $product_info['products_image'];
                ?>
', title: '<?php 
                echo $product_info['products_name'];
                ?>
', short_title: '<?php 
                echo $product_info['products_short_name'];
                ?>
', author: '<?php 
                echo $product_info['products_author'];
                ?>
', price: '<?php 
                echo $product_info['products_price'];
                ?>
'}<?php 
                echo $counter < $products_count - 1 ? ',' : '';
                ?>

<?php 
            }
            ?>
	];

	function <?php 
            echo $carousel_id;
            ?>
_itemLoadCallback(carousel, state) {
	  for (var i = carousel.first; i <= carousel.last; i++) {
		if (carousel.has(i)) {
		  continue;
		}

		if (i > <?php 
            echo $carousel_id;
            ?>
_itemList.length) {
		  break;
		}
//		alert(<?php 
            echo $carousel_id;
            ?>
_itemList[i-1].url);

		carousel.add(i, <?php 
            echo $carousel_id;
            ?>
_getItemHTML(<?php 
            echo $carousel_id;
            ?>
_itemList[i-1]));
	  }
	};

	function <?php 
            echo $carousel_id;
            ?>
_getItemHTML(item) {
//	  return '<img src="' + item.url + '" width="75" height="75" alt="' + item.url + '" />';
	  return '' +
		'	  <li><div class="row_product_carousel">' + "\n" +
		'		<div class="row_product_img"><a href="' + item.url + '">' + item.image + '</a></div>' + "\n" +
		'		<div class="row_product_top">' + "\n" +
		(item.category ? '		<div class="row_product_name">' + item.category + ':</div>' + "\n" : '') +
		'		  <div class="row_product_name"><a href="' + item.url + '" title="' + item.title + '">' + item.short_title + '</a></div>' + "\n" +
		'		  <div class="row_product_author">' + item.author + '</div>' + "\n" +
		'		</div>' + "\n" +
		'		<div class="row_product_price">' + item.price + '</div>' + "\n" +
		'	  </div></li>' + "\n";
	};
<?php 
        }
        if ($carousel_type != 'table') {
            ?>

	jQuery(document).ready(function() {
	  jQuery('#<?php 
            echo $carousel_id;
            ?>
').jcarousel(<?php 
            if ($carousel_type != 'html') {
                ?>
{
		size: <?php 
                echo $carousel_id;
                ?>
_itemList.length,
		itemLoadCallback: {onBeforeAnimation: <?php 
                echo $carousel_id;
                ?>
_itemLoadCallback}
	  }<?php 
            }
            ?>
);
	});
  //--></script>
  <div id="<?php 
            echo 'c_' . $carousel_id;
            ?>
">
	<ul id="<?php 
            echo $carousel_id;
            ?>
" class="jcarousel-skin-tango"><?php 
            echo $ul_string;
            ?>
</ul>
  </div><br />
<?php 
            if ($products_count <= 4) {
                ?>
  <style type="text/css">
	<?php 
                echo '#c_' . $carousel_id;
                ?>
 .jcarousel-next-horizontal, <?php 
                echo '#c_' . $carousel_id;
                ?>
 .jcarousel-prev-horizontal {
	  background-image: none;
	  }
  </style>
<?php 
            }
        } else {
            ?>
<table border="0" cellspacing="0" cellpadding="0" style="padding-bottom: 1.4em;" class="jcarousel-list-table">
  <tr>
<?php 
            echo $ul_string;
            ?>
  </tr>
  <tr>
<?php 
            echo $ul_string_1;
            ?>
  </tr>
</table>
<?php 
        }
        $carousel_string = ob_get_clean();
    }
    return $carousel_string;
}
Пример #7
0
            $category_type_info_query = tep_db_query("select products_types_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int) $categories_id . "'");
            $category_type_info = tep_db_fetch_array($category_type_info_query);
            $products_types_id = $category_type_info['products_types_id'];
            $product_type_info_query = tep_db_query("select products_types_name from " . TABLE_PRODUCTS_TYPES . " where products_types_id = '" . (int) $products_types_id . "' and language_id = '1'");
            $product_type_info = tep_db_fetch_array($product_type_info_query);
            $products_types_name = $product_type_info['products_types_name'];
            $products_types_names[$products_types_id] = $products_types_name;
        } else {
            $products_types_name = $products_types_names[$products_types_id];
        }
        $metatags_page_title = $products_types_name . '.';
        $metatags_keywords = $products_types_name . '.';
        $metatags_description = $products_types_name . '.';
        reset($parent_categories);
        while (list($i, $parent_id) = each($parent_categories)) {
            $category_name = tep_get_category_name($parent_id, 1);
            if ($i < 3) {
                $metatags_page_title .= ' ' . $category_name . '.';
                $metatags_keywords .= ' ' . $category_name . '.';
            }
            $metatags_description .= ' ' . $category_name . '.';
        }
        $metatags_page_title .= ' Online store Setbook.';
        $metatags_title = $categories_name;
        $content_type = 'category';
        $content_id = $categories_id;
        tep_db_query("replace into " . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) values ('" . tep_db_input($metatags_page_title) . "', '" . tep_db_input($metatags_title) . "', '" . tep_db_input($metatags_keywords) . "', '" . tep_db_input($metatags_description) . "', '1', '" . tep_db_input($content_type) . "', '" . (int) $content_id . "')");
    }
}
$config_key = 'CONFIGURATION_LAST_UPDATE_CATEGORIES_DATE';
$config_title = 'Дата последнего обновления рубрикатора';
Пример #8
0
     $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_PATH . '<br>' . tep_catalog_href_link(FILENAME_CATEGORIES, 'cPath=' . $current_category_id) . tep_draw_input_field('categories_path', $cInfo->categories_path, 'size="7"') . '/');
     $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('categories_status', '1', $cInfo->categories_status) . TEXT_EDIT_CATEGORIES_STATUS);
     $contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size="2"'));
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $tPath . '&cPath=' . $cPath) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'edit_category':
     if (tep_not_null($HTTP_POST_VARS)) {
         $cInfo = new objectInfo($HTTP_POST_VARS);
     }
     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_EDIT_CATEGORY . '</strong>');
     $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, tep_get_all_get_params(array('action')) . 'action=update_category', 'post') . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => TEXT_EDIT_INTRO);
     $category_inputs_string = '';
     $languages = tep_get_languages();
     for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
         $category_inputs_string .= '<br>' . tep_image(DIR_WS_CATALOG_IMAGES . $languages[$i]['image'], $languages[$i]['name'], '', '', 'style="float: left; margin: 4px 4px 0px 0px;"') . tep_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
     }
     $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_NAME . $category_inputs_string);
     $contents[] = array('text' => '<br>' . TEXT_EDIT_CATEGORIES_PATH . '<br>' . tep_catalog_href_link(FILENAME_CATEGORIES, 'cPath=' . $current_category_id) . tep_draw_input_field('categories_path', $cInfo->categories_path, 'size="' . (tep_not_null($cInfo->categories_path) && strlen($cInfo->categories_path) - 1 > 0 ? strlen($cInfo->categories_path) - 1 : '7') . '"') . '/');
     $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('categories_status', '1', $cInfo->categories_status) . TEXT_EDIT_CATEGORIES_STATUS);
     $contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));
     $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $tPath . '&cPath=' . $cPath . '&cID=' . $cInfo->categories_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
 case 'delete_category':
     $heading[] = array('text' => '<strong>' . TEXT_INFO_HEADING_DELETE_CATEGORY . '</strong>');
     $contents = array('form' => tep_draw_form('categories', FILENAME_CATEGORIES, 'tPath=' . $tPath . '&action=delete_category_confirm&cPath=' . $cPath) . tep_draw_hidden_field('categories_id', $cInfo->categories_id));
     $contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
     $contents[] = array('text' => '<br><strong>' . $cInfo->categories_name . '</strong>');
     if ($cInfo->childs_count > 0) {
         $contents[] = array('text' => '<br>' . sprintf(TEXT_DELETE_WARNING_CHILDS, $cInfo->childs_count));
     }
Пример #9
0
     } elseif (sizeof($existing_files) > 0) {
         tep_db_query("update " . TABLE_TEMP_PRODUCTS . " set products_filename = null where products_id = '" . (int) $products_id . "'");
     }
     if (in_array($categories_id, array_keys($used_parents))) {
         $parent_categories = $used_parents[$categories_id];
     } else {
         $parent_categories = array($categories_id);
         tep_get_parents($parent_categories, $categories_id);
         $used_parents[$categories_id] = $parent_categories;
     }
     $product_type_info_query = tep_db_query("select products_types_id from " . TABLE_TEMP_PRODUCTS . " where products_id = '" . (int) $products_id . "'");
     $product_type_info = tep_db_fetch_array($product_type_info_query);
     $product_type_name_query = tep_db_query("select products_types_name from " . TABLE_PRODUCTS_TYPES . " where products_types_id = '" . (int) $products_types_id . "' and language_id = '" . (int) $languages_id . "'");
     $product_type_name_row = tep_db_fetch_array($product_type_name_query);
     $products_types_name = $product_type_name_row['products_types_name'];
     $categories_name = tep_get_category_name($parent_categories[sizeof($parent_categories) - 1], $languages_id);
     $metatags_page_title = (mb_strlen($authors_name, 'CP1251') > 2 ? $authors_name . ', ' : '') . $products_name . (substr($products_name, -1) != '.' ? '.' : '') . (tep_not_null($products_types_name) ? ' ' . $products_types_name . '.' : '') . ' »нтернет-магазин Setbook.';
     $metatags_title = $products_name;
     $metatags_keywords = (tep_not_null($products_types_name) ? $products_types_name . '. ' : '') . (mb_strlen($authors_name, 'CP1251') > 2 ? $authors_name . ', ' : '') . $products_name . (substr($products_name, -1) != '.' ? '. ' : ' ') . (tep_not_null($categories_name) ? $categories_name . '.' : '');
     $metatags_description = (tep_not_null($products_types_name) ? $products_types_name . '. ' : '') . (mb_strlen($authors_name, 'CP1251') > 2 ? $authors_name . ', ' : '') . $products_name . (substr($products_name, -1) != '.' ? '. ' : ' ') . (tep_not_null($products_description) ? preg_replace('/^([^\\.]+\\.).*$/', '$1', preg_replace('/\\s{2,}/', ' ', preg_replace('/<\\/?[^>]+>/', ' ', $products_description))) : '');
     $content_type = 'product';
     $content_id = $products_id;
     tep_db_query("replace into " . TABLE_METATAGS . " (metatags_page_title, metatags_title, metatags_keywords, metatags_description, language_id, content_type, content_id) values ('" . tep_db_input($metatags_page_title) . "', '" . tep_db_input($metatags_title) . "', '" . tep_db_input($metatags_keywords) . "', '" . tep_db_input($metatags_description) . "', '" . (int) $languages_id . "', '" . tep_db_input($content_type) . "', '" . (int) $content_id . "')");
     tep_db_query("replace into " . TABLE_TEMP_PRODUCTS_INFO . " (products_id, products_code, products_model, products_name, products_description, authors_name, products_types_id, products_types_name, categories_id, categories_name, manufacturers_name, series_name, products_year, products_weight, products_pages_count, products_copies, products_covers_name, products_formats_name, products_image, products_url, products_status, products_listing_status, products_last_modified) values ('" . (int) $products_id . "', '" . tep_db_input($products_code) . "', '" . tep_db_input(implode(', ', $models)) . "', '" . tep_db_input($products_name) . "', '" . tep_db_input($products_description) . "', '" . tep_db_input($authors_name) . "', '" . (int) $product_type_info['products_types_id'] . "', '" . tep_db_input($products_types_name) . "', '" . (int) $parent_categories[sizeof($parent_categories) - 1] . "', '" . tep_db_input($categories_name) . "', '" . tep_db_input($manufacturers_name) . "', '" . tep_db_input($series_name) . "', '" . tep_db_input($products_year) . "', '" . tep_db_input($products_weight) . "', '" . (int) $products_pages_count . "', '" . (int) $products_copies . "', '" . tep_db_input($products_cover) . "', '" . tep_db_input($products_format) . "', '" . tep_db_input($new_filename) . "', '" . tep_db_input(str_replace(HTTP_SERVER, '', tep_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id=' . $products_id))) . "', '" . (int) $status . "', '" . (int) $listing_status . "', now())");
     $total++;
 }
 // Ќовинка - 1
 // Ѕестселлер - 2
 // ћы рекомендуем - 3
 // —коро в продаже - 4
 // –аспродажа - 5
Пример #10
0
         $category_inputs_string .= '<br />' . $OSCOM_Language->getImage($languages[$i]['code']) . '&nbsp;' . HTML::inputField('categories_name[' . $languages[$i]['id'] . ']');
     }
     $contents[] = array('text' => OSCOM::getDef('text_categories_name') . $category_inputs_string);
     $contents[] = array('text' => OSCOM::getDef('text_categories_image') . '<br />' . HTML::fileField('categories_image'));
     $contents[] = array('text' => OSCOM::getDef('text_sort_order') . '<br />' . HTML::inputField('sort_order', '', 'size="2"'));
     $contents[] = array('text' => HTML::button(OSCOM::getDef('image_save'), 'fa fa-save', null, null, 'btn-success') . HTML::button(OSCOM::getDef('image_cancel'), null, OSCOM::link(FILENAME_CATEGORIES, 'cPath=' . $cPath), null, 'btn-link'));
     break;
 case 'edit_category':
     if (isset($cInfo)) {
         $heading[] = array('text' => OSCOM::getDef('text_info_heading_edit_category'));
         $contents = array('form' => HTML::form('categories', OSCOM::link(FILENAME_CATEGORIES, 'action=update_category&cPath=' . $cPath), 'post', 'enctype="multipart/form-data"') . HTML::hiddenField('categories_id', $cInfo->categories_id));
         $contents[] = array('text' => OSCOM::getDef('text_edit_intro'));
         $category_inputs_string = '';
         $languages = tep_get_languages();
         for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
             $category_inputs_string .= '<br />' . $OSCOM_Language->getImage($languages[$i]['code']) . '&nbsp;' . HTML::inputField('categories_name[' . $languages[$i]['id'] . ']', tep_get_category_name($cInfo->categories_id, $languages[$i]['id']));
         }
         $contents[] = array('text' => OSCOM::getDef('text_edit_categories_name') . $category_inputs_string);
         $contents[] = array('text' => HTML::image(OSCOM::linkImage('Shop/' . $cInfo->categories_image), $cInfo->categories_name) . '<br />' . OSCOM::getConfig('http_path', 'Shop') . OSCOM::getConfig('http_images_path', 'Shop') . '<br /><strong>' . $cInfo->categories_image . '</strong>');
         $contents[] = array('text' => OSCOM::getDef('text_edit_categories_image') . '<br />' . HTML::fileField('categories_image'));
         $contents[] = array('text' => OSCOM::getDef('text_edit_sort_order') . '<br />' . HTML::inputField('sort_order', $cInfo->sort_order, 'size="2"'));
         $contents[] = array('text' => HTML::button(OSCOM::getDef('image_save'), 'fa fa-save', null, null, 'btn-success') . HTML::button(OSCOM::getDef('image_cancel'), null, OSCOM::link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id), null, 'btn-link'));
     }
     break;
 case 'delete_category':
     if (isset($cInfo)) {
         $heading[] = array('text' => OSCOM::getDef('text_info_heading_delete_category'));
         $contents = array('form' => HTML::form('categories', OSCOM::link(FILENAME_CATEGORIES, 'action=delete_category_confirm&cPath=' . $cPath)) . HTML::hiddenField('categories_id', $cInfo->categories_id));
         $contents[] = array('text' => OSCOM::getDef('text_delete_category_intro'));
         $contents[] = array('text' => '<strong>' . $cInfo->categories_name . '</strong>');
         if ($cInfo->childs_count > 0) {