Execute("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $_SESSION['languages_id'] . "' limit 1"); if ($chk_option_names->RecordCount() < 1) { $messageStack->add_session(ERROR_DEFINE_OPTION_NAMES, 'caution'); zen_redirect(zen_href_link(FILENAME_OPTIONS_NAME_MANAGER)); } $chk_option_values = $db->Execute("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where language_id='" . $_SESSION['languages_id'] . "' limit 1"); if ($chk_option_values->RecordCount() < 1) { $messageStack->add_session(ERROR_DEFINE_OPTION_VALUES, 'caution'); zen_redirect(zen_href_link(FILENAME_OPTIONS_VALUES_MANAGER)); } $chk_products = $db->Execute("select * from " . TABLE_PRODUCTS . " limit 1"); if ($chk_products->RecordCount() < 1) { $messageStack->add_session(ERROR_DEFINE_PRODUCTS, 'caution'); zen_redirect(zen_href_link(FILENAME_CATEGORIES)); } require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $languages = zen_get_languages(); $action = (isset($_GET['action']) ? $_GET['action'] : ''); $products_filter = (isset($_GET['products_filter']) ? $_GET['products_filter'] : $products_filter); $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id); if ($action == 'new_cat') { $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id); $new_product_query = $db->Execute("select ptc.* from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ptc.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' where ptc.categories_id='" . $current_category_id . "' order by pd.products_name"); $products_filter = $new_product_query->fields['products_id']; zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id)); } // set categories and products if not set if ($products_filter == '' and $current_category_id != '') { $new_product_query = $db->Execute("select ptc.* from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ptc.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' where ptc.categories_id='" . $current_category_id . "' order by pd.products_name"); $products_filter = $new_product_query->fields['products_id']; if ($products_filter != '') { zen_redirect(zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, 'products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id)); } } else { if ($products_filter == '' and $current_category_id == '') { $reset_categories_id = zen_get_category_tree('', '', '0', '', '', true); $current_category_id = $reset_categories_id[0]['id']; $new_product_query = $db->Execute("select ptc.* from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ptc.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' where ptc.categories_id='" . $current_category_id . "' order by pd.products_name"); $products_filter = $new_product_query->fields['products_id']; $_GET['products_filter'] = $products_filter; } } require(DIR_WS_MODULES . FILENAME_PREV_NEXT); if (zen_not_null($action)) { $_SESSION['page_info'] = ''; if (isset($_GET['option_page'])) $_SESSION['page_info'] .= 'option_page=' . $_GET['option_page'] . '&'; if (isset($_GET['value_page'])) $_SESSION['page_info'] .= 'value_page=' . $_GET['value_page'] . '&'; if (isset($_GET['attribute_page'])) $_SESSION['page_info'] .= 'attribute_page=' . $_GET['attribute_page'] . '&'; if (isset($_GET['products_filter'])) $_SESSION['page_info'] .= 'products_filter=' . $_GET['products_filter'] . '&'; if (isset($_GET['current_category_id'])) $_SESSION['page_info'] .= 'current_category_id=' . $_GET['current_category_id'] . '&'; if (zen_not_null($_SESSION['page_info'])) { $_SESSION['page_info'] = substr($_SESSION['page_info'], 0, -1); } switch ($action) { ///////////////////////////////////////// //// BOF OF FLAGS case 'set_flag_attributes_display_only': $action=''; $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_display_only from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); if ($new_flag->fields['attributes_display_only'] == '0') { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_display_only='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } else { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_display_only='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'set_flag_product_attribute_is_free': $action=''; $new_flag= $db->Execute("select products_attributes_id, products_id, product_attribute_is_free from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); if ($new_flag->fields['product_attribute_is_free'] == '0') { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set product_attribute_is_free='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } else { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set product_attribute_is_free='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'set_flag_attributes_default': $action=''; $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_default from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); if ($new_flag->fields['attributes_default'] == '0') { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_default='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } else { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_default='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'set_flag_attributes_discounted': $action=''; $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_discounted from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); if ($new_flag->fields['attributes_discounted'] == '0') { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_discounted='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } else { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_discounted='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } // reset products_price_sorter for searches etc. zen_update_products_price_sorter($_GET['products_filter']); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'set_flag_attributes_price_base_included': $action=''; $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_price_base_included from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); if ($new_flag->fields['attributes_price_base_included'] == '0') { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_price_base_included='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } else { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_price_base_included='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } // reset products_price_sorter for searches etc. zen_update_products_price_sorter($_GET['products_filter']); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'set_flag_attributes_required': $action=''; $new_flag= $db->Execute("select products_attributes_id, products_id, attributes_required from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); if ($new_flag->fields['attributes_required'] == '0') { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_required='1' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } else { $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_required='0' where products_id='" . $_GET['products_filter'] . "' and products_attributes_id='" . $_GET['attributes_id'] . "'"); } zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; //// EOF OF FLAGS ///////////////////////////////////////// case 'set_products_filter': $_GET['products_filter'] = $_POST['products_filter']; $action=''; zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $_GET['products_filter'] . '¤t_category_id=' . $_POST['current_category_id'])); break; // update by product case ('update_product'): if (!zen_has_product_attributes($products_filter, 'false')) { $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT_NONE . $products_filter . ' ' . zen_get_products_name($products_filter, $_SESSION['languages_id']), 'error'); } else { $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT . $products_filter . ' ' . zen_get_products_name($products_filter, $_SESSION['languages_id']), 'success'); zen_update_attributes_products_option_values_sort_order($products_filter); } $action=''; zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '¤t_category_id=' . $_GET['current_category_id'])); break; case 'add_product_attributes': // check for duplicate and block them $check_duplicate = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id ='" . $_POST['products_id'] . "' and options_id = '" . $_POST['options_id'] . "' and options_values_id = '" . $_POST['values_id'] . "'"); if ($check_duplicate->RecordCount() > 0) { // do not add duplicates give a warning $messageStack->add_session(ATTRIBUTE_WARNING_DUPLICATE . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id']), 'error'); } else { // Validate options_id and options_value_id if (!zen_validate_options_to_options_value($_POST['options_id'], $_POST['values_id'])) { // do not add invalid match $messageStack->add_session(ATTRIBUTE_WARNING_INVALID_MATCH . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id']), 'error'); } else { // iii 030811 added: For TEXT and FILE option types, ignore option value // entered by administrator and use PRODUCTS_OPTIONS_VALUES_TEXT instead. $products_options_array = $db->Execute("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'"); $values_id = zen_db_prepare_input((($products_options_array->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT) or ($products_options_array->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE)) ? PRODUCTS_OPTIONS_VALUES_TEXT_ID : $_POST['values_id']); $products_id = zen_db_prepare_input($_POST['products_id']); $options_id = zen_db_prepare_input($_POST['options_id']); // $values_id = zen_db_prepare_input($_POST['values_id']); $value_price = zen_db_prepare_input($_POST['value_price']); $price_prefix = zen_db_prepare_input($_POST['price_prefix']); $products_options_sort_order = zen_db_prepare_input($_POST['products_options_sort_order']); $product_attribute_is_free = zen_db_prepare_input($_POST['product_attribute_is_free']); $products_attributes_weight = zen_db_prepare_input($_POST['products_attributes_weight']); $products_attributes_weight_prefix = zen_db_prepare_input($_POST['products_attributes_weight_prefix']); $attributes_display_only = zen_db_prepare_input($_POST['attributes_display_only']); $attributes_default = zen_db_prepare_input($_POST['attributes_default']); $attributes_discounted = zen_db_prepare_input($_POST['attributes_discounted']); $attributes_price_base_included = zen_db_prepare_input($_POST['attributes_price_base_included']); $attributes_price_onetime = zen_db_prepare_input($_POST['attributes_price_onetime']); $attributes_price_factor = zen_db_prepare_input($_POST['attributes_price_factor']); $attributes_price_factor_offset = zen_db_prepare_input($_POST['attributes_price_factor_offset']); $attributes_price_factor_onetime = zen_db_prepare_input($_POST['attributes_price_factor_onetime']); $attributes_price_factor_onetime_offset = zen_db_prepare_input($_POST['attributes_price_factor_onetime_offset']); $attributes_qty_prices = zen_db_prepare_input($_POST['attributes_qty_prices']); $attributes_qty_prices_onetime = zen_db_prepare_input($_POST['attributes_qty_prices_onetime']); $attributes_price_words = zen_db_prepare_input($_POST['attributes_price_words']); $attributes_price_words_free = zen_db_prepare_input($_POST['attributes_price_words_free']); $attributes_price_letters = zen_db_prepare_input($_POST['attributes_price_letters']); $attributes_price_letters_free = zen_db_prepare_input($_POST['attributes_price_letters_free']); $attributes_required = zen_db_prepare_input($_POST['attributes_required']); // add - update as record exists // attributes images // when set to none remove from database if (isset($_POST['attributes_image']) && zen_not_null($_POST['attributes_image']) && ($_POST['attributes_image'] != 'none')) { $attributes_image = zen_db_prepare_input($_POST['attributes_image']); } else { $attributes_image = ''; } $attributes_image = new upload('attributes_image'); $attributes_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']); if ($attributes_image->parse() && $attributes_image->save($_POST['overwrite'])) { $attributes_image_name = $_POST['img_dir'] . $attributes_image->filename; } else { $attributes_image_name = (isset($_POST['attributes_previous_image']) ? $_POST['attributes_previous_image'] : ''); } $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)zen_db_input($value_price) . "', '" . zen_db_input($price_prefix) . "', '" . (int)zen_db_input($products_options_sort_order) . "', '" . (int)zen_db_input($product_attribute_is_free) . "', '" . (float)zen_db_input($products_attributes_weight) . "', '" . zen_db_input($products_attributes_weight_prefix) . "', '" . (int)zen_db_input($attributes_display_only) . "', '" . (int)zen_db_input($attributes_default) . "', '" . (int)zen_db_input($attributes_discounted) . "', '" . zen_db_input($attributes_image_name) . "', '" . (int)zen_db_input($attributes_price_base_included) . "', '" . (float)zen_db_input($attributes_price_onetime) . "', '" . (float)zen_db_input($attributes_price_factor) . "', '" . (float)zen_db_input($attributes_price_factor_offset) . "', '" . (float)zen_db_input($attributes_price_factor_onetime) . "', '" . (float)zen_db_input($attributes_price_factor_onetime_offset) . "', '" . zen_db_input($attributes_qty_prices) . "', '" . zen_db_input($attributes_qty_prices_onetime) . "', '" . (float)zen_db_input($attributes_price_words) . "', '" . (int)zen_db_input($attributes_price_words_free) . "', '" . (float)zen_db_input($attributes_price_letters) . "', '" . (int)zen_db_input($attributes_price_letters_free) . "', '" . (int)zen_db_input($attributes_required) . "')"); if (DOWNLOAD_ENABLED == 'true') { $products_attributes_id = $db->Insert_ID(); $products_attributes_filename = zen_db_prepare_input($_POST['products_attributes_filename']); $products_attributes_maxdays = (int)zen_db_prepare_input($_POST['products_attributes_maxdays']); $products_attributes_maxcount = (int)zen_db_prepare_input($_POST['products_attributes_maxcount']); //die( 'I am adding ' . strlen($_POST['products_attributes_filename']) . ' vs ' . strlen(trim($_POST['products_attributes_filename'])) . ' vs ' . strlen(zen_db_prepare_input($_POST['products_attributes_filename'])) . ' vs ' . strlen(zen_db_input($products_attributes_filename)) ); if (zen_not_null($products_attributes_filename)) { $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " (products_attributes_id, products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount) values (" . (int)$products_attributes_id . ", '" . zen_db_input($products_attributes_filename) . "', '" . zen_db_input($products_attributes_maxdays) . "', '" . zen_db_input($products_attributes_maxcount) . "')"); } } } } // reset products_price_sorter for searches etc. zen_update_products_price_sorter($_POST['products_id']); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '&products_filter=' . $_POST['products_id'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'update_product_attribute': $check_duplicate = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id ='" . $_POST['products_id'] . "' and options_id = '" . $_POST['options_id'] . "' and options_values_id = '" . $_POST['values_id'] . "' and products_attributes_id != '" . $_POST['attribute_id'] . "'"); if ($check_duplicate->RecordCount() > 0) { // do not add duplicates give a warning $messageStack->add_session(ATTRIBUTE_WARNING_DUPLICATE_UPDATE . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id']), 'error'); } else { // Validate options_id and options_value_id if (!zen_validate_options_to_options_value($_POST['options_id'], $_POST['values_id'])) { // do not add invalid match $messageStack->add_session(ATTRIBUTE_WARNING_INVALID_MATCH_UPDATE . ' - ' . zen_options_name($_POST['options_id']) . ' : ' . zen_values_name($_POST['values_id']), 'error'); } else { // add the new attribute // iii 030811 added: Enforce rule that TEXT and FILE Options use value PRODUCTS_OPTIONS_VALUES_TEXT_ID $products_options_query = $db->Execute("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'"); switch ($products_options_array->fields['products_options_type']) { case PRODUCTS_OPTIONS_TYPE_TEXT: case PRODUCTS_OPTIONS_TYPE_FILE: $values_id = PRODUCTS_OPTIONS_VALUES_TEXT_ID; break; default: $values_id = zen_db_prepare_input($_POST['values_id']); } // iii 030811 added END $products_id = zen_db_prepare_input($_POST['products_id']); $options_id = zen_db_prepare_input($_POST['options_id']); // $values_id = zen_db_prepare_input($_POST['values_id']); $value_price = zen_db_prepare_input($_POST['value_price']); $price_prefix = zen_db_prepare_input($_POST['price_prefix']); $products_options_sort_order = zen_db_prepare_input($_POST['products_options_sort_order']); $product_attribute_is_free = zen_db_prepare_input($_POST['product_attribute_is_free']); $products_attributes_weight = zen_db_prepare_input($_POST['products_attributes_weight']); $products_attributes_weight_prefix = zen_db_prepare_input($_POST['products_attributes_weight_prefix']); $attributes_display_only = zen_db_prepare_input($_POST['attributes_display_only']); $attributes_default = zen_db_prepare_input($_POST['attributes_default']); $attributes_discounted = zen_db_prepare_input($_POST['attributes_discounted']); $attributes_price_base_included = zen_db_prepare_input($_POST['attributes_price_base_included']); $attributes_price_onetime = zen_db_prepare_input($_POST['attributes_price_onetime']); $attributes_price_factor = zen_db_prepare_input($_POST['attributes_price_factor']); $attributes_price_factor_offset = zen_db_prepare_input($_POST['attributes_price_factor_offset']); $attributes_price_factor_onetime = zen_db_prepare_input($_POST['attributes_price_factor_onetime']); $attributes_price_factor_onetime_offset = zen_db_prepare_input($_POST['attributes_price_factor_onetime_offset']); $attributes_qty_prices = zen_db_prepare_input($_POST['attributes_qty_prices']); $attributes_qty_prices_onetime = zen_db_prepare_input($_POST['attributes_qty_prices_onetime']); $attributes_price_words = zen_db_prepare_input($_POST['attributes_price_words']); $attributes_price_words_free = zen_db_prepare_input($_POST['attributes_price_words_free']); $attributes_price_letters = zen_db_prepare_input($_POST['attributes_price_letters']); $attributes_price_letters_free = zen_db_prepare_input($_POST['attributes_price_letters_free']); $attributes_required = zen_db_prepare_input($_POST['attributes_required']); $attribute_id = zen_db_prepare_input($_POST['attribute_id']); // edit // attributes images // when set to none remove from database if (isset($_POST['attributes_image']) && zen_not_null($_POST['attributes_image']) && ($_POST['attributes_image'] != 'none')) { $attributes_image = zen_db_prepare_input($_POST['attributes_image']); $attributes_image_none = false; } else { $attributes_image = ''; $attributes_image_none = true; } $attributes_image = new upload('attributes_image'); $attributes_image->set_destination(DIR_FS_CATALOG_IMAGES . $_POST['img_dir']); if ($attributes_image->parse() && $attributes_image->save($_POST['overwrite'])) { $attributes_image_name = ($attributes_image->filename != 'none' ? ($_POST['img_dir'] . $attributes_image->filename) : ''); } else { $attributes_image_name = ((isset($_POST['attributes_previous_image']) and $_POST['attributes_image'] != 'none') ? $_POST['attributes_previous_image'] : ''); } if ($_POST['image_delete'] == 1) { $attributes_image_name = ''; } // turned off until working $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set attributes_image = '" . $attributes_image_name . "' where products_attributes_id = '" . (int)$attribute_id . "'"); $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . zen_db_input($value_price) . "', price_prefix = '" . zen_db_input($price_prefix) . "', products_options_sort_order = '" . zen_db_input($products_options_sort_order) . "', product_attribute_is_free = '" . zen_db_input($product_attribute_is_free) . "', products_attributes_weight = '" . zen_db_input($products_attributes_weight) . "', products_attributes_weight_prefix = '" . zen_db_input($products_attributes_weight_prefix) . "', attributes_display_only = '" . zen_db_input($attributes_display_only) . "', attributes_default = '" . zen_db_input($attributes_default) . "', attributes_discounted = '" . zen_db_input($attributes_discounted) . "', attributes_price_base_included = '" . zen_db_input($attributes_price_base_included) . "', attributes_price_onetime = '" . zen_db_input($attributes_price_onetime) . "', attributes_price_factor = '" . zen_db_input($attributes_price_factor) . "', attributes_price_factor_offset = '" . zen_db_input($attributes_price_factor_offset) . "', attributes_price_factor_onetime = '" . zen_db_input($attributes_price_factor_onetime) . "', attributes_price_factor_onetime_offset = '" . zen_db_input($attributes_price_factor_onetime_offset) . "', attributes_qty_prices = '" . zen_db_input($attributes_qty_prices) . "', attributes_qty_prices_onetime = '" . zen_db_input($attributes_qty_prices_onetime) . "', attributes_price_words = '" . zen_db_input($attributes_price_words) . "', attributes_price_words_free = '" . zen_db_input($attributes_price_words_free) . "', attributes_price_letters = '" . zen_db_input($attributes_price_letters) . "', attributes_price_letters_free = '" . zen_db_input($attributes_price_letters_free) . "', attributes_required = '" . zen_db_input($attributes_required) . "' where products_attributes_id = '" . (int)$attribute_id . "'"); if (DOWNLOAD_ENABLED == 'true') { $products_attributes_filename = zen_db_prepare_input($_POST['products_attributes_filename']); $products_attributes_maxdays = zen_db_prepare_input($_POST['products_attributes_maxdays']); $products_attributes_maxcount = zen_db_prepare_input($_POST['products_attributes_maxcount']); if (zen_not_null($products_attributes_filename)) { $db->Execute("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . zen_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . zen_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . zen_db_input($products_attributes_maxcount) . "'"); } } } } // reset products_price_sorter for searches etc. zen_update_products_price_sorter($_POST['products_id']); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'delete_attribute': // demo active test if (zen_admin_demo()) { $_GET['action']= ''; $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution'); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '¤t_category_id=' . $_POST['current_category_id'])); } $attribute_id = zen_db_prepare_input($_GET['attribute_id']); $db->Execute("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 $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . (int)$attribute_id . "'"); // reset products_price_sorter for searches etc. zen_update_products_price_sorter($products_filter); // zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'])); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, $_SESSION['page_info'] . '¤t_category_id=' . $current_category_id)); break; // delete all attributes case 'delete_all_attributes': zen_delete_products_attributes($_POST['products_filter']); $messageStack->add_session(SUCCESS_ATTRIBUTES_DELETED . ' ID#' . $products_filter, 'success'); $action=''; $products_filter = $_POST['products_filter']; // reset products_price_sorter for searches etc. zen_update_products_price_sorter($products_filter); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '¤t_category_id=' . $_POST['current_category_id'])); break; case 'delete_option_name_values': $delete_attributes_options_id = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_POST['products_filter'] . "' and options_id='" . $_POST['products_options_id_all'] . "'"); while (!$delete_attributes_options_id->EOF) { // remove any attached downloads $remove_downloads = $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id= '" . $delete_attributes_options_id->fields['products_attributes_id'] . "'"); // remove all option values $delete_attributes_options_id_values = $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $_POST['products_filter'] . "' and options_id='" . $_POST['products_options_id_all'] . "'"); $delete_attributes_options_id->MoveNext(); } $action=''; $products_filter = $_POST['products_filter']; $messageStack->add_session(SUCCESS_ATTRIBUTES_DELETED_OPTION_NAME_VALUES. ' ID#' . zen_options_name($_POST['products_options_id_all']), 'success'); // reset products_price_sorter for searches etc. zen_update_products_price_sorter($products_filter); zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '¤t_category_id=' . $_POST['current_category_id'])); break; // attributes copy to product case 'update_attributes_copy_to_product': $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0'); $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0'); $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0'); zen_copy_products_attributes($_POST['products_filter'], $_POST['products_update_id']); $_GET['action']= ''; $products_filter = $_POST['products_update_id']; zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '¤t_category_id=' . $_POST['current_category_id'])); break; // attributes copy to category case 'update_attributes_copy_to_category': $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0'); $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0'); $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0'); if ($_POST['categories_update_id'] == '') { $messageStack->add_session(WARNING_PRODUCT_COPY_TO_CATEGORY_NONE . ' ID#' . $_POST['products_filter'], 'warning'); } else { $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $_POST['categories_update_id'] . "'"); while (!$copy_to_category->EOF) { zen_copy_products_attributes($_POST['products_filter'], $copy_to_category->fields['products_id']); $copy_to_category->MoveNext(); } } $_GET['action']= ''; $products_filter = $_POST['products_filter']; zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '¤t_category_id=' . $_POST['current_category_id'])); break; } } //iii 031103 added to get results from database option type query $products_options_types_list = array(); // $products_options_type_array = $db->Execute("select products_options_types_id, products_options_types_name from " . TABLE_PRODUCTS_OPTIONS_TYPES . " where language_id='" . $_SESSION['languages_id'] . "' order by products_options_types_id"); $products_options_type_array = $db->Execute("select products_options_types_id, products_options_types_name from " . TABLE_PRODUCTS_OPTIONS_TYPES . " order by products_options_types_id"); while (!$products_options_type_array->EOF) { $products_options_types_list[$products_options_type_array->fields['products_options_types_id']] = $products_options_type_array->fields['products_options_types_name']; $products_options_type_array->MoveNext(); } //CLR 030312 add function to draw pulldown list of option types // Draw a pulldown for Option Types //iii 031103 modified to use results of database option type query from above function draw_optiontype_pulldown($name, $default = '') { global $products_options_types_list; $values = array(); foreach ($products_options_types_list as $id => $text) { $values[] = array('id' => $id, 'text' => $text); } return zen_draw_pull_down_menu($name, $values, $default); } //CLR 030312 add function to translate type_id to name // Translate option_type_values to english string //iii 031103 modified to use results of database option type query from above function translate_type_to_name($opt_type) { global $products_options_types_list; return $products_options_types_list[$opt_type]; return 'Error ' . $opt_type; } ?> > <?php echo TITLE; ?>
' . zen_image_button('button_reset.gif', IMAGE_RESET) . '  '; } echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id(); if (isset($_GET['search']) && zen_not_null($_GET['search'])) { $keywords = zen_db_input(zen_db_prepare_input($_GET['search'])); echo '
' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords; } echo ''; ?>
method="post"> method="post"> method="post"> method="post">products_id = $products_filter; include(DIR_WS_INCLUDES . 'attributes_preview.php'); ?> method="post">
  
' . zen_get_products_name($products_filter); ?>
' . zen_get_products_name($products_filter); ?>
' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '
' . TEXT_PRODUCT_EDIT . ''; ?>
get_allow_add_to_cart($products_filter) == "Y") { echo '' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '
' . TEXT_PRODUCTS_PRICE_MANAGER . '
'; } else { echo TEXT_INFO_ALLOW_ADD_TO_CART_NO; } ?>
' . zen_image_button('button_update_sort.gif', IMAGE_UPDATE_SORT) . '
' . TEXT_ATTRIBUTES_UPDATE_SORT_ORDER . ''; ?>
' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '
' . TEXT_ATTRIBUTES_PREVIEW . ''; ?>
' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '
' . TEXT_ATTRIBUTES_DELETE . ''; ?>
' . zen_image_button('button_copy_to.gif', IMAGE_COPY) . '
' . TEXT_ATTRIBUTES_COPY_TO_PRODUCTS . ''; ?>
' . zen_image_button('button_copy_to.gif', IMAGE_COPY) . '
' . TEXT_ATTRIBUTES_COPY_TO_CATEGORY . ''; ?>
' . IMAGE_PRODUCTS_TO_CATEGORIES . ''; ?>
' . zen_get_products_name($products_filter); ?> ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
' . TEXT_INFO_PRODUCTS_OPTION_ID . $_GET['products_options_id_all'] . ' ' . TEXT_INFO_PRODUCTS_OPTION_NAME . ' ' . zen_options_name($_GET['products_options_id_all']); ?> ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
' . zen_get_products_name($products_filter); ?> ' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '
' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '
' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE; ?>
' . zen_draw_products_pull_down('products_update_id', 'size="5"', $products_exclude_array, true, '', true); ?> ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
' . zen_get_products_name($products_filter); ?> ' . zen_draw_radio_field('copy_attributes', 'copy_attributes_delete', true) . ' ' . TEXT_COPY_ATTRIBUTES_DELETE . '
' . zen_draw_radio_field('copy_attributes', 'copy_attributes_update') . ' ' . TEXT_COPY_ATTRIBUTES_UPDATE . '
' . zen_draw_radio_field('copy_attributes', 'copy_attributes_ignore') . ' ' . TEXT_COPY_ATTRIBUTES_IGNORE; ?>
' . zen_draw_products_pull_down_categories('categories_update_id', 'size="5"', '', true, true); ?> ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
products_id . "' // where patrib.products_id='" . (int)$_GET['products_id'] . "' $check_template = $db->Execute("select template_dir from " . TABLE_TEMPLATE_SELECT); echo ''; ?>
fields['total'] > 0) { ?>
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
 
' . TEXT_PRICED_BY_ATTRIBUTES . '' . '
' : ''); echo zen_get_products_display_price($_GET['products_filter']) . '

'; echo zen_get_products_quantity_min_units_display($_GET['products_filter'], $include_break = true); ?>
Execute($attributes); if ($attributes_values->RecordCount() == 0) { ?> EOF) { $current_attributes_products_id = $attributes_values->fields['products_id']; $current_attributes_options_id = $attributes_values->fields['options_id']; $products_name_only = zen_get_products_name($attributes_values->fields['products_id']); $options_name = zen_options_name($attributes_values->fields['options_id']); $values_name = zen_values_name($attributes_values->fields['options_values_id']); $rows++; // delete all option name values if ($current_options_name != $options_name) { $current_options_name = $options_name; ?> fields['products_attributes_id'])) { ?> fields['products_attributes_id'])) { ?> fields["products_attributes_id"], 1, $attributes_values, 'false'); $attributes_price_final_value = $attributes_price_final; $attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1); $attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values); $attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate(1), 1); ?> fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter) . '">' . // $marker = '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter) . '">'; if ($action == '') { ?> fields["attributes_discounted"]) { $new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false'); $new_attributes_price = zen_get_discount_calc($products_filter, true, $new_attributes_price); if ($new_attributes_price != $attributes_price_final_value) { $new_attributes_price = '|' . $currencies->display_price($new_attributes_price, zen_get_tax_rate(1), 1); } else { $new_attributes_price = ''; } } ?> fields['products_attributes_id'] . "'"; $download_display = $db->Execute($download_display_query_raw); if ($download_display->RecordCount() > 0) { // Moved to /admin/includes/configure.php if (!defined('DIR_FS_DOWNLOAD')) define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); $filename_is_missing=''; if ( !file_exists(DIR_FS_DOWNLOAD . $download_display->fields['products_attributes_filename']) ) { $filename_is_missing = zen_image(DIR_WS_IMAGES . 'icon_status_red.gif'); } else { $filename_is_missing = zen_image(DIR_WS_IMAGES . 'icon_status_green.gif'); } ?> Execute("select max(products_attributes_id) + 1 as next_id from " . TABLE_PRODUCTS_ATTRIBUTES); $next_id = $max_attributes_id_values->fields['next_id']; ////////////////////////////////////////////////////////////// // BOF: Add dividers between Product Names and between Option Names $attributes_values->MoveNext(); if (!$attributes_values->EOF) { if ($current_attributes_products_id != $attributes_values->fields['products_id']) { ?> fields['options_id']) { ?>
Execute($attributes); $attribute_page_start = ($per_page * $_GET['attribute_page']) - $per_page; $num_rows = $attribute_query->RecordCount(); if ($num_rows <= $per_page) { $num_pages = 1; } else if (($num_rows % $per_page) == 0) { $num_pages = ($num_rows / $per_page); } else { $num_pages = ($num_rows / $per_page) + 1; } $num_pages = (int) $num_pages; // fix limit error on some versions if ($attribute_page_start < 0) { $attribute_page_start = 0; } $attributes = $attributes . " LIMIT $attribute_page_start, $per_page"; // Previous if ($prev_attribute_page) { echo ' << | '; } for ($i = 1; $i <= $num_pages; $i++) { if ($i != $_GET['attribute_page']) { echo '' . $i . ' | '; } else { echo '' . $i . ' | '; } } // Next if ($_GET['attribute_page'] != $num_pages) { echo ' >> '; } ?>
                            
 
 
 
 
' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ''; } ?>
fields['attributes_qty_prices']); echo zen_draw_hidden_field('attributes_qty_prices_onetime', $attributes_values->fields['attributes_qty_prices_onetime']); } // ATTRIBUTES_ENABLED_QTY_PRICES ?> fields['attributes_price_words']); echo zen_draw_hidden_field('attributes_price_words_free', $attributes_values->fields['attributes_price_words_free']); echo zen_draw_hidden_field('attributes_price_letters', $attributes_values->fields['attributes_price_letters']); echo zen_draw_hidden_field('attributes_price_letters_free', $attributes_values->fields['attributes_price_letters_free']); } // ATTRIBUTES_ENABLED_TEXT_PRICES ?> '', 'text' => "Main Directory"); while ($file = $dir->read()) { if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { $dir_info[] = array('id' => $file . '/', 'text' => $file); } } $dir->close(); sort($dir_info); if ($attributes_values->fields['attributes_image'] != '') { $default_directory = substr( $attributes_values->fields['attributes_image'], 0,strpos( $attributes_values->fields['attributes_image'], '/')+1); } else { $default_directory = 'attributes/'; } ?> fields['attributes_image']); echo zen_draw_hidden_field('attributes_image', $attributes_values->fields['attributes_image']); } // ATTRIBUTES_ENABLED_IMAGES ?> fields['products_attributes_id'] . "'"; $download = $db->Execute($download_query_raw); if ($download->RecordCount() > 0) { $products_attributes_filename = $download->fields['products_attributes_filename']; $products_attributes_maxdays = $download->fields['products_attributes_maxdays']; $products_attributes_maxcount = $download->fields['products_attributes_maxcount']; } ?>
 fields['products_attributes_id']; ?>   
    fields['options_id'], $_SESSION['languages_id']); ?>:  '; ?> 
 '; ?> 
fields['attributes_price_factor']); echo zen_draw_hidden_field('attributes_price_factor_offset', $attributes_values->fields['attributes_price_factor_offset']); echo zen_draw_hidden_field('attributes_price_factor_onetime', $attributes_values->fields['attributes_price_factor_onetime']); echo zen_draw_hidden_field('attributes_price_factor_onetime_offset', $attributes_values->fields['attributes_price_factor_onetime_offset']); } // ATTRIBUTES_ENABLED_PRICE_FACTOR ?>
 
  
 
  
 
 
 
  
 
    
 
    
 
  
 
  
 
    
 
    

' . zen_draw_radio_field('attributes_display_only', '0', $off_attributes_display_only) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_display_only', '1', $on_attributes_display_only) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('product_attribute_is_free', '0', $off_product_attribute_is_free) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('product_attribute_is_free', '1', $on_product_attribute_is_free) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_default', '0', $off_attributes_default) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_default', '1', $on_attributes_default) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_discounted', '0', $off_attributes_discounted) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_discounted', '1', $on_attributes_discounted) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_price_base_included', '0', $off_attributes_price_base_included) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_price_base_included', '1', $on_attributes_price_base_included) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_required', '0', $off_attributes_required) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_required', '1', $on_attributes_required) . ' ' . TABLE_HEADING_YES; ?>
 
  ' . zen_draw_file_field('attributes_image') . '
' . zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . $attributes_values->fields['attributes_image'] . zen_draw_hidden_field('attributes_previous_image', $attributes_values->fields['attributes_image']); ?>
' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory); ?> fields['attributes_image'] != '' ? zen_image(DIR_WS_CATALOG_IMAGES . $attributes_values->fields['attributes_image']) : ''); ?> ' . zen_draw_radio_field('overwrite', '0', $off_overwrite) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('overwrite', '1', $on_overwrite) . ' ' . TABLE_HEADING_YES; ?> ' . zen_draw_radio_field('image_delete', '0', $off_image_delete) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('image_delete', '1', $on_image_delete) . ' ' . TABLE_HEADING_YES; ?>
 
  ' . zen_draw_input_field('products_attributes_filename', $products_attributes_filename, zen_set_field_length(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, 'products_attributes_filename', 35)); ?>  ' . zen_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>  ' . zen_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?> 
 
 fields["products_attributes_id"]; ?>            fields["options_values_price"]; ?>   fields["price_prefix"]; ?>   '; ?>  '; ?>   
 
 fields["products_attributes_id"]; ?>         fields['attributes_image'] != '' ? zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . ' ' : '  ') . $values_name; ?>   fields["price_prefix"]; ?> fields["options_values_price"]; ?>   fields["products_attributes_weight_prefix"]; ?> fields["products_attributes_weight"]; ?>   fields["products_options_sort_order"]; ?> 
fields["attributes_display_only"] == '0' ? '' . zen_image(DIR_WS_IMAGES . 'icon_yellow_off.gif', LEGEND_ATTRIBUTES_DISPLAY_ONLY) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', LEGEND_ATTRIBUTES_DISPLAY_ONLY)) . ''; ?> fields["product_attribute_is_free"] == '0' ? '' . zen_image(DIR_WS_IMAGES . 'icon_blue_off.gif', LEGEND_ATTRIBUTES_IS_FREE) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_blue_on.gif', LEGEND_ATTRIBUTES_IS_FREE)) . ''; ?> fields["attributes_default"] == '0' ? '' . zen_image(DIR_WS_IMAGES . 'icon_orange_off.gif', LEGEND_ATTRIBUTES_DEFAULT) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_orange_on.gif', LEGEND_ATTRIBUTES_DEFAULT)) . '' ?> fields["attributes_discounted"] == '0' ? '' . zen_image(DIR_WS_IMAGES . 'icon_pink_off.gif', LEGEND_ATTRIBUTE_IS_DISCOUNTED) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_pink_on.gif', LEGEND_ATTRIBUTE_IS_DISCOUNTED)) . ''; ?> fields["attributes_price_base_included"] == '0' ? '' . zen_image(DIR_WS_IMAGES . 'icon_purple_off.gif', LEGEND_ATTRIBUTE_PRICE_BASE_INCLUDED) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_purple_on.gif', LEGEND_ATTRIBUTE_PRICE_BASE_INCLUDED)) . ''; ?> fields["attributes_required"] == '0' ? '' . zen_image(DIR_WS_IMAGES . 'icon_red_off.gif', LEGEND_ATTRIBUTES_REQUIRED) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', LEGEND_ATTRIBUTES_REQUIRED)) . ''; ?>
   fields['products_attributes_id'] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id ) . '">'; ?>  fields['products_attributes_id'] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id ) , '">'; ?> 
 
  fields['products_attributes_filename']; ?>       fields['products_attributes_maxdays']; ?>       fields['products_attributes_maxcount']; ?> 
'', 'text' => "Main Directory"); while ($file = $dir->read()) { if (is_dir(DIR_FS_CATALOG_IMAGES . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") { $dir_info[] = array('id' => $file . '/', 'text' => $file); } } $dir->close(); sort($dir_info); $default_directory = 'attributes/'; ?>
     
    
   '; ?>   '; ?> 
 '; ?>    '; ?>    
 
 '; ?> 
 '; ?>        '; ?>      
 '; ?>   '; ?> 
 '; ?>        '; ?>      

' . zen_draw_radio_field('attributes_display_only', '0', $off_attributes_display_only) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_display_only', '1', $on_attributes_display_only) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('product_attribute_is_free', '0', $off_product_attribute_is_free) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('product_attribute_is_free', '1', $on_product_attribute_is_free) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_default', '0', $off_attributes_default) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_default', '1', $on_attributes_default) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_discounted', '0', $off_attributes_discounted) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_discounted', '1', $on_attributes_discounted) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_price_base_included', '0', $off_attributes_price_base_included) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_price_base_included', '1', $on_attributes_price_base_included) . ' ' . TABLE_HEADING_YES; ?>

' . zen_draw_radio_field('attributes_required', '0', $off_attributes_required) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('attributes_required', '1', $on_attributes_required) . ' ' . TABLE_HEADING_YES; ?>
    ' . zen_draw_file_field('attributes_image'); ?> ' . zen_draw_pull_down_menu('img_dir', $dir_info, $default_directory); ?> ' . zen_draw_radio_field('overwrite', '0', $off_overwrite) . ' ' . TABLE_HEADING_NO . ' ' . zen_draw_radio_field('overwrite', '1', $on_overwrite) . ' ' . TABLE_HEADING_YES; ?>
   
  ' . zen_draw_input_field('products_attributes_filename', $products_attributes_filename, zen_set_field_length(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, 'products_attributes_filename', 35)); ?>  ' . zen_draw_input_field('products_attributes_maxdays', $products_attributes_maxdays, 'size="5"'); ?>  ' . zen_draw_input_field('products_attributes_maxcount', $products_attributes_maxcount, 'size="5"'); ?>