'; // $attribute_quantity_price .= ''; $attribute_quantity_price .= ''; $cnt_qty_prices++; } echo '
'; $zc_disp_qty = ''; switch (true) { case ($i+2==$n): $zc_disp_qty = $attribute_table_cost[$i-2]+1 . '+'; break; case ($i <= 1 and $attribute_table_cost[$i] == 1): $zc_disp_qty = '1'; break; case ($i <= 1 and $attribute_table_cost[$i] != 1): $zc_disp_qty = '1-' . $attribute_table_cost[$i]; break; case ($i > 1 and $attribute_table_cost[$i-2]+1 != $attribute_table_cost[$i]): $zc_disp_qty = $attribute_table_cost[$i-2]+1 . '-' . $attribute_table_cost[$i]; break; case ($i > 1 and $attribute_table_cost[$i-2]+1 == $attribute_table_cost[$i]): $zc_disp_qty = $attribute_table_cost[$i]; break; } // $attribute_quantity .= ''; $attribute_quantity .= ''; $attribute_quantity_price .= ''; $cnt_qty_prices++; } echo '
' . TEXT_CURRENT_CLOSE_WINDOW . ''; ?>
Execute($sql); while (!$products_options_names_lookup->EOF) { if ( PRODUCTS_OPTIONS_SORT_BY_PRICE =='1' ) { $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name'; } else { $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price'; } $sql = "select pov.products_options_values_id, pov.products_options_values_name, pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$_GET['products_id'] . "' and pa.options_id = '" . (int)$products_options_names_lookup->fields['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " . $order_by; $products_options_lookup = $db->Execute($sql); $cnt_qty_prices= 0; while (!$products_options_lookup->EOF) { // set for attributes_qty_prices_onetime if ($products_options_lookup->fields['attributes_qty_prices_onetime'] != '') { $show_onetime= 'true'; } if ($products_options_lookup->fields['attributes_qty_prices'] != '') { $attribute_quantity= ''; $attribute_quantity_price= ''; $attribute_table_cost = preg_split("/[:,]/" , $products_options_lookup->fields['attributes_qty_prices']); $size = sizeof($attribute_table_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { // $attribute_quantity .= '' . (($i <= 1 and $attribute_table_cost[$i] != 1) ? '1-' . $attribute_table_cost[$i] : $attribute_table_cost[$i] . '+') . '' . (($i <= 1 and $attribute_table_cost[$i] != 1) ? '1-' . $attribute_table_cost[$i] : $attribute_table_cost[$i-2]+1 . '-' . $attribute_table_cost[$i]) . '' . $zc_disp_qty . '' . $currencies->display_price($attribute_table_cost[$i+1], zen_get_tax_rate($_GET['products_tax_class_id'])) . '
'; echo ' '; echo ' '; echo ' ' . $attribute_quantity; echo ' '; echo ' '; echo ' ' . $attribute_quantity_price; echo ' '; echo '
' . $products_options_names_lookup->fields['products_options_name'] . ' ' . $products_options_lookup->fields['products_options_values_name'] . '
' . TABLE_ATTRIBUTES_QTY_PRICE_QTY . '
' . TABLE_ATTRIBUTES_QTY_PRICE_PRICE . '
'; } $products_options_lookup->MoveNext(); } $products_options_names_lookup->MoveNext(); } ?>
Execute($sql); while (!$products_options_names_lookup->EOF) { if ( PRODUCTS_OPTIONS_SORT_BY_PRICE =='1' ) { $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name'; } else { $order_by= ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price'; } $sql = "select pov.products_options_values_id, pov.products_options_values_name, pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$_GET['products_id'] . "' and pa.options_id = '" . (int)$products_options_names_lookup->fields['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " . $order_by; $products_options_lookup = $db->Execute($sql); $cnt_qty_prices= 0; while (!$products_options_lookup->EOF) { if ($products_options_lookup->fields['attributes_qty_prices_onetime'] != '') { $attribute_quantity= ''; $attribute_quantity_price= ''; $attribute_table_cost = preg_split("/[:,]/" , $products_options_lookup->fields['attributes_qty_prices_onetime']); $size = sizeof($attribute_table_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { $attribute_quantity .= '' . $attribute_table_cost[$i] . '' . $attribute_table_cost[$i+1] . '' . $currencies->display_price($attribute_table_cost[$i+1], zen_get_tax_rate($_GET['products_tax_class_id'])) . '
'; echo ' '; echo ' '; echo ' ' . $attribute_quantity; echo ' '; echo ' '; echo ' ' . $attribute_quantity_price; echo ' '; echo '
' . $products_options_names_lookup->fields['products_options_name'] . ' ' . $products_options_lookup->fields['products_options_values_name'] . '
' . TABLE_ATTRIBUTES_QTY_PRICE_QTY . '
' . TABLE_ATTRIBUTES_QTY_PRICE_PRICE . '
'; } $products_options_lookup->MoveNext(); } $products_options_names_lookup->MoveNext(); } ?> ' . TEXT_CURRENT_CLOSE_WINDOW . ''; ?>