function ItemAttributsSetUp($current_product_id) { // I found the easiest way to do this is just delete the current attributes & start over =) // download function start $delete_sql = vam_db_query("SELECT products_attributes_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . $current_product_id . "'"); while ($delete_res = vam_db_fetch_array($delete_sql)) { $delete_download_sql = vam_db_query("SELECT products_attributes_filename FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " WHERE products_attributes_id = '" . $delete_res['prducts_attributes_id'] . "'"); $delete_download_file = vam_db_fetch_array($delete_download_sql); vam_db_query("DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " WHERE products_attributes_id = '" . $delete_res['products_attributes_id'] . "'"); } // download function end vam_db_query("DELETE FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . $current_product_id . "'"); // Simple, yet effective.. loop through the selected Option Values.. find the proper price & prefix.. insert.. yadda yadda yadda. for ($i = 0; $i < sizeof($_POST['optionValues']); $i++) { $query = "SELECT * FROM " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . $_POST['optionValues'][$i] . "'"; $result = vam_db_query($query); $matches = vam_db_num_rows($result); while ($line = vam_db_fetch_array($result)) { $optionsID = $line['products_options_id']; } $cv_id = $_POST['optionValues'][$i]; $value_price = $_POST[$cv_id . '_price']; if (PRICE_IS_BRUTTO == 'true') { $value_price = $value_price / (vam_get_tax_rate(vam_get_tax_class_id($current_product_id)) + 100) * 100; } $value_price = vam_round($value_price, PRICE_PRECISION); $value_prefix = $_POST[$cv_id . '_prefix']; $value_sortorder = $_POST[$cv_id . '_sortorder']; $value_weight_prefix = $_POST[$cv_id . '_weight_prefix']; $value_model = $_POST[$cv_id . '_model']; $value_stock = $_POST[$cv_id . '_stock']; $value_weight = $_POST[$cv_id . '_weight']; vam_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix ,attributes_model, attributes_stock, options_values_weight, weight_prefix,sortorder) VALUES ('" . $current_product_id . "', '" . $optionsID . "', '" . $_POST['optionValues'][$i] . "', '" . $value_price . "', '" . $value_prefix . "', '" . $value_model . "', '" . $value_stock . "', '" . $value_weight . "', '" . $value_weight_prefix . "','" . $value_sortorder . "')") or die(mysql_error()); $products_attributes_id = vam_db_insert_id(); if ($_POST[$cv_id . '_download_file'] != '') { if (DOWNLOAD_ENABLED == 'true') { $value_download_file = $_POST[$cv_id . '_download_file']; $value_download_expire = $_POST[$cv_id . '_download_expire']; $value_download_count = $_POST[$cv_id . '_download_count']; $value_is_pin = $_POST[$cv_id . '_ispin']; $products_attributes_is_pin = isset($value_is_pin) ? 1 : 0; vam_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " (products_attributes_id, products_attributes_filename, products_attributes_maxdays, products_attributes_maxcount, products_attributes_is_pin) VALUES ('" . $products_attributes_id . "', '" . $value_download_file . "', '" . $value_download_expire . "', '" . $value_download_count . "', '" . $products_attributes_is_pin . "')") or die(mysql_error()); } } } }
$affiliate = vam_db_fetch_array($affiliate_query); $affiliate_percent = 0; $affiliate_percent = $affiliate['affiliate_commission_percent']; if ($affiliate_percent < AFFILIATE_PERCENT) { $affiliate_percent = AFFILIATE_PERCENT; } $affiliate_clickthroughs_raw = "select count(*) as count from " . TABLE_AFFILIATE_CLICKTHROUGHS . " where affiliate_id = '" . $_GET['acID'] . "'"; $affiliate_clickthroughs_query = vam_db_query($affiliate_clickthroughs_raw); $affiliate_clickthroughs = vam_db_fetch_array($affiliate_clickthroughs_query); $affiliate_clickthroughs = $affiliate_clickthroughs['count']; $affiliate_sales_raw = "\n select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a \n left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) \n where a.affiliate_id = '" . $_GET['acID'] . "' and o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . "\n "; $affiliate_sales_query = vam_db_query($affiliate_sales_raw); $affiliate_sales = vam_db_fetch_array($affiliate_sales_query); $affiliate_transactions = $affiliate_sales['count']; if ($affiliate_clickthroughs > 0) { $affiliate_conversions = vam_round($affiliate_transactions / $affiliate_clickthroughs * 100, 2) . "%"; } else { $affiliate_conversions = "n/a"; } if ($affiliate_sales['total'] > 0) { $affiliate_average = $affiliate_sales['total'] / $affiliate_sales['count']; } else { $affiliate_average = 0; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html <?php echo HTML_PARAMS; ?> > <head>
} $orders_id = substr($orders_id, 0, -1) . ")"; // Set the Sales to Temp State (it may happen that an order happend while billing) $sql = "UPDATE " . TABLE_AFFILIATE_SALES . " \n set affiliate_billing_status=99 \n where affiliate_id='" . $affiliate_payment['affiliate_id'] . "' \n and affiliate_orders_id in " . $orders_id . " \n "; vam_db_query($sql); // Get Sum of payment (Could have changed since last selects); $sql = "\n SELECT sum(affiliate_payment) as affiliate_payment\n FROM " . TABLE_AFFILIATE_SALES . " \n WHERE affiliate_id='" . $affiliate_payment['affiliate_id'] . "' and affiliate_billing_status=99 \n "; $affiliate_billing_query = vam_db_query($sql); $affiliate_billing = vam_db_fetch_array($affiliate_billing_query); // Get affiliate Informations $sql = "\n SELECT a.*, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id \n from " . TABLE_AFFILIATE . " a \n left join " . TABLE_ZONES . " z on (a.affiliate_zone_id = z.zone_id) \n left join " . TABLE_COUNTRIES . " c on (a.affiliate_country_id = c.countries_id)\n WHERE affiliate_id = '" . $affiliate_payment['affiliate_id'] . "' \n "; $affiliate_query = vam_db_query($sql); $affiliate = vam_db_fetch_array($affiliate_query); // Get need tax informations for the affiliate $affiliate_tax_rate = vam_get_affiliate_tax_rate(AFFILIATE_TAX_ID, $affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id']); $affiliate_tax = vam_round($affiliate_billing['affiliate_payment'] * $affiliate_tax_rate / 100, 2); // Netto-Provision $affiliate_payment_total = $affiliate_billing['affiliate_payment']; // Bill the order $affiliate['affiliate_state'] = vam_get_zone_code($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']); $sql_data_array = array('affiliate_id' => $affiliate_payment['affiliate_id'], 'affiliate_payment' => $affiliate_billing['affiliate_payment'] - $affiliate_tax, 'affiliate_payment_tax' => $affiliate_tax, 'affiliate_payment_total' => $affiliate_payment_total, 'affiliate_payment_date' => 'now()', 'affiliate_payment_status' => '0', 'affiliate_firstname' => $affiliate['affiliate_firstname'], 'affiliate_lastname' => $affiliate['affiliate_lastname'], 'affiliate_street_address' => $affiliate['affiliate_street_address'], 'affiliate_suburb' => $affiliate['affiliate_suburb'], 'affiliate_city' => $affiliate['affiliate_city'], 'affiliate_country' => $affiliate['countries_name'], 'affiliate_postcode' => $affiliate['affiliate_postcode'], 'affiliate_company' => $affiliate['affiliate_company'], 'affiliate_state' => $affiliate['affiliate_state'], 'affiliate_address_format_id' => $affiliate['address_format_id']); vam_db_perform(TABLE_AFFILIATE_PAYMENT, $sql_data_array); $insert_id = vam_db_insert_id(); // Set the Sales to Final State vam_db_query("update " . TABLE_AFFILIATE_SALES . " set affiliate_payment_id = '" . $insert_id . "', affiliate_billing_status = 1, affiliate_payment_date = now() where affiliate_id = '" . $affiliate_payment['affiliate_id'] . "' and affiliate_billing_status = 99"); // Notify Affiliate if (AFFILIATE_NOTIFY_AFTER_BILLING == 'true') { $check_status_query = vam_db_query("select af.affiliate_email_address, ap.affiliate_lastname, ap.affiliate_firstname, ap.affiliate_payment_status, ap.affiliate_payment_date, ap.affiliate_payment_date from " . TABLE_AFFILIATE_PAYMENT . " ap, " . TABLE_AFFILIATE . " af where affiliate_payment_id = '" . $insert_id . "' and af.affiliate_id = ap.affiliate_id "); $check_status = vam_db_fetch_array($check_status_query); $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_AFFILIATE_PAYMENT_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . vam_catalog_href_link(FILENAME_CATALOG_AFFILIATE_PAYMENT_INFO, 'payment_id=' . $insert_id, 'SSL') . "\n" . EMAIL_TEXT_PAYMENT_BILLED . ' ' . vam_date_long($check_status['affiliate_payment_date']) . "\n\n" . EMAIL_TEXT_NEW_PAYMENT; vam_php_mail(AFFILIATE_EMAIL_ADDRESS, EMAIL_SUPPORT_NAME, $check_status['affiliate_email_address'], $check_status['affiliate_firstname'] . ' ' . $check_status['affiliate_lastname'], '', EMAIL_SUPPORT_REPLY_ADDRESS, EMAIL_SUPPORT_REPLY_ADDRESS_NAME, '', '', EMAIL_TEXT_SUBJECT, nl2br($email), $email);
function vam_calculate_tax($price, $tax) { global $currencies; return vam_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']); }
$vamTemplate->assign('LINK_TRANSACTIONS', '<a href="javascript:popupAffWindow(\'' . vam_href_link(FILENAME_AFFILIATE_HELP_3) . '\')">'); $vamTemplate->assign('LINK_CONVERSION', '<a href="javascript:popupAffWindow(\'' . vam_href_link(FILENAME_AFFILIATE_HELP_4) . '\')">'); $vamTemplate->assign('LINK_AMOUNT', '<a href="javascript:popupAffWindow(\'' . vam_href_link(FILENAME_AFFILIATE_HELP_5) . '\')">'); $vamTemplate->assign('LINK_AVERAGE', '<a href="javascript:popupAffWindow(\'' . vam_href_link(FILENAME_AFFILIATE_HELP_6) . '\')">'); $vamTemplate->assign('LINK_COMISSION_RATE', '<a href="javascript:popupAffWindow(\'' . vam_href_link(FILENAME_AFFILIATE_HELP_7) . '\')">'); $vamTemplate->assign('LINK_COMISSION', '<a href="javascript:popupAffWindow(\'' . vam_href_link(FILENAME_AFFILIATE_HELP_8) . '\')">'); if (AFFILATE_USE_TIER == 'true') { $vamTemplate->assign('AFFILIATE_USE_TIER', 'true'); for ($tier_number = 0; $tier_number <= AFFILIATE_TIER_LEVELS; $tier_number++) { if (is_null($affiliate_percent_tier[$tier_number - 1])) { $affiliate_percent_tier[$tier_number - 1] = $affiliate_percent; } $affiliate_percent_tier_table .= '<tr>'; $affiliate_percent_tier_table .= '<td width="15%" class="boxtext"><a href=' . vam_href_link(FILENAME_AFFILIATE_SALES, 'a_level=' . $tier_number . '&a_period=' . $a_period, 'SSL') . '>' . TEXT_COMMISSION_LEVEL_TIER . $tier_number . '</a></td>'; $affiliate_percent_tier_table .= '<td width="15%" align="right" class="boxtext"><a href=' . vam_href_link(FILENAME_AFFILIATE_SALES, 'a_level=' . $tier_number . '&a_period=' . $a_period, 'SSL') . '>' . TEXT_COMMISSION_RATE_TIER . '</a></td>'; $affiliate_percent_tier_table .= '<td width="5%" class="boxtext">' . vam_round($affiliate_percent_tier[$tier_number - 1], 2) . '%' . '</td>'; $affiliate_percent_tier_table .= '<td width="15%" align="right" class="boxtext"><a href=' . vam_href_link(FILENAME_AFFILIATE_SALES, 'a_level=' . $tier_number . '&a_period=' . $a_period, 'SSL') . '>' . TEXT_COMMISSION_TIER_COUNT . '</a></td>'; $affiliate_percent_tier_table .= '<td width="5%" class="boxtext">' . ($affiliate_sales[$tier_number]['count'] > 0 ? $affiliate_sales[$tier_number]['count'] : '0') . '</td>'; $affiliate_percent_tier_table .= '<td width="15%" align="right" class="boxtext"><a href=' . vam_href_link(FILENAME_AFFILIATE_SALES, 'a_level=' . $tier_number . '&a_period=' . $a_period, 'SSL') . '>' . TEXT_COMMISSION_TIER_TOTAL . '</a></td>'; $affiliate_percent_tier_table .= '<td width="5%" class="boxtext">' . $vamPrice->Format($affiliate_sales[$tier_number]['total'], true) . '</td>'; $affiliate_percent_tier_table .= '<td width="20%" align="right" class="boxtext"><a href=' . vam_href_link(FILENAME_AFFILIATE_SALES, 'a_level=' . $tier_number . '&a_period=' . $a_period, 'SSL') . '>' . TEXT_COMMISSION_TIER . '</a></td>'; $affiliate_percent_tier_table .= '<td width="5%" class="boxtext">' . $vamPrice->Format($affiliate_sales[$tier_number]['payment'], true) . '</td>'; $affiliate_percent_tier_table .= '</tr>'; } $vamTemplate->assign('affiliate_percent_tier_table', $affiliate_percent_tier_table); } $vamTemplate->assign('LINK_BANNER', '<a class="button" href="' . vam_href_link(FILENAME_AFFILIATE_BANNERS) . '">' . vam_image_button('submit.png', IMAGE_BANNERS) . '</a>'); $vamTemplate->assign('LINK_CLICKS', '<a class="button" href="' . vam_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL') . '">' . vam_image_button('submit.png', IMAGE_CLICKTHROUGHS) . '</a>'); $vamTemplate->assign('LINK_SALES', '<a class="button" href="' . vam_href_link(FILENAME_AFFILIATE_SALES, 'a_period=' . $a_period, 'SSL') . '">' . vam_image_button('submit.png', IMAGE_SALES) . '</a>'); $vamTemplate->assign('language', $_SESSION['language']); $vamTemplate->caching = 0;
} //Informations $contents[] = array('align' => 'center', 'text' => '<div style="padding-top: 5px; font-weight: bold; width: 90%; margin-top: 5px;">' . TEXT_INFORMATIONS . '</div>'); $contents[] = array('text' => '<div style="padding-left: 30px;">' . TEXT_DATE_ADDED . ' ' . vam_date_short($pInfo->products_date_added) . '</div>'); if (vam_not_null($pInfo->products_last_modified)) { $contents[] = array('text' => '<div style="padding-left: 30px;">' . TEXT_LAST_MODIFIED . ' ' . vam_date_short($pInfo->products_last_modified) . '</div>'); } if (date('Y-m-d') < $pInfo->products_date_available) { $contents[] = array('text' => '<div style="padding-left: 30px;">' . TEXT_DATE_AVAILABLE . ' ' . vam_date_short($pInfo->products_date_available) . '</div>'); } // START IN-SOLUTION Berechung des Bruttopreises $price = $pInfo->products_price; $price = vam_round($price, PRICE_PRECISION); $price_string = '' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($price); if (PRICE_IS_BRUTTO == 'true' && ($_GET['read'] == 'only' || $_GET['action'] != 'new_product_preview')) { $price_netto = vam_round($price, PRICE_PRECISION); $tax_query = vam_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . $pInfo->products_tax_class_id . "' "); $tax = vam_db_fetch_array($tax_query); $price = $price * ($tax[tax_rate] + 100) / 100; $price_string = '' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($price) . ' - ' . TXT_NETTO . $currencies->format($price_netto); } $contents[] = array('text' => '<div style="padding-left: 30px;">' . $price_string . '</div><div style="padding-left: 30px;">' . TEXT_PRODUCTS_DISCOUNT_ALLOWED_INFO . ' ' . $pInfo->products_discount_allowed . '</div><div style="padding-left: 30px;">' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity . '</div>'); // END IN-SOLUTION //$contents[] = array('text' => '<br />' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br />' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity); $contents[] = array('text' => '<div style="padding-left: 30px; padding-bottom: 10px;">' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . ' %</div>'); $contents[] = array('text' => '<div style="padding-left: 30px; padding-bottom: 10px;">' . TEXT_PRODUCT_LINKED_TO . '<br />' . vam_output_generated_category_path($pInfo->products_id, 'product') . '</div>'); $contents[] = array('align' => 'center', 'text' => '<div style="padding: 10px;">' . vam_product_thumb_image($pInfo->products_image, $pInfo->products_name) . '</div><div style="padding-bottom: 10px;">' . $pInfo->products_image . '</div>'); } } else { // create category/product info $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');
echo TABLE_HEADING_DATE; ?> </td> </tr> <?php $products_query_raw = vam_db_query("\n SELECT \n p.products_tax_class_id,\n p.products_id, \n pd.products_name, \n p.products_price, \n p.products_date_added, \n p.products_last_modified \n FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id AND pd.language_id = '" . (int) $_SESSION['languages_id'] . "' order by p.products_date_added desc limit 20"); while ($products = vam_db_fetch_array($products_query_raw)) { $rows++; if ($rows / 2 == floor($rows / 2)) { $css_class = 'view_data_even'; } else { $css_class = 'view_data_odd'; } $price = $products['products_price']; $price = vam_round($price, PRICE_PRECISION); ?> <tr> <td class="<?php echo $css_class; ?> "><a href="<?php echo vam_href_link(FILENAME_CATEGORIES, vam_get_all_get_params(array('pID', 'action')) . 'pID=' . $products['products_id'] . '&action=new_product'); ?> "><?php echo $products['products_name']; ?> </a></td> <td class="<?php echo $css_class; ?>
echo "</TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_sortorder\" value=\"" . $sortorder . "\" size=\"4\"></TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_model\" value=\"" . $attribute_value_model . "\" size=\"15\"></TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_stock\" value=\"" . $attribute_value_stock . "\" size=\"4\"></TD>"; echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_weight\" value=\"" . $attribute_value_weight . "\" size=\"10\"></TD>"; echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_weight_prefix\"><OPTION value=\"+\"" . $posCheck_weight . ">+<OPTION value=\"-\"" . $negCheck_weight . ">-</SELECT></TD>"; // brutto Admin if (PRICE_IS_BRUTTO == 'true') { $attribute_value_price_calculate = $vamPrice->Format(vam_round($attribute_value_price * ((100 + vam_get_tax_rate(vam_get_tax_class_id($_POST['current_product_id']))) / 100), PRICE_PRECISION), false); } else { $attribute_value_price_calculate = vam_round($attribute_value_price, PRICE_PRECISION); } echo "<TD class=\"main\" align=\"left\"><input type=\"text\" name=\"" . $current_value_id . "_price\" value=\"" . $attribute_value_price_calculate . "\" size=\"10\">"; // brutto Admin if (PRICE_IS_BRUTTO == 'true') { echo TEXT_NETTO . '<b>' . $vamPrice->Format(vam_round($attribute_value_price, PRICE_PRECISION), true) . '</b> '; } echo "</TD>"; echo "<TD class=\"main\" align=\"left\"><SELECT name=\"" . $current_value_id . "_prefix\"> <OPTION value=\"+\"" . $posCheck . ">+<OPTION value=\"-\"" . $negCheck . ">-</SELECT></TD>"; echo "</TR>"; // Download function start if (DOWNLOAD_ENABLED == 'true') { $file_list = vam_array_merge(array('0' => array('id' => '', 'text' => SELECT_FILE)), vam_getFiles(DIR_FS_CATALOG . 'download/')); echo "<tr>"; // echo "<td colspan=\"2\">File: <input type=\"file\" name=\"" . $current_value_id . "_download_file\"></td>"; // echo "<td colspan=\"2\" class=\"main\"> " . DL_FILE . "<br>" . vam_draw_pull_down_menu($current_value_id . '_download_file', vam_getDownloads(), $attribute_value_download_filename, '')."</td>"; echo "<td colspan=\"2\" class=\"main\"> " . DL_FILE . "<br>" . vam_draw_pull_down_menu($current_value_id . '_download_file', $file_list, $attribute_value_download_filename) . "</td>"; echo "<td class=\"main\"> " . DL_COUNT . "<br><input type=\"text\" name=\"" . $current_value_id . "_download_count\" value=\"" . $attribute_value_download_count . "\"></td>"; echo "<td class=\"main\"> " . DL_EXPIRE . "<br><input type=\"text\" name=\"" . $current_value_id . "_download_expire\" value=\"" . $attribute_value_download_expire . "\"></td>"; ?> <td class="main" align="left"><?php
</tr> <?php $specials_query_raw = "select p.products_id, pd.products_name,p.products_tax_class_id, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "' and p.products_id = s.products_id order by pd.products_name"; $specials_split = new splitPageResults($_GET['page'], MAX_DISPLAY_ADMIN_PAGE, $specials_query_raw, $specials_query_numrows); $specials_query = vam_db_query($specials_query_raw); while ($specials = vam_db_fetch_array($specials_query)) { $price = $specials['products_price']; $new_price = $specials['specials_new_products_price']; if (PRICE_IS_BRUTTO == 'true') { $price_netto = vam_round($price, PRICE_PRECISION); $new_price_netto = vam_round($new_price, PRICE_PRECISION); $price = $price * (vam_get_tax_rate($specials['products_tax_class_id']) + 100) / 100; $new_price = $new_price * (vam_get_tax_rate($specials['products_tax_class_id']) + 100) / 100; } $specials['products_price'] = vam_round($price, PRICE_PRECISION); $specials['specials_new_products_price'] = vam_round($new_price, PRICE_PRECISION); if ((!$_GET['sID'] || $_GET['sID'] == $specials['specials_id']) && !$sInfo) { $products_query = vam_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $specials['products_id'] . "'"); $products = vam_db_fetch_array($products_query); $sInfo_array = vam_array_merge($specials, $products); $sInfo = new objectInfo($sInfo_array); $sInfo->specials_new_products_price = $specials['specials_new_products_price']; $sInfo->products_price = $specials['products_price']; } if (is_object($sInfo) && $specials['specials_id'] == $sInfo->specials_id) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $sInfo->specials_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . vam_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php
echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_6) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?> </td> <td width="15%" class="dataTableContent"><?php echo $currencies->display_price($affiliate_average, ''); ?> </td> </tr> <tr> <td width="35%" align="right" class="dataTableContent"><?php echo TEXT_COMMISSION_RATE; echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_7) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?> </td> <td width="15%" class="dataTableContent"><?php echo vam_round(AFFILIATE_PERCENT, 2) . ' %'; ?> </td> <td width="35%" align="right" class="dataTableContent"><b><?php echo TEXT_COMMISSION; echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_8) . '\')">' . TEXT_SUMMARY_HELP . '</a>'; ?> </b></td> <td width="15%" class="dataTableContent"><b><?php echo $currencies->display_price($affiliate_commission, ''); ?> </b></td> </tr> <tr> <td colspan="4"><?php echo vam_draw_separator();
// load data into array ?> <tr> <td><?php echo $staffel_values['quantity']; ?> </td> <td width="5"> </td> <td nowrap> <?php if (PRICE_IS_BRUTTO == 'true') { $tax_query = vam_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . $pInfo->products_tax_class_id . "' "); $tax = vam_db_fetch_array($tax_query); $products_price = vam_round($staffel_values['personal_offer'] * ((100 + $tax['tax_rate']) / 100), PRICE_PRECISION); } else { $products_price = vam_round($staffel_values['personal_offer'], PRICE_PRECISION); } echo $products_price; if (PRICE_IS_BRUTTO == 'true') { echo ' <br>' . TEXT_NETTO . '<b>' . $vamPrice->Format($staffel_values['personal_offer'], false) . '</b> '; } ?> </td> <td><?php echo vam_draw_separator('pixel_trans.gif', '1', '10'); ?> <a class="button" href="<?php echo vam_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&function=delete&quantity=' . $staffel_values['quantity'] . '&statusID=' . $group_data[$col]['STATUS_ID'] . '&action=new_product&pID=' . $_GET['pID']); ?> "><span><?php echo vam_image(DIR_WS_IMAGES . 'icons/buttons/delete.png', '', '12', '12');