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)); } require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); switch($_GET['action']) { case ('update_sort_order'): foreach($_POST['options_values_new_sort_order'] as $id => $new_sort_order) { $row++; $db->Execute("UPDATE " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_sort_order= " . $_POST['options_values_new_sort_order'][$id] . " where products_options_values_id= $id"); } $messageStack->add_session(SUCCESS_OPTION_VALUES_SORT_ORDER . ' ' . zen_options_name($_GET['options_id']), 'success'); $_GET['action']=''; zen_redirect(zen_href_link(FILENAME_PRODUCTS_OPTIONS_VALUES)); break; // update by product case ('update_product'): $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT . $_POST['products_update_id'] . ' ' . zen_get_products_name($_POST['products_update_id'], $_SESSION['languages_id']), 'success'); zen_update_attributes_products_option_values_sort_order($_POST['products_update_id']); $action=''; zen_redirect(zen_href_link(FILENAME_PRODUCTS_OPTIONS_VALUES)); break; // update by category case ('update_categories_attributes'): $all_products_attributes= $db->Execute("select ptoc.products_id, pa.products_attributes_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptoc, " . TABLE_PRODUCTS_ATTRIBUTES . " pa " . " where ptoc.categories_id = '" . $_POST['categories_update_id'] . "' and pa.products_id = ptoc.products_id" ); while (!$all_products_attributes->EOF) { $count++; $product_id_updated .= ' - ' . $all_products_attributes->fields['products_id'] . ':' . $all_products_attributes->fields['products_attributes_id']; zen_update_attributes_products_option_values_sort_order($all_products_attributes->fields['products_id']); $all_products_attributes->MoveNext(); } $messageStack->add_session(SUCCESS_CATEGORIES_UPDATE_SORT . $_POST['categories_update_id'] . ' ' . zen_get_category_name($_POST['categories_update_id'], $_SESSION['languages_id']), 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_PRODUCTS_OPTIONS_VALUES)); break; // update all products in catalog case ('update_all_products_attributes_sort_order'): $all_products_attributes= $db->Execute("select p.products_id, pa.products_attributes_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa " . " where p.products_id= pa.products_id" ); while (!$all_products_attributes->EOF) { $count++; zen_update_attributes_products_option_values_sort_order($all_products_attributes->fields['products_id']); $all_products_attributes->MoveNext(); } $messageStack->add_session(SUCCESS_PRODUCT_UPDATE_SORT_ALL, 'success'); $action=''; zen_redirect(zen_href_link(FILENAME_PRODUCTS_OPTIONS_VALUES)); break; } // switch ?> > <?php echo TITLE; ?>
method="post"> method="post">
     
'; $row = $db->Execute("SELECT * FROM " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " povtpo WHERE povtpo.products_options_values_id = pov.products_options_values_id and povtpo.products_options_id='" . $_GET['options_id'] . "' and pov.language_id = '" . $_SESSION['languages_id'] . "' ORDER BY pov.products_options_values_sort_order, pov.products_options_values_id"); if (!$row->EOF) { $option_values_exist = true; while (!$row->EOF) { echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; echo ' ' . "\n"; $row->MoveNext(); } // while($row = mysql_fetch_array($result)); } else { $option_values_exist = false; echo ' ' . "\n"; } ?>
Option IDOption Value NameSort Order
' . $row->fields["products_options_values_id"] . '' . $row->fields["products_options_values_name"] . '' . "fields['products_options_values_id']."]\" value={$row->fields['products_options_values_sort_order']} size=\"4\">" . '
' . TEXT_NO_OPTION_VALUE . zen_options_name($_GET['options_id']) . '
'; ?>




' . zen_image_button('button_update.gif', IMAGE_UPDATE) . ''; ?>