![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 62 Pomógł: 0 Dołączył: 28.06.2003 Skąd: TG Ostrzeżenie: (0%) ![]() ![]() |
potrzebuję skrypcik, który będzie wyciągał z bazy sql tylko jedną wartość - dokładnie chodzi o to żeby skrypt wyciągnął i wyświetlił kwotę ostatniego zamówienia - potrzebuję do stronki z płatnościami, bo jak na razie to wyświetla wszystkie kwoty, a potem są niezłe klocki z tym ;(
skrypt wygląda tak: [php:1:351deae04f]<? $history_sql = "select orders_id, date_purchased, shipping_cost, orders_status, currency, currency_value from orders where customers_id = '" . $customer_id . "' order by orders_id DESC"; $history_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $history_sql, $history_numrows); $history = tep_db_query($history_sql); # if (@!tep_db_num_rows($history)) { # } else { $row = 0; if ($history_values = tep_db_fetch_array($history)) { $row++; $total_cost = 0; $history_total = tep_db_query("select final_price, products_tax, products_quantity from orders_products where orders_id = '" . $history_values['orders_id'] . "'"); if ($history_total_values = tep_db_fetch_array($history_total)) { $cost = ($history_total_values['final_price'] * $history_total_values['products_quantity']); $total_cost += $cost + ($cost * ($history_total_values['products_tax']/100)); } $total_cost += $history_values['shipping_cost']; echo '' . FONT_STYLE_MAIN . '<b>' . tep_currency_format($total_cost, true, $history_values['currency'], $history_values['currency_value']) . '</b>' . "n"; echo '<input type="hidden" name="amount" value="' . tep_currency_format($total_cost, true, $history_values['currency']) . '">' . "n"; } } ?>[/php:1:351deae04f] dodatkowo nie wiem jak dodać do tego [w/w] skryptu coś żeby w przyadku braku zamówień pokazywało tekst: Jeszcze nie robiłeś u nas zakupów. Próbowałam na końcu dodać } else { echo..... ale ciągle pokazuje błąd że nie można tam dodać else ;( pomóżcie (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) pozdrawia, olcia |
|
|
![]() ![]() |
![]() |
Aktualny czas: 22.08.2025 - 15:43 |