Jump to content

Snoopy10

Members
  • Content count

    15
  • Joined

  • Last visited

3 Followers

Profile Information

  • Real Name
    Bernhard Bauer

Recent Profile Visitors

4,391 profile views
  1. Snoopy10

    Contribution: Auto Backup Database

    Important update of Auto Backup Database (Updated) from spooks to make it compatible with Oscommerce 2.3.3.2. New features of the new version 4.3: Changed files: auto_backup_db.php, backup.php, admin/includes/functions/database.php Adaptation to Oscommerce Ver. 2.3.3.2 Made database requests compatible with php 5.5 and backwards compatible with older php versions. Note: This version can be installed only if Oscommerce 2.3.3.2 is installed. The update is attached. AutoBackupV4.3.zip Regards, Bernhard Bauer
  2. Snoopy10

    Cross Sell for 2.3.1 (X-Sell)

    If you haven't installed Protected Images, use the following code for the file /catalog/includes/modules/xsell_products.php <?php /* $Id: xsell_products.php, v1 2002/09/11 // adapted for Separate Pricing Per Customer v4 2005/02/24 osCommerce, Open Source E-Commerce Solutions <http://www.oscommerce.com> Copyright © 2002 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { // include currencies class and create an instance require_once(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); } if ($HTTP_GET_VARS['products_id']) { $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_XSELL); $num_products_xsell = tep_db_num_rows($xsell_query); if ($num_products_xsell > 0) { ?> <!-- xsell_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS); //new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { if (tep_not_null($xsell['specials_new_products_price'])) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&product_to_buy_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_draw_button( IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link( basename( $PHP_SELF ), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $xsell['products_id'])); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text) ; $col ++; if ($col > 2) { $col = 0; $row ++; } } //new contentBox($info_box_contents); ?> <div class="ui-widget infoBoxContainer"> <div class="ui-widget-header ui-corner-top infoBoxHeading"> <span><?php echo TEXT_XSELL_PRODUCTS; ?></span> </div> <?php new contentBoxStart($info_box_contents); ?> </div> <!-- xsell_products_eof //--> <?php } } ?> If you haven't installed Protected Images, use the following code for the file /catalog/admin/xsell.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License xsell.php Original Idea From Isaac Mualem im@imwebdesigning.com <mailto:im@imwebdesigning.com> Complete Recoding From Stephen Walker admin@@snjcomputers.com */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); require(DIR_WS_INCLUDES . 'template_top.php'); switch($_GET['action']){ case 'update_cross' : if ($_POST['product']){ foreach ($_POST['product'] as $temp_prod){ tep_db_query('delete from ' . TABLE_PRODUCTS_XSELL . ' where xsell_id = "'.$temp_prod.'" and products_id = "'.$_GET['add_related_product_ID'].'"'); tep_db_query('delete from ' . TABLE_PRODUCTS_XSELL . ' where xsell_id = "'.$_GET['add_related_product_ID'].'" and products_id = "'.$temp_prod.'"'); } } $sort_start_query = tep_db_query('select sort_order from ' . TABLE_PRODUCTS_XSELL . ' where products_id = "'.$_GET['add_related_product_ID'].'" order by sort_order desc limit 1'); $sort_start = tep_db_fetch_array($sort_start_query); $sort = (($sort_start['sort_order'] > 0) ? $sort_start['sort_order'] : '0'); if ($_POST['cross']){ foreach ($_POST['cross'] as $temp){ $sort++; $insert_array = array(); $insert_array = array('products_id' => $_GET['add_related_product_ID'], 'xsell_id' => $temp, 'sort_order' => $sort); tep_db_perform(TABLE_PRODUCTS_XSELL, $insert_array); } // foreach $temp } // if cross // insert reciprocable x-sell products BOF if ($_POST['reciprocal_link_cross']){ foreach ($_POST['reciprocal_link_cross'] as $temp2) { $sort_start_query2 = tep_db_query('select sort_order from ' . TABLE_PRODUCTS_XSELL . ' where products_id = "'.$temp2.'" order by sort_order desc limit 1'); $sort_start2 = tep_db_fetch_array($sort_start_query2); $sort2 = (($sort_start2['sort_order'] > 0) ? $sort_start2['sort_order'] : '0'); $sort2++; $insert_array = array(); $insert_array = array('products_id' => $temp2, 'xsell_id' => $_GET['add_related_product_ID'], 'sort_order' => $sort2); tep_db_perform(TABLE_PRODUCTS_XSELL, $insert_array); } // foreach $temp2 } // if reciprocal_link_cross // insert reciprocable x-sell products EOF $messageStack->add(CROSS_SELL_SUCCESS, 'success'); //Cache $cachedir = DIR_FS_CACHE_XSELL . $_GET['add_related_product_ID']; if(is_dir($cachedir)) { rdel($cachedir); } //Fin Cache break; case 'update_sort' : foreach ($_POST as $key_a => $value_a){ tep_db_query('update ' . TABLE_PRODUCTS_XSELL . ' set sort_order = "' . $value_a . '" where xsell_id = "' . $key_a . '"'); } $messageStack->add(SORT_CROSS_SELL_SUCCESS, 'success'); break; } ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> </table></td> <td width="100%" valign="top"> <!-- body_text //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> </tr> <tr> <td class="smallText" align="center"> <?php echo tep_draw_form('search', FILENAME_XSELL_PRODUCTS, '', 'get'). tep_draw_hidden_field('add_related_product_ID', $add_related_product_ID); echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); echo '</form>'; ?> </td> </tr> </table> <?php if ($_GET['add_related_product_ID'] == ''){ ?> <table border="0" cellspacing="1" cellpadding="2" bgcolor="#999999" align="center"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" width="75"><?php echo TABLE_HEADING_PRODUCT_ID;?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_MODEL;?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_IMAGE;?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCT_NAME;?></td> <td class="dataTableHeadingContent" nowrap><?php echo TABLE_HEADING_CURRENT_SELLS;?></td> <td class="dataTableHeadingContent" colspan="2" nowrap align="center"><?php echo TABLE_HEADING_UPDATE_SELLS;?></td> </tr> <?php if (isset($HTTP_GET_VARS['search'])) { $search = tep_db_prepare_input($HTTP_GET_VARS['search']); $products_query_raw = 'select p.products_id, p.products_model, p.products_price, p.products_tax_class_id, p.products_image, pd.products_name, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" and pd.products_name like "%' . tep_db_input($search) . '%" order by pd.products_name asc';}else{$products_query_raw = 'select p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by pd.products_name asc';} $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { ?> <tr onmouseover="cOn(this); this.style.cursor='pointer'; this.style.cursor='hand';" onmouseout="cOut(this);" bgcolor='#FFFFFF' onclick=document.location.href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>"> <td class="dataTableContent" valign="top"> <?php echo $products['products_id'];?> </td> <?php if ($products['products_model'] == NULL) { $products_model = TEXT_NONE; } else { $products_model = $products['products_model']; } ?> <td class="dataTableContent" valign="top"> <?php echo $products_model;?> </td> <td class="dataTableContent" align="center"> <?php echo tep_image(DIR_WS_CATALOG_IMAGES .$products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);?> </td> <td class="dataTableContent" valign="top"> <?php echo $products['products_name'];?> </td> <td class="dataTableContent" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php $products_cross_query = tep_db_query('select p.products_id, p.products_model, pd.products_name, p.products_id, x.products_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$products['products_id'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc'); $i=0; while ($products_cross = tep_db_fetch_array($products_cross_query)){ $i++; ?> <tr> <td class="dataTableContent"> <?php echo $i . '. <b>' . $products_cross['products_model'] . '</b> ' . $products_cross['products_name'];?> </td> </tr> <?php } if ($i <= 0){ ?> <tr> <td class="dataTableContent"> -- </td> </tr> <?php }else{ } ?> </table></td> <td class="dataTableContent" valign="top"> <a href="<?php echo tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'add_related_product_ID=' . $products['products_id'], 'NONSSL');?>"><?php echo TEXT_EDIT_SELLS;?></a> </td> <td class="dataTableContent" valign="top" align="center"> <?php echo (($i > 0) ? '<a href="' . tep_href_link(FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'sort=1&add_related_product_ID=' . $products['products_id'], 'NONSSL') .'">'.TEXT_SORT.'</a> ' : '--')?></td> </tr> <?php } ?> <tr> <td colspan="7"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table></td> </tr> </table> <?php }elseif($HTTP_GET_VARS['add_related_product_ID'] != '' && $HTTP_GET_VARS['sort'] == ''){ $products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image, p.products_price from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$HTTP_GET_VARS['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"'); $products_name = tep_db_fetch_array($products_name_query); ?> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999" align="center"> <tr> <td><?php echo tep_draw_form('update_cross', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_cross', 'post');?><table cellpadding="1" cellspacing="1" border="0"> <tr> <td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr class="dataTableHeadingRow"> <td valign="middle" align="left"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . '/'.$products_name['products_image'], "", SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);?></td> <?php if ($products_name['products_model'] == NULL) { $products_model = TEXT_NONE; } else { $products_model = $products_name['products_model']; } ?> <td valign="middle" align="left"><span class="main"><?php echo TEXT_SETTING_SELLS.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_model.') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td> <td valign="middle" align="center"><?php echo tep_image_submit('button_update.gif')?></td> <td valign="middle" align="center"><?php echo '<a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>'; ?></td> </tr> </table></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" width="75"> <?php echo TABLE_HEADING_PRODUCT_ID;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_MODEL;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_IMAGE;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_CROSS_SELL_THIS;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_NAME;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_PRICE;?> </td> </tr> <?php if (isset($HTTP_GET_VARS['search'])) { $search = tep_db_prepare_input($HTTP_GET_VARS['search']); $products_query_raw = 'select p.products_id, p.products_image, p.products_model, p.products_price, pd.products_name from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" and pd.products_name like "%' . tep_db_input($search) . '%" order by pd.products_name asc';}else{$products_query_raw = 'select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_price from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by pd.products_name asc';} $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $xsold_query = tep_db_query('select * from '.TABLE_PRODUCTS_XSELL.' where products_id = "'.$_GET['add_related_product_ID'].'" and xsell_id = "'.$products['products_id'].'"'); $xsold_query_reciprocal = tep_db_query('select * from '.TABLE_PRODUCTS_XSELL.' where products_id = "'.$products['products_id'].'" and xsell_id = "'.$_GET['add_related_product_ID'].'"'); ?> <tr bgcolor='#FFFFFF'> <td class="dataTableContent" align="center"> <?php echo $products['products_id'];?> </td> <?php if ($products['products_model'] == NULL) { $products_model = TEXT_NONE; } else { $products_model = $products['products_model']; } ?> <td class="dataTableContent" align="center"> <?php echo $products_model;?> </td> <td class="dataTableContent" align="center"> <?php echo tep_not_null($products['products_image']) ? tep_image(DIR_WS_CATALOG_IMAGES . '/' . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : TEXT_NONE; ?> </td> <td class="dataTableContent"> <?php echo tep_draw_hidden_field('product[]', $products['products_id']) . tep_draw_checkbox_field('cross[]', $products['products_id'], ((tep_db_num_rows($xsold_query) > 0) ? true : false), '', ' onmouseover="this.style.cursor=\'hand\'"');?> <label onmouseover="this.style.cursor='hand'"><?php echo TEXT_CROSS_SELL;?><br> <?php echo tep_draw_hidden_field('product[]', $products['products_id']) . tep_draw_checkbox_field('reciprocal_link_cross[]', $products['products_id'], ((tep_db_num_rows($xsold_query_reciprocal) > 0) ? true : false), '', ' onmouseover="this.style.cursor=\'hand\'"');?> <label onmouseover="this.style.cursor='hand'"><?php echo TEXT_RECIPROCAL_LINK;?></label> </td> <td class="dataTableContent"> <?php echo $products['products_name'];?> </td> <td class="dataTableContent"> <?php echo $currencies->format($products['products_price']);?> </td> </tr> <?php } ?> </table></form></td> </tr> <tr> <td colspan="6"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table></td> </tr> </table> <?php }elseif($HTTP_GET_VARS['add_related_product_ID'] != '' && $HTTP_GET_VARS['sort'] != ''){ $products_name_query = tep_db_query('select pd.products_name, p.products_model, p.products_image, p.products_price from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = "'.$HTTP_GET_VARS['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id ="'.(int)$languages_id.'"'); $products_name = tep_db_fetch_array($products_name_query); ?> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center"> <tr> <td><?php echo tep_draw_form('update_sort', FILENAME_XSELL_PRODUCTS, tep_get_all_get_params(array('action')) . 'action=update_sort', 'post');?> <table cellpadding="1" cellspacing="1" border="0"> <tr> <td colspan="6"><table cellpadding="3" cellspacing="0" border="0" width="100%"> <tr class="dataTableHeadingRow"> <td valign="middle" align="left"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . '/'.$products_name['products_image'], "", SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);?></td> <?php if ($products_name['products_model'] == NULL) { $products_model = TEXT_NONE; } else { $products_model = $products_name['products_model']; } ?> <td valign="middle" align="left"><span class="main"><?php echo TEXT_SETTING_SELLS.$products_name['products_name'].' ('.TEXT_MODEL.': '.$products_model.') ('.TEXT_PRODUCT_ID.': '.$_GET['add_related_product_ID'].')';?></span></td> <td valign="middle" align="center"><?php echo tep_image_submit('button_update.gif')?></td> <td valign="middle" align="center"><?php echo '<a href="'.tep_href_link(FILENAME_XSELL_PRODUCTS, 'men_id=catalog').'">' . tep_image_button('button_cancel.gif') . '</a>'; ?></td> </tr> </table></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_ID;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_MODEL;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_IMAGE;?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_PRODUCT_NAME;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_PRICE;?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT_SORT;?> </td> </tr> <?php $products_query_raw = 'select p.products_id as products_id, p.products_price, p.products_image, p.products_model, pd.products_name, x.products_id as xproducts_id, x.xsell_id, x.sort_order, x.ID from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRODUCTS_XSELL.' x where x.xsell_id = p.products_id and x.products_id = "'.$HTTP_GET_VARS['add_related_product_ID'].'" and p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by x.sort_order asc'; $products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $sort_order_drop_array = array(); for($i=1;$i<=$products_query_numrows;$i++){ $sort_order_drop_array[] = array('id' => $i, 'text' => $i); } $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)){ ?> <tr bgcolor='#DFE4F4'> <td class="dataTableContent" align="center"> <?php echo $products['products_id'];?> </td> <?php if ($products['products_model'] == NULL) { $products_model = TEXT_NONE; } else { $products_model = $products['products_model']; } ?> <td class="dataTableContent" align="center"> <?php echo $products_model;?> </td> <td class="dataTableContent" align="center"> <?php echo tep_not_null($products['products_image']) ? tep_image(DIR_WS_CATALOG_IMAGES . '/' . $products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) : TEXT_NONE; ?> </td> <td class="dataTableContent" align="center"> <?php echo $products['products_name'];?> </td> <td class="dataTableContent" align="center"> <?php echo $currencies->format($products['products_price']);?> </td> <td class="dataTableContent" align="center"> <?php echo tep_draw_pull_down_menu($products['products_id'], $sort_order_drop_array, $products['sort_order']);?> </td> </tr> <?php } ?> </table></form></td> </tr> <tr> <td colspan="7"> <table border="0" width="100%" cellspacing="0" cellpadding="2" class="infoBoxContent"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table> </td> </tr> </table> <?php } ?> <!-- body_text_eof //--> </td> </tr> </table> <!-- body_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  3. Snoopy10

    Cross Sell for 2.3.1 (X-Sell)

    If you haven't installed Protected Images, use the following code for the file /catalog/includes/modules/xsell_products.php <?php /* $Id: xsell_products.php, v1 2002/09/11 // adapted for Separate Pricing Per Customer v4 2005/02/24 osCommerce, Open Source E-Commerce Solutions <http://www.oscommerce.com> Copyright © 2002 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { // include currencies class and create an instance require_once(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); } if ($HTTP_GET_VARS['products_id']) { $xsell_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_tax_class_id, products_price, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price from " . TABLE_PRODUCTS_XSELL . " xp left join " . TABLE_PRODUCTS . " p on xp.xsell_id = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where xp.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' order by sort_order asc limit " . MAX_DISPLAY_XSELL); $num_products_xsell = tep_db_num_rows($xsell_query); if ($num_products_xsell > 0) { ?> <!-- xsell_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => TEXT_XSELL_PRODUCTS); //new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($xsell = tep_db_fetch_array($xsell_query)) { if (tep_not_null($xsell['specials_new_products_price'])) { $xsell_price = '<s>' . $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</s><br>'; $xsell_price .= '<span class="productSpecialPrice">' . $currencies->display_price($xsell['specials_new_products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])) . '</span>'; } else { $xsell_price = $currencies->display_price($xsell['products_price'], tep_get_tax_rate($xsell['products_tax_class_id'])); } $text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $xsell['products_image'], $xsell['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $xsell['products_id']) . '">' . $xsell['products_name'] .'</a><br>' . $xsell_price. '<br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&product_to_buy_id=' . $xsell['products_id'], 'NONSSL') . '">' . tep_draw_button( IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link( basename( $PHP_SELF ), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $xsell['products_id'])); $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"', 'text' => $text) ; $col ++; if ($col > 2) { $col = 0; $row ++; } } //new contentBox($info_box_contents); ?> <div class="ui-widget infoBoxContainer"> <div class="ui-widget-header ui-corner-top infoBoxHeading"> <span><?php echo TEXT_XSELL_PRODUCTS; ?></span> </div> <?php new contentBoxStart($info_box_contents); ?> </div> <!-- xsell_products_eof //--> <?php } } ?>
  4. Snoopy10

    Cross Sell for 2.3.1 (X-Sell)

    p.image_folder and p.image_display are other columns in the products table. When you install the addon protected images, then you need these. Otherwise, take out the columns again and adjust the path to images again. Compare the previous version.
  5. Snoopy10

    NEW! Complete Order Editing Tool!

    The discount-code module ot_discount from http://addons.oscommerce.com/info/7700/v,23 is also skipped after recalculation. What can I do?
  6. Snoopy10

    NEW! Complete Order Editing Tool!

    Hi, I have installed order_editor_for2.3_v1.0 on my oscommerce 2.3.3 webshop. Further I'm using following modules: ot_disocunt ot_codfee ot_loworderfee I think due to this, the order total and taxes are calculated wrong, when I've modified the order. Mainly the ot_codfee is skipped after the calculation. Can someone give me some hints, how can I add this modules to calculate the correct price. (I think ot_loworderfee should work) Best wishes Bernhard Bauer
  7. Hi, I did a modification on admin/products_attributes.php. Now, one can see the sorting in the admin area and modification in the admin-area is possible. Best wishes, Bernhard Bauer products_attributes.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $languages = tep_get_languages(); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); $option_page = (isset($HTTP_GET_VARS['option_page']) && is_numeric($HTTP_GET_VARS['option_page'])) ? $HTTP_GET_VARS['option_page'] : 1; $value_page = (isset($HTTP_GET_VARS['value_page']) && is_numeric($HTTP_GET_VARS['value_page'])) ? $HTTP_GET_VARS['value_page'] : 1; $attribute_page = (isset($HTTP_GET_VARS['attribute_page']) && is_numeric($HTTP_GET_VARS['attribute_page'])) ? $HTTP_GET_VARS['attribute_page'] : 1; $page_info = 'option_page=' . $option_page . '&value_page=' . $value_page . '&attribute_page=' . $attribute_page; if (tep_not_null($action)) { switch ($action) { case 'add_product_options': $products_options_id = tep_db_prepare_input($HTTP_POST_VARS['products_options_id']); $option_name_array = $HTTP_POST_VARS['option_name']; for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "')"); } tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'add_product_option_values': $value_name_array = $HTTP_POST_VARS['value_name']; $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']); $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']); for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]); tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$value_id . "', '" . (int)$languages[$i]['id'] . "', '" . tep_db_input($value_name) . "')"); } tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int)$option_id . "', '" . (int)$value_id . "')"); tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'add_product_attributes': $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']); $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']); $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']); $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']); $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . (int)$sort_order . "')"); //tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . (int)$attributes_sort . "')"); if (DOWNLOAD_ENABLED == 'true') { $products_attributes_id = tep_db_insert_id(); $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']); $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']); $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']); if (tep_not_null($products_attributes_filename)) { tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "')"); } } tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'update_option_name': $option_name_array = $HTTP_POST_VARS['option_name']; $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']); for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . tep_db_input($option_name) . "' where products_options_id = '" . (int)$option_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'"); } tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'update_value': $value_name_array = $HTTP_POST_VARS['value_name']; $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']); $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']); for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]); tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . tep_db_input($value_name) . "' where products_options_values_id = '" . tep_db_input($value_id) . "' and language_id = '" . (int)$languages[$i]['id'] . "'"); } tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " set products_options_id = '" . (int)$option_id . "' where products_options_values_id = '" . (int)$value_id . "'"); tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'update_product_attribute': $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']); $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']); $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']); $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']); $sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']); $attribute_id = tep_db_prepare_input($HTTP_POST_VARS['attribute_id']); tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . (float)tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix). "', products_options_sort_order = '" . tep_db_input($sort_order) . "' where products_attributes_id = '" . (int)$attribute_id . "'"); if (DOWNLOAD_ENABLED == 'true') { $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']); $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']); $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']); if (tep_not_null($products_attributes_filename)) { tep_db_query("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . tep_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . tep_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . tep_db_input($products_attributes_maxcount) . "'"); } } tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'delete_option': $option_id = tep_db_prepare_input($HTTP_GET_VARS['option_id']); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "'"); tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'delete_value': $value_id = tep_db_prepare_input($HTTP_GET_VARS['value_id']); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . (int)$value_id . "'"); tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; case 'delete_attribute': $attribute_id = tep_db_prepare_input($HTTP_GET_VARS['attribute_id']); tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . (int)$attribute_id . "'"); // added for DOWNLOAD_ENABLED. Always try to remove attributes, even if downloads are no longer enabled tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . (int)$attribute_id . "'"); tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info)); break; } } require(DIR_WS_INCLUDES . 'template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <!-- options and values//--> <tr> <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <!-- options //--> <?php if ($action == 'delete_product_option') { // delete product option $options = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$HTTP_GET_VARS['option_id'] . "' and language_id = '" . (int)$languages_id . "'"); $options_values = tep_db_fetch_array($options); ?> <tr> <td class="pageHeading"> <?php echo $options_values['products_options_name']; ?> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php $products = tep_db_query("select p.products_id, pd.products_name, pov.products_options_values_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pov.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_id='" . (int)$HTTP_GET_VARS['option_id'] . "' and pov.products_options_values_id = pa.options_values_id order by pd.products_name"); if (tep_db_num_rows($products)) { ?> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td> </tr> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php $rows = 0; while ($products_values = tep_db_fetch_array($products)) { $rows++; ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td> <td class="smallText"> <?php echo $products_values['products_name']; ?> </td> <td class="smallText"> <?php echo $products_values['products_options_values_name']; ?> </td> </tr> <?php } ?> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <tr> <td colspan="3" class="main"><br /><?php echo TEXT_WARNING_OF_DELETE; ?></td> </tr> <tr> <td align="right" colspan="3" class="smallText"><br /><?php echo tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> </tr> <?php } else { ?> <tr> <td class="main" colspan="3"><br /><?php echo TEXT_OK_TO_DELETE; ?></td> </tr> <tr> <td class="smallText" align="right" colspan="3"><br /><?php echo tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option&option_id=' . $HTTP_GET_VARS['option_id'] . '&' . $page_info, 'NONSSL'), 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> </tr> <?php } ?> </table></td> </tr> <?php } else { ?> <tr> <td colspan="3" class="pageHeading"> <?php echo HEADING_TITLE_OPT; ?> </td> </tr> <tr> <td colspan="3" class="smallText" align="right"> <?php $options = "select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_id"; $options_split = new splitPageResults($option_page, MAX_ROW_LISTS_OPTIONS, $options, $options_query_numrows); echo $options_split->display_links($options_query_numrows, MAX_ROW_LISTS_OPTIONS, MAX_DISPLAY_PAGE_LINKS, $option_page, 'value_page=' . $value_page . '&attribute_page=' . $attribute_page, 'option_page'); ?> </td> </tr> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php $next_id = 1; $rows = 0; $options = tep_db_query($options); while ($options_values = tep_db_fetch_array($options)) { $rows++; ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php if (($action == 'update_option') && ($HTTP_GET_VARS['option_id'] == $options_values['products_options_id'])) { echo '<form name="option" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_name&' . $page_info, 'NONSSL') . '" method="post">'; $inputs = ''; for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { $option_name = tep_db_query("select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'"); $option_name = tep_db_fetch_array($option_name); $inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="20" value="' . $option_name['products_options_name'] . '"> <br />'; } ?> <td align="center" class="smallText"> <?php echo $options_values['products_options_id']; ?><input type="hidden" name="option_id" value="<?php echo $options_values['products_options_id']; ?>"> </td> <td class="smallText"><?php echo $inputs; ?></td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> <?php echo '</form>' . "\n"; } else { ?> <td align="center" class="smallText"> <?php echo $options_values["products_options_id"]; ?> </td> <td class="smallText"> <?php echo $options_values["products_options_name"]; ?> </td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option&option_id=' . $options_values['products_options_id'] . '&' . $page_info, 'NONSSL')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_option&option_id=' . $options_values['products_options_id'] . '&' . $page_info, 'NONSSL')); ?> </td> <?php } ?> </tr> <?php $max_options_id_query = tep_db_query("select max(products_options_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS); $max_options_id_values = tep_db_fetch_array($max_options_id_query); $next_id = $max_options_id_values['next_id']; } ?> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php if ($action != 'update_option') { ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php echo '<form name="options" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_options&' . $page_info, 'NONSSL') . '" method="post"><input type="hidden" name="products_options_id" value="' . $next_id . '">'; $inputs = ''; for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { $inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="20"> <br />'; } ?> <td align="center" class="smallText"> <?php echo $next_id; ?> </td> <td class="smallText"><?php echo $inputs; ?></td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_INSERT, 'plus'); ?> </td> <?php echo '</form>'; ?> </tr> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php } } ?> </table></td> <!-- options eof //--> <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <!-- value //--> <?php if ($action == 'delete_option_value') { // delete product option value $values = tep_db_query("select products_options_values_id, products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$HTTP_GET_VARS['value_id'] . "' and language_id = '" . (int)$languages_id . "'"); $values_values = tep_db_fetch_array($values); ?> <tr> <td colspan="3" class="pageHeading"> <?php echo $values_values['products_options_values_name']; ?> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php $products = tep_db_query("select p.products_id, pd.products_name, po.products_options_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and po.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_values_id='" . (int)$HTTP_GET_VARS['value_id'] . "' and po.products_options_id = pa.options_id order by pd.products_name"); if (tep_db_num_rows($products)) { ?> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td> </tr> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <?php while ($products_values = tep_db_fetch_array($products)) { $rows++; ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td> <td class="smallText"> <?php echo $products_values['products_name']; ?> </td> <td class="smallText"> <?php echo $products_values['products_options_name']; ?> </td> </tr> <?php } ?> <tr> <td colspan="3"><?php echo tep_black_line(); ?></td> </tr> <tr> <td class="main" colspan="3"><br /><?php echo TEXT_WARNING_OF_DELETE; ?></td> </tr> <tr> <td class="smallText" align="right" colspan="3"><br /><?php echo tep_draw_button(IMAGE_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> </tr> <?php } else { ?> <tr> <td class="main" colspan="3"><br /><?php echo TEXT_OK_TO_DELETE; ?></td> </tr> <tr> <td class="smallText" align="right" colspan="3"><br /><?php echo tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_value&value_id=' . $HTTP_GET_VARS['value_id'] . '&' . $page_info, 'NONSSL'), 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> </tr> <?php } ?> </table></td> </tr> <?php } else { ?> <tr> <td colspan="4" class="pageHeading"> <?php echo HEADING_TITLE_VAL; ?> </td> </tr> <tr> <td colspan="4" class="smallText" align="right"> <?php $values = "select pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po on pov.products_options_values_id = pov2po.products_options_values_id where pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_id"; $values_split = new splitPageResults($value_page, MAX_ROW_LISTS_OPTIONS, $values, $values_query_numrows); echo $values_split->display_links($values_query_numrows, MAX_ROW_LISTS_OPTIONS, MAX_DISPLAY_PAGE_LINKS, $value_page, 'option_page=' . $option_page . '&attribute_page=' . $attribute_page, 'value_page'); ?> </td> </tr> <tr> <td colspan="4"><?php echo tep_black_line(); ?></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <tr> <td colspan="4"><?php echo tep_black_line(); ?></td> </tr> <?php $next_id = 1; $rows = 0; $values = tep_db_query($values); while ($values_values = tep_db_fetch_array($values)) { $options_name = tep_options_name($values_values['products_options_id']); $values_name = $values_values['products_options_values_name']; $rows++; ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php if (($action == 'update_option_value') && ($HTTP_GET_VARS['value_id'] == $values_values['products_options_values_id'])) { echo '<form name="values" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_value&' . $page_info, 'NONSSL') . '" method="post">'; $inputs = ''; for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { $value_name = tep_db_query("select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$values_values['products_options_values_id'] . "' and language_id = '" . (int)$languages[$i]['id'] . "'"); $value_name = tep_db_fetch_array($value_name); $inputs .= $languages[$i]['code'] . ': <input type="text" name="value_name[' . $languages[$i]['id'] . ']" size="15" value="' . $value_name['products_options_values_name'] . '"> <br />'; } ?> <td align="center" class="smallText"> <?php echo $values_values['products_options_values_id']; ?><input type="hidden" name="value_id" value="<?php echo $values_values['products_options_values_id']; ?>"> </td> <td align="center" class="smallText"> <?php echo "\n"; ?><select name="option_id"> <?php $options = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by products_options_name"); while ($options_values = tep_db_fetch_array($options)) { echo "\n" . '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '"'; if ($values_values['products_options_id'] == $options_values['products_options_id']) { echo ' selected'; } echo '>' . $options_values['products_options_name'] . '</option>'; } ?> </select> </td> <td class="smallText"><?php echo $inputs; ?></td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> <?php echo '</form>'; } else { ?> <td align="center" class="smallText"> <?php echo $values_values["products_options_values_id"]; ?> </td> <td align="center" class="smallText"> <?php echo $options_name; ?> </td> <td class="smallText"> <?php echo $values_name; ?> </td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_value&value_id=' . $values_values['products_options_values_id'] . '&' . $page_info, 'NONSSL')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option_value&value_id=' . $values_values['products_options_values_id'] . '&' . $page_info, 'NONSSL')); ?> </td> <?php } $max_values_id_query = tep_db_query("select max(products_options_values_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS_VALUES); $max_values_id_values = tep_db_fetch_array($max_values_id_query); $next_id = $max_values_id_values['next_id']; } ?> </tr> <tr> <td colspan="4"><?php echo tep_black_line(); ?></td> </tr> <?php if ($action != 'update_option_value') { ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php echo '<form name="values" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_option_values&' . $page_info, 'NONSSL') . '" method="post">'; ?> <td align="center" class="smallText"> <?php echo $next_id; ?> </td> <td align="center" class="smallText"> <select name="option_id"> <?php $options = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name"); while ($options_values = tep_db_fetch_array($options)) { echo '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>'; } $inputs = ''; for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) { $inputs .= $languages[$i]['code'] . ': <input type="text" name="value_name[' . $languages[$i]['id'] . ']" size="15"> <br />'; } ?> </select> </td> <td class="smallText"><input type="hidden" name="value_id" value="<?php echo $next_id; ?>"><?php echo $inputs; ?></td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_INSERT, 'plus'); ?> </td> <?php echo '</form>'; ?> </tr> <tr> <td colspan="4"><?php echo tep_black_line(); ?></td> </tr> <?php } } ?> </table></td> </tr> </table></td> <!-- option value eof //--> </tr> <!-- products_attributes //--> <tr> <td class="smallText"> </td> </tr> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"> <?php echo HEADING_TITLE_ATRIB; ?> </td> </tr> </table></td> </tr> <tr> <?php if ($action == 'update_attribute') { $form_action = 'update_product_attribute'; } else { $form_action = 'add_product_attributes'; } ?> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" align="right"> <?php $attributes = "select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pa.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name"; $attributes_split = new splitPageResults($attribute_page, MAX_ROW_LISTS_OPTIONS, $attributes, $attributes_query_numrows); echo $attributes_split->display_links($attributes_query_numrows, MAX_ROW_LISTS_OPTIONS, MAX_DISPLAY_PAGE_LINKS, $attribute_page, 'option_page=' . $option_page . '&value_page=' . $value_page, 'attribute_page'); ?> </td> </tr> </table> <form name="attributes" action="<?php echo tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=' . $form_action . '&' . $page_info); ?>" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td colspan="8"><?php echo tep_black_line(); ?></td> </tr> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td> <td class="dataTableHeadingContent" align="right"> <?php echo TABLE_HEADING_OPT_PRICE; ?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_OPT_PRICE_PREFIX; ?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_OPT_SORT; ?> </td> <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <tr> <td colspan="8"><?php echo tep_black_line(); ?></td> </tr> <?php $next_id = 1; $attributes = tep_db_query($attributes); while ($attributes_values = tep_db_fetch_array($attributes)) { $products_name_only = tep_get_products_name($attributes_values['products_id']); $options_name = tep_options_name($attributes_values['options_id']); $values_name = tep_values_name($attributes_values['options_values_id']); $rows++; ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php if (($action == 'update_attribute') && ($HTTP_GET_VARS['attribute_id'] == $attributes_values['products_attributes_id'])) { ?> <td class="smallText"> <?php echo $attributes_values['products_attributes_id']; ?><input type="hidden" name="attribute_id" value="<?php echo $attributes_values['products_attributes_id']; ?>"> </td> <td class="smallText"> <select name="products_id"> <?php $products = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by pd.products_name"); while($products_values = tep_db_fetch_array($products)) { if ($attributes_values['products_id'] == $products_values['products_id']) { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '" SELECTED>' . $products_values['products_name'] . '</option>'; } else { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>'; } } ?> </select> </td> <td class="smallText"> <select name="options_id"> <?php $options = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name"); while($options_values = tep_db_fetch_array($options)) { if ($attributes_values['options_id'] == $options_values['products_options_id']) { echo "\n" . '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '" SELECTED>' . $options_values['products_options_name'] . '</option>'; } else { echo "\n" . '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>'; } } ?> </select> </td> <td class="smallText"> <select name="values_id"> <?php $values = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id ='" . $languages_id . "' order by products_options_values_name"); while($values_values = tep_db_fetch_array($values)) { if ($attributes_values['options_values_id'] == $values_values['products_options_values_id']) { echo "\n" . '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '" SELECTED>' . $values_values['products_options_values_name'] . '</option>'; } else { echo "\n" . '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '">' . $values_values['products_options_values_name'] . '</option>'; } } ?> </select> </td> <td align="right" class="smallText"> <input type="text" name="value_price" value="<?php echo $attributes_values['options_values_price']; ?>" size="6"> </td> <td align="center" class="smallText"> <input type="text" name="price_prefix" value="<?php echo $attributes_values['price_prefix']; ?>" size="2"> </td> <td align="center" class="smallText"> <input type="text" name="sort_order" value="<?php echo $attributes_values['products_options_sort_order']; ?>" size="2"> </td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> <?php if (DOWNLOAD_ENABLED == 'true') { $download_query_raw ="select products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id='" . $attributes_values['products_attributes_id'] . "'"; $download_query = tep_db_query($download_query_raw); if (tep_db_num_rows($download_query) > 0) { $download = tep_db_fetch_array($download_query); $products_attributes_filename = $download['products_attributes_filename']; $products_attributes_maxdays = $download['products_attributes_maxdays']; $products_attributes_maxcount = $download['products_attributes_maxcount']; } ?> <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>"> <td> </td> <td colspan="5"> <table> <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_DOWNLOAD; ?> </td> <td class="smallText"><?php echo TABLE_TEXT_FILENAME; ?></td> <td class="smallText"><?php echo tep_draw_input_field('products_attributes_filename', $products_attributes_filename, 'size="15"'); ?> </td> <td class="smallText"><?php echo TABLE_TEXT_MAX_DAYS; ?></td> <td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?> </td> <td class="smallText"><?php echo TABLE_TEXT_MAX_COUNT; ?></td> <td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?> </td> </tr> </table> </td> <td> </td> </tr> <?php } ?> <?php } elseif (($action == 'delete_product_attribute') && ($HTTP_GET_VARS['attribute_id'] == $attributes_values['products_attributes_id'])) { ?> <td class="smallText"> <strong><?php echo $attributes_values["products_attributes_id"]; ?></strong> </td> <td class="smallText"> <strong><?php echo $products_name_only; ?></strong> </td> <td class="smallText"> <strong><?php echo $options_name; ?></strong> </td> <td class="smallText"> <strong><?php echo $values_name; ?></strong> </td> <td align="right" class="smallText"> <strong><?php echo $attributes_values["options_values_price"]; ?></strong> </td> <td align="center" class="smallText"> <strong><?php echo $attributes_values["price_prefix"]; ?></strong> </td> <td align="center" class="smallText"> <strong><?php echo $attributes_values["products_options_sort_order"]; ?></strong> </td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_attribute&attribute_id=' . $HTTP_GET_VARS['attribute_id'] . '&' . $page_info), 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info, 'NONSSL')); ?> </td> <?php } else { ?> <td class="smallText"> <?php echo $attributes_values["products_attributes_id"]; ?> </td> <td class="smallText"> <?php echo $products_name_only; ?> </td> <td class="smallText"> <?php echo $options_name; ?> </td> <td class="smallText"> <?php echo $values_name; ?> </td> <td align="right" class="smallText"> <?php echo $attributes_values["options_values_price"]; ?> </td> <td align="center" class="smallText"> <?php echo $attributes_values["price_prefix"]; ?> </td> <td align="center" class="smallText"> <?php echo $attributes_values["products_options_sort_order"]; ?> </td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_attribute&attribute_id=' . $attributes_values['products_attributes_id'] . '&' . $page_info, 'NONSSL')); ?> </td> <?php } $max_attributes_id_query = tep_db_query("select max(products_attributes_id) + 1 as next_id from " . TABLE_PRODUCTS_ATTRIBUTES); $max_attributes_id_values = tep_db_fetch_array($max_attributes_id_query); $next_id = $max_attributes_id_values['next_id']; ?> </tr> <?php } if ($action != 'update_attribute') { ?> <tr> <td colspan="8"><?php echo tep_black_line(); ?></td> </tr> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <td class="smallText"> <?php echo $next_id; ?> </td> <td class="smallText"> <select name="products_id"> <?php $products = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by pd.products_name"); while ($products_values = tep_db_fetch_array($products)) { echo '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>'; } ?> </select> </td> <td class="smallText"> <select name="options_id"> <?php $options = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name"); while ($options_values = tep_db_fetch_array($options)) { echo '<option name="' . $options_values['products_options_name'] . '" value="' . $options_values['products_options_id'] . '">' . $options_values['products_options_name'] . '</option>'; } ?> </select> </td> <td class="smallText"> <select name="values_id"> <?php $values = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id = '" . $languages_id . "' order by products_options_values_name"); while ($values_values = tep_db_fetch_array($values)) { echo '<option name="' . $values_values['products_options_values_name'] . '" value="' . $values_values['products_options_values_id'] . '">' . $values_values['products_options_values_name'] . '</option>'; } ?> </select> </td> <td align="right" class="smallText"> <input type="text" name="value_price" size="6"> </td> <td align="right" class="smallText"> <input type="text" name="price_prefix" size="2" value="+"> </td> <td align="right" class="smallText"> <input type="text" name="sort_order" size="2" value="1"> </td> <td align="center" class="smallText"> <?php echo tep_draw_button(IMAGE_INSERT, 'plus'); ?> </td> </tr> <?php if (DOWNLOAD_ENABLED == 'true') { $products_attributes_maxdays = DOWNLOAD_MAX_DAYS; $products_attributes_maxcount = DOWNLOAD_MAX_COUNT; ?> <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>"> <td> </td> <td colspan="5"> <table> <tr class="<?php echo (!($rows % 2)? 'attributes-even' : 'attributes-odd');?>"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_DOWNLOAD; ?> </td> <td class="smallText"><?php echo TABLE_TEXT_FILENAME; ?></td> <td class="smallText"><?php echo tep_draw_input_field('products_attributes_filename', $products_attributes_filename, 'size="15"'); ?> </td> <td class="smallText"><?php echo TABLE_TEXT_MAX_DAYS; ?></td> <td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?> </td> <td class="smallText"><?php echo TABLE_TEXT_MAX_COUNT; ?></td> <td class="smallText"><?php echo tep_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?> </td> </tr> </table> </td> <td> </td> </tr> <?php } // end of DOWNLOAD_ENABLED section ?> <?php } ?> <tr> <td colspan="8"><?php echo tep_black_line(); ?></td> </tr> </table></form></td> </tr> </table> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
×