Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Lista - 1 pozycja - jak wyświetlić samą wartość bez rozwijania?
jamesPL
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 28.03.2007

Ostrzeżenie: (0%)
-----


Witam, proszę o pomoc: mam na stronie:

  1. <select name="id[1]"><option value="1">pierwszy</option></select>


a to plik, a własciwie fragment odp. za wyswietlenie listy:

  1. <?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?>


a to funkcja:

  1. <?php
  2. $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
  3. while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
  4. $products_options_array = array();
  5. $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa
    .options_values_price, pa.price_prefix from "
     . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id =
     '"
     . (int)$languages_id . "'");
  6. while ($products_options = tep_db_fetch_array($products_options_query)) {
  7. $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
  8. if ($products_options['options_values_price'] != '0') {
  9. $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
  10. }
  11. }
  12.  
  13. if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
  14. $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
  15. } else {
  16. $selected_attribute = false;
  17. }
  18. ?>


tak więc pozycja jest tylko jedna, chciałbym aby w przypadku, gdy jest tylko jedna pozycja nie wsywietlala sie lista rozwijana, tylko sam tekst...
Z góry dzieki za pomoc...

Ten post edytował jamesPL 20.06.2008, 11:52:15
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Babcia@Stefa
post
Post #2





Grupa: Zarejestrowani
Postów: 654
Pomógł: 17
Dołączył: 19.03.2006
Skąd: z kosmosu ;)

Ostrzeżenie: (0%)
-----


1. Nie podałeś źródła użytych funkcji (mamy się domyśleć co one zwracają?!)
2. Kod jest nie czytelny
3. Używasz zbyt wielu funkcji z własnego zakresu (my ich nie znamy)

Dlatego zapewne nie masz odpowiedzi.

Dziękuję, Babcia@Stefa


--------------------
Środowisko testowe (desktop) - Gedit, lighttpd, sftp, rsync, xfce4-terminal, chromium, firefox4 | System: Gentoo ~x86
O'Neill - serwer WWW @ lighttpd, links, nano, rsyncd, sftpd | System: Debian
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 13:42