$gv_query = xtc_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customers['customers_id'] . "'");
        $gv_result = xtc_db_fetch_array($gv_query);
        $gv_amount = $gv_result['amount'];
        // vr - 2012-10-27 moved info query into raw query
        // BOF - DokuMan - 2011-09-12 - optimize sql query for customers sales volume - thx to GTB
        $umsatz_query = xtc_db_query("-- admin/customers.php\n                                                SELECT SUM(op.final_price) as ordersum\n                                                  FROM " . TABLE_ORDERS_PRODUCTS . " op\n                                                  JOIN " . TABLE_ORDERS . " o ON o.orders_id = op.orders_id\n                                                 WHERE '" . (int) $customers['customers_id'] . "' = o.customers_id");
        $umsatz = xtc_db_fetch_array($umsatz_query);
        // EOF - DokuMan - 2011-09-12 - optimize sql query for customers sales volume - thx to GTB
        if ((!isset($_GET['cID']) || @$_GET['cID'] == $customers['customers_id']) && !isset($cInfo)) {
            $country_query = xtc_db_query("SELECT countries_name FROM " . TABLE_COUNTRIES . " WHERE countries_id = '" . (int) $customers['entry_country_id'] . "'");
            $country = xtc_db_fetch_array($country_query);
            $reviews_query = xtc_db_query("SELECT count(*) as number_of_reviews FROM " . TABLE_REVIEWS . " WHERE customers_id = '" . (int) $customers['customers_id'] . "'");
            $reviews = xtc_db_fetch_array($reviews_query);
            // vr - 2012-10-27 moved info query into raw query, $info is now part in $customers
            $customer_info = xtc_array_merge($country, $reviews);
            $cInfo_array = xtc_array_merge($customers, $customer_info);
            $cInfo = new objectInfo($cInfo_array);
        }
        if (isset($cInfo) && is_object($cInfo) && $customers['customers_id'] == $cInfo->customers_id) {
            echo '          <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";
        } else {
            echo '          <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_CUSTOMERS, xtc_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";
        }
        $account_type = $customers['account_type'] == 1 ? TEXT_GUEST : TEXT_ACCOUNT;
        ?>
                  <td class="dataTableContent hidden-xs hidden-sm" style="width:40px;"><?php 
        echo $account_type;
        ?>
</td>
                  <td class="dataTableContent" style="width:80px;"><?php 
        echo $customers['customers_cid'];
         $class_method = explode('->', $use_function);
         if (!is_object(${$class_method[0]})) {
             include DIR_WS_CLASSES . $class_method[0] . '.php';
             ${$class_method[0]} = new $class_method[0]();
         }
         $cfgValue = xtc_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
     } else {
         $cfgValue = xtc_call_function($use_function, $configuration['configuration_value']);
     }
 } else {
     $cfgValue = $configuration['configuration_value'];
 }
 if ((!isset($_GET['cID']) || isset($_GET['cID']) && $_GET['cID'] == $configuration['configuration_id']) && !isset($cInfo) && substr($action, 0, 3) != 'new') {
     $cfg_extra_query = xtc_db_query("select configuration_key,configuration_value, date_added, last_modified, use_function, set_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . $configuration['configuration_id'] . "'");
     $cfg_extra = xtc_db_fetch_array($cfg_extra_query);
     $cInfo_array = xtc_array_merge($configuration, $cfg_extra);
     $cInfo = new objectInfo($cInfo_array);
 }
 if ($configuration['set_function']) {
     eval('$value_field = ' . $configuration['set_function'] . '"' . encode_htmlspecialchars($configuration['configuration_value']) . '");');
 } else {
     if ($configuration['configuration_key'] == 'SMTP_PASSWORD') {
         $value_field = xtc_draw_password_field($configuration['configuration_key'], $configuration['configuration_value']);
     } else {
         $value_field = xtc_draw_input_field($configuration['configuration_key'], $configuration['configuration_value'], 'style="width:380px;"');
     }
 }
 if (strstr($value_field, 'configuration_value')) {
     $value_field = str_replace('configuration_value', $configuration['configuration_key'], $value_field);
 }
 // catch up warnings if no language-text defined for configuration-key
 }
 // multi_delete confirm ENDS
 // --------------------
 // multi_copy confirm
 // --------------------
 if (xtc_not_null($_POST['multi_copy'])) {
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');
     $contents[] = array('text' => '<a class="btn btn-default" href="javascript:SwitchCheckCopyConfirm()" onclick="this.blur()">' . BUTTON_REVERSE_SELECTION . '</a>');
     $contents[] = array('text' => '<table width="100%" border="0">');
     if (is_array($_POST['multi_categories'])) {
         foreach ($_POST['multi_categories'] as $multi_category) {
             $category_query = xtc_db_query("SELECT c.categories_id,\n                                                           cd.categories_name,\n                                                           c.categories_image,\n                                                           c.parent_id,\n                                                           c.sort_order,\n                                                           c.date_added,\n                                                           c.last_modified,\n                                                           c.categories_status\n                                                      FROM " . TABLE_CATEGORIES . " AS c,\n                                                           " . TABLE_CATEGORIES_DESCRIPTION . " AS cd\n                                                     WHERE c.categories_id = '" . (int) $multi_category . "'\n                                                       AND c.categories_id = cd.categories_id\n                                                       AND cd.language_id = '" . (int) $_SESSION['languages_id'] . "'");
             $category = xtc_db_fetch_array($category_query);
             $category_childs = array('childs_count' => $catfunc->count_category_childs($multi_category));
             $category_products = array('products_count' => $catfunc->count_category_products($multi_category, true));
             $cInfo_array = xtc_array_merge($category, $category_childs, $category_products);
             $cInfo = new objectInfo($cInfo_array);
             $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid Black; margin-bottom: 10px;" class="infoBoxContent"><b>' . $cInfo->categories_name . '</b></td></tr>');
             if ($cInfo->childs_count > 0) {
                 $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_MOVE_WARNING_CHILDS, $cInfo->childs_count) . '</td></tr>');
             }
             if ($cInfo->products_count > 0) {
                 $contents[] = array('text' => '<tr><td class="infoBoxContent">' . sprintf(TEXT_MOVE_WARNING_PRODUCTS, $cInfo->products_count) . '</td></tr>');
             }
         }
     }
     if (is_array($_POST['multi_products'])) {
         foreach ($_POST['multi_products'] as $multi_product) {
             $contents[] = array('text' => '<tr><td style="border-bottom: 1px solid Black; margin-bottom: 10px;" class="infoBoxContent"><b>' . xtc_get_products_name($multi_product) . '</b></td></tr>');
             $product_categories_string = '';
             $product_categories = xtc_output_generated_category_path($multi_product, 'product');
         $module_n_price = $module_value['value'];
         $module_b_price = $xtPrice->xtcAddTax($module_n_price, $module_tax_rate);
         $module_tax = $xtPrice->calcTax($module_n_price, $module_tax_rate);
     }
     //echo 'MT: '.$module_tax .'<br>'; //DEBUG
     //BOC  web28 - 2012-03-22 - neue anteilige Steuerberechnung Module - ausgenommen bei Versandkosten und Nachnahme ohne Steuer
     if ($module_name != 'shipping' && $module_name != 'cod_fee' && $module_tax_rate == 0) {
         //web28 - 2012-03-14 - FIX Steuerberechnung
         $module_tax = calculate_tax($module_value['value']);
         $module_n_price -= $module_tax;
         //Korrektur für Nettosumme bei Modulen ohne Steuersatz
     }
     //EOC  web28 - 2012-03-22 - neue anteilige Steuerberechnung Module - ausgenommen bei Versandkosten  und Nachnahme ohne Steuer
     $sql_data_array = array('orders_id' => (int) $_POST['oID'], 'n_price' => xtc_db_prepare_input($module_n_price), 'b_price' => xtc_db_prepare_input($module_b_price), 'tax' => xtc_db_prepare_input($module_tax), 'tax_rate' => xtc_db_prepare_input($module_tax_rate));
     $insert_sql_data = array('class' => $module_value['class']);
     $sql_data_array = xtc_array_merge($sql_data_array, $insert_sql_data);
     xtc_db_perform(TABLE_ORDERS_RECALCULATE, $sql_data_array);
     //echo $module_value['value'].'|'.$module_n_price.'|'.$module_tax.'|'.$module_value['class'].'<br>';
 }
 //EOF#######  Module  #######//
 //BOC####### Module ot_tax update ########//
 $tax_rate_query = xtc_db_query("select tax_rate from " . TABLE_ORDERS_RECALCULATE . " where orders_id = '" . (int) $_POST['oID'] . "' and class = 'ot_tax' GROUP BY tax_rate");
 while ($newtax = xtc_db_fetch_array($tax_rate_query)) {
     $new_tax_query = xtc_db_query("\n                                  SELECT SUM(tax) as new_tax_value\n                                    FROM " . TABLE_ORDERS_RECALCULATE . "\n                                   WHERE orders_id = '" . (int) $_POST['oID'] . "'\n                                     AND class != 'products'\n                                     AND tax_rate > 0\n                                     AND tax_rate = '" . $newtax['tax_rate'] . "'\n                                  ");
     $newtax_array = xtc_db_fetch_array($new_tax_query);
     xtc_db_query("UPDATE " . TABLE_ORDERS_RECALCULATE . "\n                     SET tax = '" . xtc_db_prepare_input($newtax_array['new_tax_value']) . "'\n                   WHERE orders_id = '" . (int) $_POST['oID'] . "'\n                     AND tax_rate = '" . xtc_db_prepare_input($newtax['tax_rate']) . "'\n                     AND class = 'ot_tax'\n                 ");
 }
 //EOC####### Module ot_tax update ########//
 //BOF Web28 - 2010-01-15 -  Gesamtsumme NETTO
 $check_no_tax_value_query = xtc_db_query("select count(*) as count from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $_POST['oID'] . "' and class = 'ot_subtotal_no_tax'");
 $check_no_tax_value = xtc_db_fetch_array($check_no_tax_value_query);
    $specials_query = xtc_db_query($specials_query_raw);
    while ($specials = xtc_db_fetch_array($specials_query)) {
        $price = $specials['products_price'];
        $new_price = $specials['specials_new_products_price'];
        if (PRICE_IS_BRUTTO == 'true') {
            $price_netto = xtc_round($price, PRICE_PRECISION);
            $new_price_netto = xtc_round($new_price, PRICE_PRECISION);
            $price = $price * (xtc_get_tax_rate($specials['products_tax_class_id']) + 100) / 100;
            $new_price = $new_price * (xtc_get_tax_rate($specials['products_tax_class_id']) + 100) / 100;
        }
        $specials['products_price'] = xtc_round($price, PRICE_PRECISION);
        $specials['specials_new_products_price'] = xtc_round($new_price, PRICE_PRECISION);
        if ((!$_GET['sID'] || $_GET['sID'] == $specials['specials_id']) && !$sInfo) {
            $products_query = xtc_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $specials['products_id'] . "'");
            $products = xtc_db_fetch_array($products_query);
            $sInfo_array = xtc_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=\'pointer\'" onclick="document.location.href=\'' . xtc_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=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_SPECIALS, 'page=' . $_GET['page'] . '&sID=' . $specials['specials_id']) . '\'">' . "\n";
        }
        ?>
                <td  class="dataTableContent"><?php 
        echo $specials['products_name'];
        ?>
</td>
                <td  class="dataTableContent" align="right"><span class="oldPrice">
Esempio n. 6
0
/**
 * xtc_prepare_country_zones_pull_down()
 *
 * @param string $country_id
 * @return
 */
function xtc_prepare_country_zones_pull_down($country_id = '')
{
    // preset the width of the drop-down for Netscape
    $pre = '';
    if (!xtc_browser_detect('MSIE') && xtc_browser_detect('Mozilla/4')) {
        for ($i = 0; $i < 45; $i++) {
            $pre .= '&nbsp;';
        }
    }
    $zones = xtc_get_country_zones($country_id);
    if (sizeof($zones) > 0) {
        $zones_select = array(array('id' => '', 'text' => PLEASE_SELECT));
        $zones = xtc_array_merge($zones_select, $zones);
    } else {
        $zones = array(array('id' => '', 'text' => TYPE_BELOW));
        // create dummy options for Netscape to preset the height of the drop-down
        if (!xtc_browser_detect('MSIE') && xtc_browser_detect('Mozilla/4')) {
            for ($i = 0; $i < 9; $i++) {
                $zones[] = array('id' => '', 'text' => $pre);
            }
        }
    }
    return $zones;
}
    ?>
</td>
                <td class="dataTableHeadingContent" align="right"><?php 
    echo TABLE_HEADING_ACTION;
    ?>
&nbsp;</td>
              </thead>
<?php 
    $banners_query_raw = "select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from " . TABLE_BANNERS . " order by banners_title, banners_group";
    $banners_split = new splitPageResults($_GET['page'], '20', $banners_query_raw, $banners_query_numrows);
    $banners_query = xtc_db_query($banners_query_raw);
    while ($banners = xtc_db_fetch_array($banners_query)) {
        $info_query = xtc_db_query("select sum(banners_shown) as banners_shown, sum(banners_clicked) as banners_clicked from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banners['banners_id'] . "'");
        $info = xtc_db_fetch_array($info_query);
        if ((!$_GET['bID'] || $_GET['bID'] == $banners['banners_id']) && !$bInfo && substr($_GET['action'], 0, 3) != 'new') {
            $bInfo_array = xtc_array_merge($banners, $info);
            $bInfo = new objectInfo($bInfo_array);
        }
        $banners_shown = $info['banners_shown'] != '' ? $info['banners_shown'] : '0';
        $banners_clicked = $info['banners_clicked'] != '' ? $info['banners_clicked'] : '0';
        if (is_object($bInfo) && $banners['banners_id'] == $bInfo->banners_id) {
            echo '              <tbody class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_BANNER_STATISTICS, 'page=' . $_GET['page'] . '&bID=' . $bInfo->banners_id) . '\'">' . "\n";
        } else {
            echo '              <tbody class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $banners['banners_id']) . '\'">' . "\n";
        }
        ?>
<!-- BOF - Tomcraft - 2009-06-10 - added some missing alternative text on admin icons -->
<!--
                <td class="dataTableContent"><?php 
        echo '<a href="javascript:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '?banner=' . $banners['banners_id'] . '\')">' . xtc_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Banner') . '</a>&nbsp;' . $banners['banners_title'];
        ?>
             if ($check_if_name_exist['campaigns_id'] != $campaigns_id) {
                 $error[] = ERROR_TEXT_NAME;
             }
         } else {
             $error[] = ERROR_TEXT_NAME;
         }
     }
     if (empty($error)) {
         if ($_GET['action'] == 'insert') {
             $insert_sql_data = array('date_added' => 'now()');
             $sql_data_array = xtc_array_merge($sql_data_array, $insert_sql_data);
             xtc_db_perform(TABLE_CAMPAIGNS, $sql_data_array);
             $campaigns_id = xtc_db_insert_id();
         } elseif ($_GET['action'] == 'save') {
             $update_sql_data = array('last_modified' => 'now()');
             $sql_data_array = xtc_array_merge($sql_data_array, $update_sql_data);
             xtc_db_perform(TABLE_CAMPAIGNS, $sql_data_array, 'update', "campaigns_id = '" . xtc_db_input($campaigns_id) . "'");
         }
         xtc_redirect(xtc_href_link(FILENAME_CAMPAIGNS, 'page=' . $_GET['page'] . '&cID=' . $campaigns_id));
     } else {
         $_SESSION['repopulate_form'] = $_REQUEST;
         $_SESSION['errors'] = $error;
         xtc_redirect(xtc_href_link(FILENAME_CAMPAIGNS, 'page=' . $_GET['page'] . '&cID=' . $campaigns_id . '&action=' . $url_action . '&errors=1'));
     }
     break;
 case 'deleteconfirm':
     $campaigns_id = xtc_db_prepare_input($_GET['cID']);
     xtc_db_query("delete from " . TABLE_CAMPAIGNS . " where campaigns_id = '" . xtc_db_input($campaigns_id) . "'");
     xtc_db_query("delete from " . TABLE_CAMPAIGNS_IP . " where campaign = '" . xtc_db_input($campaigns_id) . "'");
     if ($_POST['delete_refferers'] == 'on') {
         xtc_db_query("update " . TABLE_ORDERS . " set refferers_id = '' where refferers_id = '" . xtc_db_input($campaigns_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 * \n                FROM " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " \n               WHERE products_options_values_id = '" . $_POST['optionValues'][$i] . "'";
    $result = xtc_db_query($query);
    $matches = xtc_db_num_rows($result);
    while ($line = xtc_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 / (xtc_get_tax_rate(xtc_get_tax_class_id($_POST['current_product_id'])) + 100) * 100;
    }
    $value_price = xtc_round($value_price, PRICE_PRECISION);
    //default values
    $sql_data_array = array('products_id' => $_POST['current_product_id'], 'options_id' => $optionsID, 'options_values_id' => $_POST['optionValues'][$i], 'options_values_price' => $value_price, 'price_prefix' => $_POST[$cv_id . '_prefix'], 'attributes_model' => xtc_db_prepare_input($_POST[$cv_id . '_model']), 'attributes_stock' => $_POST[$cv_id . '_stock'], 'options_values_weight' => $_POST[$cv_id . '_weight'], 'weight_prefix' => $_POST[$cv_id . '_weight_prefix'], 'sortorder' => $_POST[$cv_id . '_sortorder']);
    //additional values
    $add_data_array = array('attributes_ean' => xtc_db_prepare_input($_POST[$cv_id . '_ean']));
    $sql_data_array = xtc_array_merge($sql_data_array, $add_data_array);
    xtc_db_perform(TABLE_PRODUCTS_ATTRIBUTES, $sql_data_array);
    $products_attributes_id = xtc_db_insert_id();
    if ($_POST[$cv_id . '_download_file'] != '') {
        $value_download_file = $_POST[$cv_id . '_download_file'];
        $value_download_expire = $_POST[$cv_id . '_download_expire'];
        $value_download_count = $_POST[$cv_id . '_download_count'];
        $sql_data_array = array('products_attributes_id' => $products_attributes_id, 'products_attributes_filename' => xtc_db_prepare_input($value_download_file), 'products_attributes_maxdays' => $value_download_expire, 'products_attributes_maxcount' => $value_download_count);
        xtc_db_perform(TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD, $sql_data_array);
    }
}
xtc_db_query('UPDATE ' . TABLE_PRODUCTS . ' SET products_last_modified=now() WHERE products_id=' . (int) $_POST['current_product_id']);
//DokuMan - 2010-09-21 - set modified date on product
 function insert_product($products_data, $dest_category_id, $link, $action = 'insert')
 {
     $products_id = xtc_db_prepare_input($products_data['products_id']);
     $products_date_available = xtc_db_prepare_input($products_data['products_date_available']);
     $products_date_available = date('Y-m-d') < $products_date_available ? $products_date_available : 'null';
     $products_status = xtc_db_prepare_input($products_data['products_status']);
     if ($products_data['products_startpage'] == 1) {
         $this->link_product($products_data['products_id'], 0);
         //$products_status = 1;    //web28 2012-10-30 - don't set status active
     } else {
         $this->set_product_remove_startpage_sql($products_data['products_id'], 0);
         //Dokuman - 2009-11-12 - BUGFIX #0000351: When products disable display on startpage, should update table products_to_categories
     }
     if (PRICE_IS_BRUTTO == 'true' && $products_data['products_price']) {
         $products_data['products_price'] = round($products_data['products_price'] / (xtc_get_tax_rate($products_data['products_tax_class_id']) + 100) * 100, PRICE_PRECISION);
     }
     $customers_statuses_array = xtc_get_customers_statuses();
     $permission = array();
     for ($i = 0, $n = sizeof($customers_statuses_array); $i < $n; $i++) {
         if (isset($customers_statuses_array[$i]['id'])) {
             $permission[$customers_statuses_array[$i]['id']] = 0;
         }
     }
     if (isset($products_data['groups'])) {
         foreach ($products_data['groups'] as $dummy => $b) {
             $permission[$b] = 1;
         }
     }
     // build array
     if ($permission['all'] == 1) {
         $permission = array();
         end($customers_statuses_array);
         for ($i = 0, $n = key($customers_statuses_array); $i < $n + 1; $i++) {
             if (isset($customers_statuses_array[$i]['id'])) {
                 $permission[$customers_statuses_array[$i]['id']] = 1;
             }
         }
     }
     $permission_array = array();
     // set pointer to last key
     end($customers_statuses_array);
     for ($i = 0, $n = key($customers_statuses_array); $i < $n + 1; $i++) {
         if (isset($customers_statuses_array[$i]['id'])) {
             $permission_array = array_merge($permission_array, array('group_permission_' . $customers_statuses_array[$i]['id'] => $permission[$customers_statuses_array[$i]['id']]));
         }
     }
     $sql_data_array = array('products_quantity' => xtc_db_prepare_input($products_data['products_quantity']), 'products_model' => xtc_db_prepare_input($products_data['products_model']), 'products_ean' => xtc_db_prepare_input($products_data['products_ean']), 'products_price' => xtc_db_prepare_input($products_data['products_price']), 'products_sort' => xtc_db_prepare_input($products_data['products_sort']), 'products_shippingtime' => xtc_db_prepare_input($products_data['shipping_status']), 'products_discount_allowed' => xtc_db_prepare_input($products_data['products_discount_allowed']), 'products_date_available' => $products_date_available, 'products_weight' => xtc_db_prepare_input($products_data['products_weight']), 'products_status' => $products_status, 'products_startpage' => xtc_db_prepare_input($products_data['products_startpage']), 'products_startpage_sort' => xtc_db_prepare_input($products_data['products_startpage_sort']), 'products_tax_class_id' => xtc_db_prepare_input($products_data['products_tax_class_id']), 'product_template' => xtc_db_prepare_input($products_data['info_template']), 'options_template' => xtc_db_prepare_input($products_data['options_template']), 'manufacturers_id' => xtc_db_prepare_input($products_data['manufacturers_id']), 'products_fsk18' => xtc_db_prepare_input($products_data['fsk18']), 'products_vpe_value' => xtc_db_prepare_input($products_data['products_vpe_value']), 'products_vpe_status' => xtc_db_prepare_input($products_data['products_vpe_status']), 'products_vpe' => xtc_db_prepare_input($products_data['products_vpe']), 'wholesaler_id' => xtc_db_prepare_input($products_data['wholesaler_id']), 'wholesaler_reorder' => xtc_db_prepare_input($products_data['wholesaler_reorder']));
     if (trim(ADD_PRODUCTS_FIELDS) != '') {
         $sql_data_array = array_merge($sql_data_array, $this->add_data_fields(ADD_PRODUCTS_FIELDS, $products_data));
     }
     //echo print_r($sql_data_array); EXIT;
     $sql_data_array = array_merge($sql_data_array, $permission_array);
     //get the next ai-value from table products if no products_id is set
     if (!$products_id || $products_id == '') {
         $new_pid_query = xtc_db_query("SHOW TABLE STATUS LIKE '" . TABLE_PRODUCTS . "'");
         $new_pid_query_values = xtc_db_fetch_array($new_pid_query);
         $products_id = $new_pid_query_values['Auto_increment'];
     }
     //prepare products_image filename
     $accepted_products_image_files_extensions = array("jpg", "jpeg", "jpe", "gif", "png", "bmp", "tiff", "tif", "bmp");
     $accepted_products_image_files_mime_types = array("image/jpeg", "image/gif", "image/png", "image/bmp");
     if ($products_image = xtc_try_upload('products_image', DIR_FS_CATALOG_ORIGINAL_IMAGES, '777', $accepted_products_image_files_extensions, $accepted_products_image_files_mime_types)) {
         $pname_arr = explode('.', $products_image->filename);
         $nsuffix = array_pop($pname_arr);
         $products_image_name = $products_id . '_0.' . $nsuffix;
         $dup_check_query = xtc_db_query("SELECT COUNT(*) AS total\n                                                FROM " . TABLE_PRODUCTS . "\n                                               WHERE products_image = '" . $products_data['products_previous_image_0'] . "'");
         $dup_check = xtc_db_fetch_array($dup_check_query);
         if ($dup_check['total'] < 2) {
             @xtc_del_image_file($products_data['products_previous_image_0']);
         }
         //workaround if there are v2 images mixed with v3
         $dup_check_query = xtc_db_query("SELECT COUNT(*) AS total\n                                                FROM " . TABLE_PRODUCTS . "\n                                               WHERE products_image = '" . $products_image->filename . "'");
         $dup_check = xtc_db_fetch_array($dup_check_query);
         if ($dup_check['total'] == 0) {
             rename(DIR_FS_CATALOG_ORIGINAL_IMAGES . $products_image->filename, DIR_FS_CATALOG_ORIGINAL_IMAGES . $products_image_name);
         } else {
             copy(DIR_FS_CATALOG_ORIGINAL_IMAGES . $products_image->filename, DIR_FS_CATALOG_ORIGINAL_IMAGES . $products_image_name);
         }
         $sql_data_array['products_image'] = xtc_db_prepare_input($products_image_name);
         require DIR_WS_INCLUDES . 'product_thumbnail_images.php';
         require DIR_WS_INCLUDES . 'product_info_images.php';
         require DIR_WS_INCLUDES . 'product_popup_images.php';
         // set file rights
         $this->set_products_images_file_rights($products_image_name);
     } else {
         // save, when wo no upload an image
         $mo_img = array('image_title' => xtc_db_prepare_input($products_data['image_title'][$img + 1]), 'image_alt' => xtc_db_prepare_input($products_data['image_alt'][$img + 1]));
         if ($action == 'update' && $products_data['products_previous_image_' . ($img + 1)]) {
             if ($products_data['del_mo_pic']) {
                 foreach ($products_data['del_mo_pic'] as $dummy => $val) {
                     if ($val == $products_data['products_previous_image_' . ($img + 1)]) {
                         xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img);
                     }
                     break;
                 }
             }
             xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img, 'update', 'image_name = \'' . xtc_db_input($products_data['products_previous_image_' . ($img + 1)]) . '\'');
         } elseif (!$products_data['products_previous_image_' . ($img + 1)]) {
             xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img);
         }
         $products_image_name = $products_data['products_previous_image_0'];
     }
     //are we asked to delete some pics?
     if ($products_data['del_pic'] != '') {
         $dup_check_query = xtc_db_query("SELECT COUNT(*) AS total\n                                                FROM " . TABLE_PRODUCTS . "\n                                               WHERE products_image = '" . $products_data['del_pic'] . "'");
         $dup_check = xtc_db_fetch_array($dup_check_query);
         if ($dup_check['total'] < 2) {
             @xtc_del_image_file($products_data['del_pic']);
         }
         xtc_db_query("UPDATE " . TABLE_PRODUCTS . "\n                         SET products_image = NULL\n                       WHERE products_id    = '" . xtc_db_input($products_id) . "'");
     }
     if ($products_data['del_mo_pic'] != '') {
         foreach ($products_data['del_mo_pic'] as $dummy => $val) {
             $dup_check_query = xtc_db_query("SELECT COUNT(*) AS total\n                                                      FROM " . TABLE_PRODUCTS_IMAGES . "\n                                                     WHERE image_name = '" . $val . "'");
             $dup_check = xtc_db_fetch_array($dup_check_query);
             if ($dup_check['total'] < 2) {
                 @xtc_del_image_file($val);
             }
             xtc_db_query("DELETE FROM " . TABLE_PRODUCTS_IMAGES . "\n                                     WHERE products_id = '" . xtc_db_input($products_id) . "'\n                                       AND image_name  = '" . $val . "'");
         }
     }
     //MO_PICS
     $accepted_mo_pics_image_files_extensions = array("jpg", "jpeg", "jpe", "gif", "png", "bmp", "tiff", "tif", "bmp");
     $accepted_mo_pics_image_files_mime_types = array("image/jpeg", "image/gif", "image/png", "image/bmp");
     for ($img = 0; $img < MO_PICS; $img++) {
         if ($pIMG = xtc_try_upload('mo_pics_' . $img, DIR_FS_CATALOG_ORIGINAL_IMAGES, '777', $accepted_mo_pics_image_files_extensions, $accepted_mo_pics_image_files_mime_types)) {
             $pname_arr = explode('.', $pIMG->filename);
             $nsuffix = array_pop($pname_arr);
             $products_image_name = $products_id . '_' . ($img + 1) . '.' . $nsuffix;
             $dup_check_query = xtc_db_query("SELECT COUNT(*) AS total\n                                                      FROM " . TABLE_PRODUCTS_IMAGES . "\n                                                     WHERE image_name = '" . $products_data['products_previous_image_' . ($img + 1)] . "'");
             $dup_check = xtc_db_fetch_array($dup_check_query);
             if ($dup_check['total'] < 2) {
                 @xtc_del_image_file($products_data['products_previous_image_' . ($img + 1)]);
             }
             @xtc_del_image_file($products_image_name);
             rename(DIR_FS_CATALOG_ORIGINAL_IMAGES . '/' . $pIMG->filename, DIR_FS_CATALOG_ORIGINAL_IMAGES . '/' . $products_image_name);
             //get data & write to table
             // $mo_img = array ('products_id' => xtc_db_prepare_input($products_id), 'image_nr' => xtc_db_prepare_input($img +1), 'image_name' => xtc_db_prepare_input($products_image_name));
             $mo_img = array('products_id' => xtc_db_prepare_input($products_id), 'image_nr' => xtc_db_prepare_input($img + 1), 'image_name' => xtc_db_prepare_input($products_image_name), 'image_title' => xtc_db_prepare_input($products_data['image_title'][$img + 1]), 'image_alt' => xtc_db_prepare_input($products_data['image_alt'][$img + 1]));
             if ($action == 'insert') {
                 xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img);
             } elseif ($action == 'update' && $products_data['products_previous_image_' . ($img + 1)]) {
                 if ($products_data['del_mo_pic']) {
                     foreach ($products_data['del_mo_pic'] as $dummy => $val) {
                         if ($val == $products_data['products_previous_image_' . ($img + 1)]) {
                             xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img);
                         }
                         break;
                     }
                 }
                 xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img, 'update', 'image_name = \'' . xtc_db_input($products_data['products_previous_image_' . ($img + 1)]) . '\'');
             } elseif (!$products_data['products_previous_image_' . ($img + 1)]) {
                 xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img);
             }
             //image processing
             require DIR_WS_INCLUDES . 'product_thumbnail_images.php';
             require DIR_WS_INCLUDES . 'product_info_images.php';
             require DIR_WS_INCLUDES . 'product_popup_images.php';
             //set file rights
             $this->set_products_images_file_rights($products_image_name);
         }
     }
     if (is_array($products_data['image_title'])) {
         foreach ($products_data['image_title'] as $it_image_nr => $it_image_title) {
             $mo_img = array('image_title' => xtc_db_prepare_input($it_image_title));
             xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img, 'update', 'image_nr = \'' . xtc_db_prepare_input($it_image_nr + 1) . '\' AND products_id = \'' . xtc_db_prepare_input($products_id) . '\'');
         }
     }
     if (is_array($products_data['image_alt'])) {
         foreach ($products_data['image_alt'] as $ia_image_nr => $ia_image_title) {
             $mo_img = array('image_alt' => xtc_db_prepare_input($ia_image_title));
             xtc_db_perform(TABLE_PRODUCTS_IMAGES, $mo_img, 'update', 'image_nr = \'' . xtc_db_prepare_input($ia_image_nr + 1) . '\' AND products_id = \'' . xtc_db_prepare_input($products_id) . '\'');
         }
     }
     if (isset($products_data['products_image']) && xtc_not_null($products_data['products_image']) && $products_data['products_image'] != 'none') {
         $sql_data_array['products_image'] = xtc_db_prepare_input($products_data['products_image']);
     }
     if ($action == 'insert') {
         $insert_sql_data = array('products_date_added' => 'now()');
         $sql_data_array = xtc_array_merge($sql_data_array, $insert_sql_data);
         xtc_db_perform(TABLE_PRODUCTS, $sql_data_array);
         $products_id = xtc_db_insert_id();
         xtc_db_query("INSERT INTO " . TABLE_PRODUCTS_TO_CATEGORIES . "\n                              SET products_id   = '" . $products_id . "',\n                              categories_id = '" . $dest_category_id . "'");
         // web28 - 2012-03-11 - link product to startpage
         /* not longer needed
            if ($products_data['products_startpage'] == 1 ) {
              xtc_db_query("INSERT INTO ".TABLE_PRODUCTS_TO_CATEGORIES."
                                    SET products_id   = '".$products_id."',
                                        categories_id = '0'");
            }
            */
     } elseif ($action == 'update') {
         $update_sql_data = array('products_last_modified' => 'now()');
         $sql_data_array = xtc_array_merge($sql_data_array, $update_sql_data);
         xtc_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', 'products_id = \'' . xtc_db_input($products_id) . '\'');
     }
     //Included specials
     if (file_exists("includes/modules/categories_specials.php")) {
         require_once "includes/modules/categories_specials.php";
         saveSpecialsData($products_id);
     }
     $languages = xtc_get_languages();
     // Here we go, lets write Group prices into db
     // start
     $i = 0;
     $group_query = xtc_db_query("SELECT customers_status_id\n                                         FROM " . TABLE_CUSTOMERS_STATUS . "\n                                        WHERE language_id = '" . (int) $_SESSION['languages_id'] . "'\n                                          AND customers_status_id != '0'");
     while ($group_values = xtc_db_fetch_array($group_query)) {
         // load data into array
         $i++;
         $group_data[$i] = array('STATUS_ID' => $group_values['customers_status_id']);
     }
     for ($col = 0, $n = sizeof($group_data); $col < $n + 1; $col++) {
         if ($group_data[$col]['STATUS_ID'] != '') {
             $personal_price = xtc_db_prepare_input($products_data['products_price_' . $group_data[$col]['STATUS_ID']]);
             if ($personal_price == '' || $personal_price == '0.0000') {
                 $personal_price = '0.00';
             } else {
                 if (PRICE_IS_BRUTTO == 'true') {
                     $personal_price = $personal_price / (xtc_get_tax_rate($products_data['products_tax_class_id']) + 100) * 100;
                 }
                 $personal_price = xtc_round($personal_price, PRICE_PRECISION);
             }
             if ($action == 'insert') {
                 xtc_db_query("DELETE FROM personal_offers_by_customers_status_" . $group_data[$col]['STATUS_ID'] . "\n                              WHERE products_id = '" . $products_id . "'\n                                AND quantity    = '1'");
                 $insert_array = array();
                 $insert_array = array('personal_offer' => $personal_price, 'quantity' => '1', 'products_id' => $products_id);
                 xtc_db_perform("personal_offers_by_customers_status_" . $group_data[$col]['STATUS_ID'], $insert_array);
             } else {
                 xtc_db_query("UPDATE personal_offers_by_customers_status_" . $group_data[$col]['STATUS_ID'] . "\n                                         SET personal_offer = '" . $personal_price . "'\n                                       WHERE products_id = '" . $products_id . "'\n                                         AND quantity    = '1'");
             }
         }
     }
     // end
     // ok, lets check write new staffelpreis into db (if there is one)
     $i = 0;
     $group_query = xtc_db_query("SELECT customers_status_id\n                                         FROM " . TABLE_CUSTOMERS_STATUS . "\n                                        WHERE language_id = '" . (int) $_SESSION['languages_id'] . "'\n                                          AND customers_status_id != '0'");
     while ($group_values = xtc_db_fetch_array($group_query)) {
         // load data into array
         $i++;
         $group_data[$i] = array('STATUS_ID' => $group_values['customers_status_id']);
     }
     for ($col = 0, $n = sizeof($group_data); $col < $n + 1; $col++) {
         if ($group_data[$col]['STATUS_ID'] != '') {
             $quantity = xtc_db_prepare_input($products_data['products_quantity_staffel_' . $group_data[$col]['STATUS_ID']]);
             $staffelpreis = xtc_db_prepare_input($products_data['products_price_staffel_' . $group_data[$col]['STATUS_ID']]);
             if (PRICE_IS_BRUTTO == 'true') {
                 $staffelpreis = $staffelpreis / (xtc_get_tax_rate($products_data['products_tax_class_id']) + 100) * 100;
             }
             $staffelpreis = xtc_round($staffelpreis, PRICE_PRECISION);
             if ($staffelpreis != '' && $quantity != '') {
                 // ok, lets check entered data to get rid of user faults
                 if ($quantity <= 1) {
                     $quantity = 2;
                 }
                 $check_query = xtc_db_query("SELECT quantity\n                                                           FROM personal_offers_by_customers_status_" . $group_data[$col]['STATUS_ID'] . "\n                                                          WHERE products_id = '" . $products_id . "'\n                                                            AND quantity    = '" . $quantity . "'");
                 // dont insert if same qty!
                 if (xtc_db_num_rows($check_query) < 1) {
                     xtc_db_query("INSERT INTO personal_offers_by_customers_status_" . $group_data[$col]['STATUS_ID'] . "\n                                                   SET price_id       = '',\n                                                       products_id    = '" . $products_id . "',\n                                                       quantity       = '" . $quantity . "',\n                                                       personal_offer = '" . $staffelpreis . "'");
                 }
             }
         }
     }
     foreach ($languages as $lang) {
         $language_id = $lang['id'];
         $sql_data_array = array('products_name' => xtc_db_prepare_input($products_data['products_name'][$language_id]), 'products_description' => xtc_db_prepare_input($products_data['products_description_' . $language_id]), 'products_short_description' => xtc_db_prepare_input($products_data['products_short_description_' . $language_id]), 'products_keywords' => xtc_db_prepare_input($products_data['products_keywords'][$language_id]), 'products_url' => xtc_db_prepare_input($products_data['products_url'][$language_id]), 'products_meta_title' => xtc_db_prepare_input($products_data['products_meta_title'][$language_id]), 'products_meta_description' => xtc_db_prepare_input($products_data['products_meta_description'][$language_id]), 'products_meta_keywords' => xtc_db_prepare_input($products_data['products_meta_keywords'][$language_id]));
         if (trim(ADD_PRODUCTS_DESCRIPTION_FIELDS)) {
             $sql_data_array = array_merge($sql_data_array, $this->add_data_fields(ADD_PRODUCTS_DESCRIPTION_FIELDS, $products_data, $language_id));
         }
         if ($action == 'insert') {
             $insert_sql_data = array('products_id' => $products_id, 'language_id' => $language_id);
             $sql_data_array = xtc_array_merge($sql_data_array, $insert_sql_data);
             xtc_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
         } elseif ($action == 'update') {
             //BOF - web28 - 2010-07-11 - BUGFIX no entry stored for previous deactivated languages
             $product_query = xtc_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . "\n                                               WHERE language_id = '" . $lang['id'] . "'\n                                                 AND products_id = '" . $products_id . "'");
             if (xtc_db_num_rows($product_query) == 0) {
                 xtc_db_perform(TABLE_PRODUCTS_DESCRIPTION, array('products_id' => $products_id, 'language_id' => $lang['id']));
             }
             //EOF - web28 - 2010-07-11 - BUGFIX no entry stored for previous deactivated languages
             xtc_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', 'products_id = \'' . xtc_db_input($products_id) . '\' and language_id = \'' . $language_id . '\'');
         }
     }
     //redirect by update button
     if (isset($products_data['prod_update'])) {
         xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&action=new_product&pID=' . $products_id . $this->page_parameter));
     }
     xtc_redirect(xtc_href_link(FILENAME_CATEGORIES, xtc_get_path($dest_categories_id) . '&pID=' . $products_id . $this->page_parameter));
     //web28 2012-04-14 new redirect
 }
Esempio n. 11
0
<?php 
    $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'], '20', $reviews_query_raw, $reviews_query_numrows);
    $reviews_query = xtc_db_query($reviews_query_raw);
    while ($reviews = xtc_db_fetch_array($reviews_query)) {
        if ((!$_GET['rID'] || $_GET['rID'] == $reviews['reviews_id']) && !$rInfo) {
            $reviews_text_query = xtc_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 = '" . $reviews['reviews_id'] . "' and r.reviews_id = rd.reviews_id");
            $reviews_text = xtc_db_fetch_array($reviews_text_query);
            $products_image_query = xtc_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . $reviews['products_id'] . "'");
            $products_image = xtc_db_fetch_array($products_image_query);
            $products_name_query = xtc_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $reviews['products_id'] . "' and language_id = '" . $_SESSION['languages_id'] . "'");
            $products_name = xtc_db_fetch_array($products_name_query);
            $reviews_average_query = xtc_db_query("select (avg(reviews_rating) / 5 * 100) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . $reviews['products_id'] . "'");
            $reviews_average = xtc_db_fetch_array($reviews_average_query);
            $review_info = xtc_array_merge($reviews_text, $reviews_average, $products_name);
            $rInfo_array = xtc_array_merge($reviews, $review_info, $products_image);
            $rInfo = new objectInfo($rInfo_array);
        }
        if (is_object($rInfo) && $reviews['reviews_id'] == $rInfo->reviews_id) {
            echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $rInfo->reviews_id . '&action=preview') . '\'">' . "\n";
        } else {
            echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews['reviews_id']) . '\'">' . "\n";
        }
        ?>
                <td class="dataTableContent"><?php 
        echo '<a href="' . xtc_href_link(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews['reviews_id'] . '&action=preview') . '">' . xtc_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . xtc_get_products_name($reviews['products_id']);
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        echo xtc_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/stars_' . $reviews['reviews_rating'] . '.gif');
        ?>
?>
</td>
                <td class="dataTableHeadingContent" align="right"><?php 
echo TABLE_HEADING_ACTION;
?>
&nbsp;</td>
              </tr>
<?php 
$manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";
$manufacturers_split = new splitPageResults($_GET['page'], '20', $manufacturers_query_raw, $manufacturers_query_numrows);
$manufacturers_query = xtc_db_query($manufacturers_query_raw);
while ($manufacturers = xtc_db_fetch_array($manufacturers_query)) {
    if ((!$_GET['mID'] || @$_GET['mID'] == $manufacturers['manufacturers_id']) && !$mInfo && substr($_GET['action'], 0, 3) != 'new') {
        $manufacturer_products_query = xtc_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where manufacturers_id = '" . $manufacturers['manufacturers_id'] . "'");
        $manufacturer_products = xtc_db_fetch_array($manufacturer_products_query);
        $mInfo_array = xtc_array_merge($manufacturers, $manufacturer_products);
        $mInfo = new objectInfo($mInfo_array);
    }
    if (is_object($mInfo) && $manufacturers['manufacturers_id'] == $mInfo->manufacturers_id) {
        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers['manufacturers_id'] . '&action=edit') . '#edit-box\'">' . "\n";
    } else {
        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_MANUFACTURERS, 'page=' . $_GET['page'] . '&mID=' . $manufacturers['manufacturers_id']) . '#edit-box\'">' . "\n";
    }
    ?>
                <td class="dataTableContent"><?php 
    echo $manufacturers['manufacturers_name'];
    ?>
</td>
<!-- BOF - Tomcraft - 2009-06-10 - added some missing alternative text on admin icons -->
<!--
                <td class="dataTableContent" align="right"><?php 
?>
</td>
                <td class="dataTableHeadingContent" align="right"><?php 
echo TABLE_HEADING_ACTION;
?>
&nbsp;</td>
              </tr>
<?php 
$wholesalers_query_raw = "select wholesaler_id, wholesaler_name, wholesaler_email, wholesaler_email_template from " . TABLE_WHOLESALERS . " order by wholesaler_name";
$wholesalers_split = new splitPageResults($_GET['page'], '20', $wholesalers_query_raw, $wholesalers_query_numrows);
$wholesalers_query = xtc_db_query($wholesalers_query_raw);
while ($wholesalers = xtc_db_fetch_array($wholesalers_query)) {
    if ((!$_GET['wID'] || @$_GET['wID'] == $wholesalers['wholesaler_id']) && !$mInfo && substr($_GET['action'], 0, 3) != 'new') {
        $wholesaler_products_query = xtc_db_query("select count(*) as products_count from " . TABLE_PRODUCTS . " where wholesaler_id = '" . $wholesalers['wholesaler_id'] . "'");
        $wholesaler_products = xtc_db_fetch_array($wholesaler_products_query);
        $mInfo_array = xtc_array_merge($wholesalers, $wholesaler_products);
        $mInfo = new objectInfo($mInfo_array);
    }
    if (is_object($mInfo) && $wholesalers['wholesaler_id'] == $mInfo->wholesaler_id) {
        echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_WHOLESALERS, 'page=' . $_GET['page'] . '&wID=' . $wholesalers['wholesaler_id'] . '&action=edit') . '#edit-box\'">' . "\n";
    } else {
        echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . xtc_href_link(FILENAME_WHOLESALERS, 'page=' . $_GET['page'] . '&wID=' . $wholesalers['wholesaler_id']) . '#edit-box\'">' . "\n";
    }
    ?>
                <td class="dataTableContent"><?php 
    echo $wholesalers['wholesaler_name'];
    ?>
</td>
                <td class="dataTableContent hidden-xs"><?php 
    echo $wholesalers['wholesaler_email'];
    ?>