Beispiel #1
0
         }
         $smarty->assign(array('hidden_post_values' => $hidden_post_values, 'link_filename_reviews_back_edit' => xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=edit'), 'link_filename_reviews_cancel' => xos_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id)));
     } else {
         if (isset($_GET['origin'])) {
             $back_url = $_GET['origin'];
             $back_url_params = '';
         } else {
             $back_url = FILENAME_REVIEWS;
             $back_url_params = 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id;
         }
         $smarty->assign('link_filename_reviews_back', xos_href_link($back_url, $back_url_params));
     }
     if ($product_image['name']) {
         $smarty->assign('products_image', xos_image(DIR_WS_CATALOG_IMAGES . 'products/medium/' . $product_image['name'], $rInfo->products_name, '', '', 'style="margin: 5px;"'));
     }
     $smarty->assign(array('preview' => true, 'form_begin_update' => xos_draw_form('update', FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID'] . '&action=update', 'post', 'enctype="multipart/form-data"'), 'products_name' => $rInfo->products_name, 'customers_name' => $rInfo->customers_name, 'date_added' => xos_date_short($rInfo->date_added), 'reviews_text' => xos_break_string(nl2br(xos_db_output(substr(strip_tags(isset($_POST['reviews_text']) ? $_POST['reviews_text'] : $rInfo->reviews_text), 0, 1000))), 60), 'stars_image' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/stars_' . $rInfo->reviews_rating . '.gif', sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating)), 'text_of_5_stars' => sprintf(TEXT_OF_5_STARS, $rInfo->reviews_rating), 'form_end' => '</form>'));
 } else {
     $reviews_query_raw = "select reviews_id, products_id, date_added, last_modified, reviews_rating from " . TABLE_REVIEWS . " order by date_added DESC";
     $reviews_split = new splitPageResults($_GET['page'], MAX_DISPLAY_RESULTS, $reviews_query_raw, $reviews_query_numrows);
     $reviews_query = xos_db_query($reviews_query_raw);
     $reviews_array = array();
     while ($reviews = xos_db_fetch_array($reviews_query)) {
         if ((!isset($_GET['rID']) || isset($_GET['rID']) && $_GET['rID'] == $reviews['reviews_id']) && !isset($rInfo)) {
             $reviews_text_query = xos_db_query("select r.reviews_read, r.customers_name, length(rd.reviews_text) as reviews_text_size from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.reviews_id = '" . (int) $reviews['reviews_id'] . "' and r.reviews_id = rd.reviews_id");
             $reviews_text = xos_db_fetch_array($reviews_text_query);
             $products_image_query = xos_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int) $reviews['products_id'] . "'");
             $products_image = xos_db_fetch_array($products_image_query);
             $products_name_query = xos_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int) $reviews['products_id'] . "' and language_id = '" . (int) $_SESSION['used_lng_id'] . "'");
             $products_name = xos_db_fetch_array($products_name_query);
             $reviews_average_query = xos_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int) $reviews['products_id'] . "'");
             $reviews_average = xos_db_fetch_array($reviews_average_query);
 }
 $order_totals_array = array();
 for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
     $order_totals_array[] = array('totals_title' => $order_totals[$i]['title'], 'totals_text' => $order_totals[$i]['text'], 'totals_tax' => $order_totals[$i]['tax']);
     if ($order_totals[$i]['tax'] > -1) {
         $tax_rates[$order_totals[$i]['tax']] = '1';
     }
 }
 // lets start with the email confirmation
 if (SEND_EMAILS == 'true') {
     $smarty->unregisterFilter('output', 'smarty_outputfilter_trimwhitespace');
     if (sizeof($tax_rates) > 1 && $_SESSION['sppc_customer_group_tax_exempt'] != '1') {
         $smarty->assign('more_tax_groups', true);
     }
     if ($order->info['comments']) {
         $smarty->assign('order_comments', xos_db_output($order->info['comments']));
     }
     if ($order->content_type != 'virtual') {
         $smarty->assign('delivery_address', xos_address_label($_SESSION['customer_id'], $_SESSION['sendto'], 0, '', "\n"));
     }
     if (is_object(${$_SESSION['payment']})) {
         $payment_class = ${$_SESSION['payment']};
         $smarty->assign('payment_method', $order->info['payment_method']);
         if ($payment_class->email_footer) {
             $smarty->assign('payment_email_footer', $payment_class->email_footer);
         }
     }
     $smarty->assign(array('html_params' => HTML_PARAMS, 'xhtml_lang' => XHTML_LANG, 'charset' => CHARSET, 'link_invoice' => xos_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false, false), 'default_address' => xos_address_label($_SESSION['customer_id'], $_SESSION['customer_default_address_id'], 0, '', "\n"), 'billing_address' => xos_address_label($_SESSION['customer_id'], $_SESSION['billto'], 0, '', "\n"), 'store_name' => STORE_NAME, 'store_name_address' => STORE_NAME_ADDRESS, 'order_id' => $insert_id, 'date_ordered' => xos_date_format(DATE_FORMAT_LONG), 'order_products' => $order_products_array, 'order_totals' => $order_totals_array, 'src_embedded_shop_logo' => 'cid:shop_logo', 'src_shop_logo' => HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . (is_file(DIR_FS_CATALOG . 'images/email_shop_logo/' . EMAIL_SHOP_LOGO) ? 'email_shop_logo/' : 'catalog/templates/' . SELECTED_TPL . '/') . EMAIL_SHOP_LOGO));
     $smarty->configLoad('languages/' . $_SESSION['language'] . '_email.conf', 'order_email_html');
     $output_order_email_html = $smarty->fetch(SELECTED_TPL . '/includes/email/order_email_html.tpl');
     $smarty->configLoad('languages/' . $_SESSION['language'] . '_email.conf', 'order_email_text');
Beispiel #3
0
     $order_products_array[] = array('qty' => $order->products[$i]['qty'], 'model' => $order->products[$i]['model'], 'name' => $order->products[$i]['name'], 'packaging_unit' => $order->products[$i]['packaging_unit'], 'tax' => xos_display_tax_value($order->products[$i]['tax']), 'price' => $order->products[$i]['price_formated'], 'final_single_price' => $order->products[$i]['final_price_formated'], 'final_price' => $order->products[$i]['total_price_formated'], 'products_attributes_option_price' => $attributes_options_values_price, 'product_attributes' => $order_attributes_array);
     unset($order_attributes_array);
 }
 $order_totals_array = array();
 for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
     $order_totals_array[] = array('title' => $order->totals[$i]['title'], 'text' => $order->totals[$i]['text'], 'tax' => $order->totals[$i]['class'] == 'ot_shipping' || $order->totals[$i]['class'] == 'ot_loworderfee' || $order->totals[$i]['class'] == 'ot_cod_fee' ? xos_display_tax_value($order->totals[$i]['tax']) : -1);
 }
 $orders_history_query = xos_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . xos_db_input($oID) . "' order by date_added, orders_status_history_id");
 if (xos_db_num_rows($orders_history_query)) {
     $orders_history_array = array();
     while ($orders_history = xos_db_fetch_array($orders_history_query)) {
         $customer_notified = false;
         if ($orders_history['customer_notified'] == '1') {
             $customer_notified = true;
         }
         $orders_history_array[] = array('date_added' => xos_datetime_short($orders_history['date_added']), 'status' => $orders_status_array[$orders_history['orders_status_id']], 'comments' => nl2br(xos_db_output($orders_history['comments'])), 'customer_notified' => $customer_notified);
     }
     $smarty->assign('orders_history', $orders_history_array);
 } else {
 }
 $languages_query = xos_db_query("select name from " . TABLE_LANGUAGES . " where use_in_id > '1' and languages_id = '" . $order->info['language_id'] . "'");
 if (!xos_db_num_rows($languages_query)) {
     $lang_query = xos_db_query("select name from " . TABLE_LANGUAGES . " where code = '" . xos_db_input(DEFAULT_LANGUAGE) . "'");
     $languages = xos_db_fetch_array($lang_query);
 } else {
     $languages = xos_db_fetch_array($languages_query);
 }
 if (SEND_EMAILS == 'true') {
     $smarty->assign(array('send_emails' => true, 'checkbox_notify' => xos_draw_checkbox_field('notify', '', true), 'checkbox_notify_comments' => xos_draw_checkbox_field('notify_comments', '', true)));
 }
 if (sizeof($order->info['tax_groups']) > 1) {