function process($file)
 {
     @olc_set_time_limit(0);
     //$schema = 'Produktbezeichnung;Beschreibung;Preis;Url;Bild;Währung;Kategorie;Gültig bis;Gültig ab;FSK;Typ;Produkt id;Hersteller;Bestellnummer;Suchbegriffe;Preistyp' . NEW_LINE;
     $export_query = olc_db_query("SELECT\n                             p.products_id,\n                             pd.products_name,\n                             pd.products_description,\n                             p.products_model,\n                             p.products_image,\n                             p.products_price,\n                             p.products_status,\n                             p.products_date_available,\n                             p.products_shippingtime,\n                             p.products_discount_allowed,\n                             pd.products_meta_keywords,\n                             p.products_tax_class_id,\n                             p.products_date_added,\n                             m.manufacturers_name\n                         FROM\n                             " . TABLE_PRODUCTS . " p LEFT JOIN\n                             " . TABLE_MANUFACTURERS . " m\n                           ON p.manufacturers_id = m.manufacturers_id LEFT JOIN\n                             " . TABLE_PRODUCTS_DESCRIPTION . " pd\n                           ON p.products_id = pd.products_id AND\n                            pd.language_id = '" . SESSION_LANGUAGE_ID . "' LEFT JOIN\n                             " . TABLE_SPECIALS . " s\n                           ON p.products_id = s.products_id\n                         WHERE\n                           p.products_status = 1\n                         ORDER BY\n                            p.products_date_added DESC,\n                            pd.products_name");
     while ($products = olc_db_fetch_array($export_query)) {
         $products_price = olc_get_products_price_export($products['products_id'], 1, true, $_POST['status'], 1, $_POST['currencies'], true);
         // remove trash
         $products_description = strip_tags($products['products_description']);
         $products_description = substr($products_description, 0, 1000) . '..';
         $products_description = str_replace(";", ", ", $products_description);
         $products_description = str_replace(APOS, ", ", $products_description);
         $products_description = str_replace(NEW_LINE, BLANK, $products_description);
         $products_description = str_replace("\r", BLANK, $products_description);
         $products_description = str_replace("\t", BLANK, $products_description);
         $products_description = str_replace("\v", BLANK, $products_description);
         $products_description = str_replace("&quot,", " \"", $products_description);
         $products_description = str_replace("&qout,", " \"", $products_description);
         // get product categorie
         $categorie_query = olc_db_query("SELECT\n                                            categories_id\n                                            FROM " . TABLE_PRODUCTS_TO_CATEGORIES . "\n                                            WHERE products_id='" . $products['products_id'] . APOS);
         while ($categorie_data = olc_db_fetch_array($categorie_query)) {
             $categories = $categorie_data['categories_id'];
         }
         $categorie_query = olc_db_query("SELECT\n                                            categories_name\n                                            FROM " . TABLE_CATEGORIES_DESCRIPTION . "\n                                            WHERE categories_id='" . $categories . "'\n                                            and language_id='" . SESSION_LANGUAGE_ID . APOS);
         $categorie_data = olc_db_fetch_array($categorie_query);
         //create content
         $schema .= $products['products_name'] . ';' . $products_description . ';' . $products_price . ';' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'product_info.php?products_id=' . $products['products_id'] . ';' . HTTP_CATALOG_SERVER . DIR_WS_CATALOG_THUMBNAIL_IMAGES . $products['products_image'] . ';' . $_POST['currencies'] . ';' . $categorie_data['categories_name'] . ';' . ';' . olc_date_short($products['products_date_available']) . ';' . ';' . ';' . $products['products_model'] . ';' . $products['manufacturers_name'] . ';' . $products['products_model'] . ';' . $products['products_meta_keywords'] . ';' . '0' . NEW_LINE;
     }
     // create File
     $fp = fopen(DIR_FS_DOCUMENT_ROOT . 'export/' . $file, "w+");
     fputs($fp, $schema);
     fclose($fp);
     switch ($_POST['export']) {
         case 'yes':
             // send File to Browser
             $extension = substr($file, -3);
             $fp = fopen(DIR_FS_DOCUMENT_ROOT . 'export/' . $file, "rb");
             $buffer = fread($fp, filesize(DIR_FS_DOCUMENT_ROOT . 'export/' . $file));
             fclose($fp);
             header('Content-type: application/x-octet-stream');
             header('Content-disposition: attachment; filename=' . $file);
             echo $buffer;
             exit;
             break;
     }
 }
} else {
    $lastname_content = olc_draw_input_field('a_lastname', $affiliate['affiliate_lastname']) . HTML_NBSP . ENTRY_FIRST_NAME_TEXT;
}
$module_smarty->assign('lastname_content', $lastname_content);
if (ACCOUNT_DOB == TRUE_STRING_S) {
    $module_smarty->assign('ACCOUNT_DOB', TRUE_STRING_S);
    if ($is_read_only == true) {
        $dob_content = olc_date_short($affiliate['affiliate_dob']);
    } elseif ($error == true) {
        if ($entry_date_of_birth_error == true) {
            $dob_content = olc_draw_input_field('a_dob') . HTML_NBSP . ENTRY_DATE_OF_BIRTH_ERROR;
        } else {
            $dob_content = $a_dob . olc_draw_hidden_field('a_dob');
        }
    } else {
        $dob_content = olc_draw_input_field('a_dob', olc_date_short($affiliate['affiliate_dob'])) . HTML_NBSP . ENTRY_DATE_OF_BIRTH_TEXT;
    }
    $module_smarty->assign('dob_content', $dob_content);
}
if ($is_read_only == true) {
    $email_content = $affiliate['affiliate_email_address'];
} elseif ($error == true) {
    if ($entry_email_address_error == true) {
        $email_content = olc_draw_input_field('a_email_address') . HTML_NBSP . ENTRY_EMAIL_ADDRESS_ERROR;
    } elseif ($entry_email_address_check_error == true) {
        $email_content = olc_draw_input_field('a_email_address') . HTML_NBSP . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
    } elseif ($entry_email_address_exists == true) {
        $email_content = olc_draw_input_field('a_email_address') . HTML_NBSP . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
    } else {
        $email_content = $a_email_address . olc_draw_hidden_field('a_email_address');
    }
        $contents[] = array('text' => TEXT_DELETE_INTRO);
        $contents[] = array('text' => '<br/><b>' . $bInfo->blacklist_card_number . HTML_B_END);
        //      $contents[] = array('text' => HTML_BR . olc_draw_checkbox_field('delete_image', '', true) . BLANK . TEXT_DELETE_IMAGE);
        //      if ($mInfo->products_count > 0) {
        //        $contents[] = array('text' => HTML_BR . olc_draw_checkbox_field('delete_products') . BLANK . TEXT_DELETE_PRODUCTS);
        //        $contents[] = array('text' => HTML_BR . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
        //      }
        $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . BLANK . HTML_A_START . olc_href_link(FILENAME_BLACKLIST, 'page=' . $_GET['page'] . '&bID=' . $bInfo->blacklist_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
        break;
    default:
        if (is_object($bInfo)) {
            $heading[] = array('text' => HTML_B_START . $bInfo->blacklist_card_number . HTML_B_END);
            $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_BLACKLIST, 'page=' . $_GET['page'] . '&bID=' . $bInfo->blacklist_id . '&action=edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_BLACKLIST, 'page=' . $_GET['page'] . '&bID=' . $bInfo->blacklist_id . '&action=delete') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
            $contents[] = array('text' => HTML_BR . TEXT_DATE_ADDED . BLANK . olc_date_short($bInfo->date_added));
            if (olc_not_null($bInfo->last_modified)) {
                $contents[] = array('text' => TEXT_LAST_MODIFIED . BLANK . olc_date_short($bInfo->last_modified));
            }
            //        $contents[] = array('text' => HTML_BR . olc_info_image($mInfo->manufacturers_image, $mInfo->manufacturers_name));
            //        $contents[] = array('text' => HTML_BR . TEXT_PRODUCTS . BLANK . $mInfo->products_count);
        }
        break;
}
if (olc_not_null($heading) && olc_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . NEW_LINE;
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . NEW_LINE;
}
?>
          </tr>
        </table></td>
 /**
  *
  * select reviews
  *
  */
 function getReviews()
 {
     $data_reviews = array();
     $reviews_query = olc_db_query("\n\t\tselect\n   r.reviews_rating,\n   r.reviews_id,\n   r.customers_name,\n   r.date_added,\n   r.last_modified,\n   r.reviews_read,\n   rd.reviews_text\n   from " . TABLE_REVIEWS . " r,\n   " . TABLE_REVIEWS_DESCRIPTION . " rd\n   where r.products_id = '" . $this->pID . "'\n   and  r.reviews_id=rd.reviews_id\n   and rd.languages_id = '" . SESSION_LANGUAGE_ID . "'\n   order by reviews_id DESC");
     if (olc_db_num_rows($reviews_query, true)) {
         $row = 0;
         $data_reviews = array();
         while ($reviews = olc_db_fetch_array($reviews_query, true)) {
             $row++;
             $data_reviews[] = array('AUTHOR' => $reviews['customers_name'], 'DATE' => olc_date_short($reviews['date_added']), 'RATING' => olc_image('templates/' . CURRENT_TEMPLATE . '/images/stars_' . $reviews['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'TEXT' => $reviews['reviews_text']);
             if ($row == PRODUCT_REVIEWS_VIEW) {
                 break;
             }
         }
     }
     return $data_reviews;
 }
$heading = array();
$contents = array();
$heading[] = array('text' => '[' . $gInfo->coupon_id . '] ' . BLANK . $currencies->format($gInfo->coupon_amount));
$redeem_query = olc_db_query("select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $gInfo->coupon_id . APOS);
$redeemed = 'No';
if (olc_db_num_rows($redeem_query) > 0) {
    $redeemed = 'Yes';
}
$contents[] = array('text' => TEXT_INFO_SENDERS_ID . BLANK . $gInfo->customer_id_sent);
$contents[] = array('text' => TEXT_INFO_AMOUNT_SENT . BLANK . $currencies->format($gInfo->coupon_amount));
$contents[] = array('text' => TEXT_INFO_DATE_SENT . BLANK . olc_date_short($gInfo->date_sent));
$contents[] = array('text' => TEXT_INFO_VOUCHER_CODE . BLANK . $gInfo->coupon_code);
$contents[] = array('text' => TEXT_INFO_EMAIL_ADDRESS . BLANK . $gInfo->emailed_to);
if ($redeemed == 'Yes') {
    $redeem = olc_db_fetch_array($redeem_query);
    $contents[] = array('text' => HTML_BR . TEXT_INFO_DATE_REDEEMED . BLANK . olc_date_short($redeem['redeem_date']));
    $contents[] = array('text' => TEXT_INFO_IP_ADDRESS . BLANK . $redeem['redeem_ip']);
    $contents[] = array('text' => TEXT_INFO_CUSTOMERS_ID . BLANK . $redeem['customer_id']);
} else {
    $contents[] = array('text' => HTML_BR . TEXT_INFO_NOT_REDEEMED);
}
if (olc_not_null($heading) && olc_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . NEW_LINE;
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . NEW_LINE;
}
?>
          </tr>
        </table></td>
      </tr>
$affiliate_clickthroughs_raw = "select a.*, pd.products_name from " . TABLE_AFFILIATE_CLICKTHROUGHS . " a\n                                    left join " . TABLE_PRODUCTS . " p on (p.products_id = a.affiliate_products_id)\n                                    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on (pd.products_id = p.products_id and pd.language_id = '" . SESSION_LANGUAGE_ID . "')\n                                    where a.affiliate_id = '" . $_SESSION['affiliate_id'] . "'  ORDER BY a.affiliate_clientdate desc";
$affiliate_clickthroughs_split = new splitPageResults($affiliate_clickthroughs_raw, $_GET['page'], MAX_DISPLAY_SEARCH_RESULTS);
require DIR_WS_INCLUDES . 'header.php';
$smarty->assign('affiliate_clickthroughs_split_number', $affiliate_clickthroughs_split->number_of_rows);
$affiliate_clickthrough_table = '';
if ($affiliate_clickthroughs_split->number_of_rows > 0) {
    $affiliate_clickthroughs_values = olc_db_query($affiliate_clickthroughs_split->sql_query);
    $number_of_clickthroughs = '0';
    while ($affiliate_clickthroughs = olc_db_fetch_array($affiliate_clickthroughs_values)) {
        $number_of_clickthroughs++;
        if ($number_of_clickthroughs / 2 == floor($number_of_clickthroughs / 2)) {
            $affiliate_clickthrough_table .= '<tr class="productListing-even">';
        } else {
            $affiliate_clickthrough_table .= '<tr class="productListing-odd">';
        }
        $affiliate_clickthrough_table .= '<td class="smallText">' . olc_date_short($affiliate_clickthroughs['affiliate_clientdate']) . '</td>';
        if ($affiliate_clickthroughs['affiliate_products_id'] > 0) {
            $link_to = HTML_A_START . olc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $affiliate_clickthroughs['affiliate_products_id']) . '" target="_blank">' . $affiliate_clickthroughs['products_name'] . HTML_A_END;
        } else {
            $link_to = "Startpage";
        }
        $affiliate_clickthrough_table .= '<td class="smallText">' . $link_to . '</td>';
        $affiliate_clickthrough_table .= '<td class="smallText">' . $affiliate_clickthroughs['affiliate_clientreferer'] . '</td></tr>';
    }
    $smarty->assign('affiliate_clickthrough_table', $affiliate_clickthrough_table);
}
if ($affiliate_clickthroughs_split->number_of_rows > 0) {
    $smarty->assign('affiliate_clickthroughs_split_count', $affiliate_clickthroughs_split->display_count(TEXT_DISPLAY_NUMBER_OF_CLICKS));
    $smarty->assign('affiliate_clickthroughs_split_links', $affiliate_clickthroughs_split->display_links(MAX_DISPLAY_PAGE_LINKS, olc_get_all_get_params(array('page', 'info', 'x', 'y'))));
}
$main_content = $smarty->fetch(CURRENT_TEMPLATE_MODULE . 'affiliate_clicks' . HTML_EXT, SMARTY_CACHE_ID);
             if (!$is_admin || CUSTOMER_ID == 1) {
                 $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_CUSTOMERS, $params . 'edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . HTML_A_END);
             }
             if (true || $cs_id != 0) {
                 $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_CUSTOMERS, $params . 'confirm') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
             }
             if (!$is_admin) {
                 $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_CUSTOMERS, $params . 'editstatus') . '">' . olc_image_button('button_status.gif', IMAGE_STATUS) . HTML_A_END);
                 // elari cs v3.x changed for added accounting module
                 $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_ACCOUNTING, $params) . '">' . olc_image_button('button_accounting.gif', IMAGE_ACCOUNTING) . HTML_A_END);
             }
             // elari cs v3.x changed for added iplog module
             $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_ORDERS, $params) . '">' . olc_image_button('button_orders.gif', IMAGE_ORDERS) . HTML_A_END . BLANK . HTML_A_START . olc_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . olc_image_button('button_email.gif', IMAGE_EMAIL) . '</a><br/><a href="' . olc_href_link(FILENAME_CUSTOMERS, $params . 'iplog') . '">' . olc_image_button('button_iplog.gif', IMAGE_IPLOG) . HTML_A_END);
             $contents[] = array('text' => HTML_BR . TEXT_DATE_ACCOUNT_CREATED . BLANK . olc_date_short($cInfo->date_account_created));
             $contents[] = array('text' => HTML_BR . TEXT_DATE_ACCOUNT_LAST_MODIFIED . BLANK . olc_date_short($cInfo->date_account_last_modified));
             $contents[] = array('text' => HTML_BR . TEXT_INFO_DATE_LAST_LOGON . BLANK . olc_date_short($cInfo->date_last_logon));
             $contents[] = array('text' => HTML_BR . TEXT_INFO_NUMBER_OF_LOGONS . BLANK . $cInfo->number_of_logons);
             $contents[] = array('text' => HTML_BR . TEXT_INFO_COUNTRY . BLANK . $cInfo->countries_name);
             $contents[] = array('text' => HTML_BR . TEXT_INFO_NUMBER_OF_REVIEWS . BLANK . $cInfo->number_of_reviews);
         }
         if ($action == 'iplog') {
             $contents[] = array('text' => '<br/><b>IPLOG :');
             $customers_log_info_array = olc_get_user_info($customers_id);
             if (olc_db_num_rows($customers_log_info_array)) {
                 while ($customers_log_info = olc_db_fetch_array($customers_log_info_array)) {
                     $contents[] = array('text' => '<tr>' . NEW_LINE . '<td class="smallText">' . $customers_log_info['customers_ip_date'] . BLANK . $customers_log_info['customers_ip']);
                 }
             }
         }
         break;
 }
$info_smarty->assign('options', $products_options_data);
$reviews_query = olc_db_query(SELECT_COUNT . " as count from " . TABLE_REVIEWS . " where products_id = '" . (int) $_GET['products_id'] . APOS);
$reviews = olc_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
    //fsk18 lock
    $fsk_lock = '';
    if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
        $fsk_lock = ' and p.products_fsk18!=1';
    }
    $product_info_query = olc_db_query("select pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS . " p on pd.products_id = p.products_id where pd.language_id = '" . SESSION_LANGUAGE_ID . "' and p.products_status = '1' " . $fsk_lock . " and pd.products_id = '" . (int) $_GET['products_id'] . APOS);
    if (!olc_db_num_rows($product_info_query)) {
        olc_redirect(olc_href_link(FILENAME_REVIEWS));
    }
    $product_info = olc_db_fetch_array($product_info_query);
    $reviews_query = olc_db_query("select\n                                 r.reviews_rating,\n                                 r.reviews_id,\n                                 r.customers_name,\n                                 r.date_added,\n                                 r.last_modified,\n                                 r.reviews_read,\n                                 rd.reviews_text\n                                 from " . TABLE_REVIEWS . " r,\n                                 " . TABLE_REVIEWS_DESCRIPTION . " rd\n                                 where r.products_id = '" . (int) $_GET['products_id'] . "'\n                                 and  r.reviews_id=rd.reviews_id\n                                 and rd.languages_id = '" . SESSION_LANGUAGE_ID . "'\n                                 order by reviews_id DESC");
    if (olc_db_num_rows($reviews_query)) {
        $row = 0;
        $data_reviews = array();
        while ($reviews = olc_db_fetch_array($reviews_query)) {
            $row++;
            $data_reviews[] = array('AUTHOR' => $reviews['customers_name'], 'DATE' => olc_date_short($reviews['date_added']), 'RATING' => olc_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'TEXT' => $reviews['reviews_text']);
            if ($row == PRODUCT_REVIEWS_VIEW) {
                break;
            }
        }
    }
    $module_smarty->assign('BUTTON_WRITE', HTML_A_START . olc_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $_GET['products_id']) . '">' . olc_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . HTML_A_END);
    $module_smarty->assign(MODULE_CONTENT, $data_reviews);
    $module = $module_smarty->fetch(CURRENT_TEMPLATE_MODULE . 'products_reviews' . HTML_EXT, $cacheid);
    $info_smarty->assign('MODULE_products_reviews', $module);
}
                ?>
</td>
<?php 
                break;
            case '4':
                ?>
                      <td class="dataTableContent" align="right"><?php 
                echo olc_date_long(date("Y-m-d\\ H:i:s", $sr->showDate));
                ?>
</td>
<?php 
                break;
            default:
                ?>
                      <td class="dataTableContent" align="right"><?php 
                echo olc_date_short(date("Y-m-d\\ H:i:s", $sr->showDate)) . " - " . olc_date_short(date("Y-m-d\\ H:i:s", $sr->showDateEnd));
                ?>
</td>
<?php 
        }
        ?>
                      <td class="dataTableContent" align="right"><?php 
        echo $info[0]['order'];
        ?>
</td>
                      <td class="dataTableContent" align="right"><?php 
        echo $info[$last - 1]['totitem'];
        ?>
</td>
                      <td class="dataTableContent" align="right"><?php 
        echo $currencies->format($info[$last - 1]['totsum']);
if (olc_not_null($get_params_back)) {
    $get_params_back = substr($get_params_back, 0, -1);
    //remove trailing &
} else {
    $get_params_back = $get_params;
}
$product_info_query = olc_db_query("select pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS . " p on pd.products_id = p.products_id where pd.language_id = '" . SESSION_LANGUAGE_ID . "' and p.products_status = '1' and pd.products_id = '" . (int) $_GET['products_id'] . APOS);
if (!olc_db_num_rows($product_info_query)) {
    olc_redirect(olc_href_link(FILENAME_REVIEWS));
}
$product_info = olc_db_fetch_array($product_info_query);
$breadcrumb->add(NAVBAR_TITLE_PRODUCT_REVIEWS, olc_href_link(FILENAME_PRODUCT_REVIEWS, $get_params));
require DIR_WS_INCLUDES . 'header.php';
$smarty->assign('PRODUCTS_NAME', $product_info['products_name']);
$data_reviews = array();
$reviews_query = olc_db_query("select reviews_rating, reviews_id, customers_name, date_added, last_modified, reviews_read from " . TABLE_REVIEWS . " where products_id = '" . (int) $_GET['products_id'] . "' order by reviews_id DESC");
if (olc_db_num_rows($reviews_query)) {
    $row = 0;
    while ($reviews = olc_db_fetch_array($reviews_query)) {
        $row++;
        $data_reviews[] = array('id' => $reviews['reviews_id'], 'AUTHOR' => HTML_A_START . olc_href_link(FILENAME_PRODUCT_REVIEWS_INFO, $get_params . '&reviews_id=' . $reviews['reviews_id']) . '">' . $reviews['customers_name'] . HTML_A_END, 'DATE' => olc_date_short($reviews['date_added']), 'RATING' => olc_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews['reviews_rating'])), 'TEXT' => $reviews['reviews_text']);
    }
}
$smarty->assign(MODULE_CONTENT, $data_reviews);
$link = olc_href_link(FILENAME_PRODUCT_INFO, $get_params_back, NONSSL, false, true, false);
$smarty->assign('BUTTON_BACK', HTML_A_START . $link . '">' . olc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . HTML_A_END);
$smarty->assign('BUTTON_WRITE', HTML_A_START . olc_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, $get_params) . '">' . olc_image_button('button_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . HTML_A_END);
$main_content = $smarty->fetch(CURRENT_TEMPLATE_MODULE . 'product_reviews' . HTML_EXT, SMARTY_CACHE_ID);
$smarty->assign(MAIN_CONTENT, $main_content);
require BOXES;
$smarty->display(INDEX_HTML);
        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
        $contents[] = array('text' => '<br/><b>' . $cInfo->title . HTML_B_END);
        $contents[] = array('align' => 'center', 'text' => HTML_BR . ($remove_currency ? HTML_A_START . olc_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=deleteconfirm') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END : '') . BLANK . HTML_A_START . olc_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
        break;
    default:
        if (is_object($cInfo)) {
            $heading[] = array('text' => HTML_B_START . $cInfo->title . HTML_B_END);
            $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_CURRENCIES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->currencies_id . '&action=delete') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
            $contents[] = array('text' => HTML_BR . TEXT_INFO_CURRENCY_TITLE . BLANK . $cInfo->title);
            $contents[] = array('text' => TEXT_INFO_CURRENCY_CODE . BLANK . $cInfo->code);
            $contents[] = array('text' => HTML_BR . TEXT_INFO_CURRENCY_SYMBOL_LEFT . BLANK . $cInfo->symbol_left);
            $contents[] = array('text' => TEXT_INFO_CURRENCY_SYMBOL_RIGHT . BLANK . $cInfo->symbol_right);
            $contents[] = array('text' => HTML_BR . TEXT_INFO_CURRENCY_DECIMAL_POINT . BLANK . $cInfo->decimal_point);
            $contents[] = array('text' => TEXT_INFO_CURRENCY_THOUSANDS_POINT . BLANK . $cInfo->thousands_point);
            $contents[] = array('text' => TEXT_INFO_CURRENCY_DECIMAL_PLACES . BLANK . $cInfo->decimal_places);
            $contents[] = array('text' => HTML_BR . TEXT_INFO_CURRENCY_LAST_UPDATED . BLANK . olc_date_short($cInfo->last_updated));
            $contents[] = array('text' => TEXT_INFO_CURRENCY_VALUE . BLANK . number_format($cInfo->value, 8));
            $contents[] = array('text' => HTML_BR . TEXT_INFO_CURRENCY_EXAMPLE . HTML_BR . $currencies->format('30', false, DEFAULT_CURRENCY) . ' = ' . $currencies->format('30', true, $cInfo->code));
        }
        break;
}
if (olc_not_null($heading) && olc_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . NEW_LINE;
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . NEW_LINE;
}
?>
          </tr>
        </table></td>
      </tr>
            <td class="main" nowrap="nowrap" align="right">' . $ot_text . '</td>
          </tr>
';
        }
        $total_block .= '
				</table>
';
    }
    $data_products .= '				</table>';
    $smarty->assign('PRODUCTS_BLOCK', $data_products);
    $smarty->assign('TOTAL_BLOCK', $total_block);
    $smarty->assign('PAYMENT_EDIT', olc_href_link(FILENAME_CHECKOUT_PAYMENT, EMPTY_STRING, SSL));
    $history_block = '<table>';
    $statuses_query = olc_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh\n\twhere\n\tosh.orders_id = '" . $order_id . "'\n\tand osh.orders_status_id = os.orders_status_id\n\tand os.language_id = '" . SESSION_LANGUAGE_ID . "'\n\torder by osh.date_added");
    while ($statuses = olc_db_fetch_array($statuses_query)) {
        $history_block .= '              <tr>' . NEW_LINE . '                <td class="main" valign="top">' . olc_date_short($statuses['date_added']) . '</td>' . NEW_LINE . '                <td class="main" valign="top">' . $statuses['orders_status_name'] . '</td>' . NEW_LINE . '                <td class="main" valign="top">' . (empty($statuses['comments']) ? HTML_NBSP : nl2br(htmlspecialchars($statuses['comments']))) . '</td>' . NEW_LINE . '              </tr>' . NEW_LINE;
    }
    $history_block .= '</table>';
    $smarty->assign('HISTORY_BLOCK', $history_block);
    if (DOWNLOAD_ENABLED == TRUE_STRING_S) {
        include DIR_WS_MODULES . 'downloads.php';
    }
    $button_back = HTML_A_START . olc_href_link(FILENAME_ACCOUNT_HISTORY, olc_get_all_get_params(array('order_id')), SSL) . '">' . olc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . HTML_A_END;
    /* begin PayPal_Shopping_Cart_IPN */
    if (defined('PAYPAL_IPN_DIR')) {
        require PAYPAL_IPN_DIR . 'catalog/order_send_money.inc.php';
    }
    $button_back .= $paypal_confirm;
    /* end PayPal_Shopping_Cart_IPN */
    $track_code = $order->info['orders_trackcode'];
    if ($track_code) {
            $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
            $contents[] = array('text' => '<br/><b>' . $sInfo->products_name . HTML_B_END);
            $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . olc_href_link(FILENAME_SPECIALS, 'page=' . $page . '&sID=' . $sInfo->specials_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
            break;
        default:
            if (is_object($sInfo)) {
                $heading[] = array('text' => HTML_B_START . $sInfo->products_name . HTML_B_END);
                $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_SPECIALS, 'page=' . $page . '&sID=' . $sInfo->specials_id . '&action=edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_SPECIALS, 'page=' . $page . '&sID=' . $sInfo->specials_id . '&action=delete') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
                $contents[] = array('text' => HTML_BR . TEXT_INFO_DATE_ADDED . BLANK . olc_date_short($sInfo->specials_date_added));
                $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . BLANK . olc_date_short($sInfo->specials_last_modified));
                $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_product_info_image($sInfo->products_image, $sInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));
                $contents[] = array('text' => HTML_BR . TEXT_INFO_ORIGINAL_PRICE . BLANK . $currencies->format($sInfo->products_price));
                $contents[] = array('text' => '' . TEXT_INFO_NEW_PRICE . BLANK . $currencies->format($sInfo->specials_new_products_price));
                $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . BLANK . number_format(100 - $sInfo->specials_new_products_price / $sInfo->products_price * 100) . '%');
                $contents[] = array('text' => HTML_BR . TEXT_INFO_EXPIRES_DATE . ' <b>' . olc_date_short($sInfo->expires_date) . HTML_B_END);
                $contents[] = array('text' => '' . TEXT_INFO_STATUS_CHANGE . BLANK . olc_date_short($sInfo->date_status_change));
            }
            break;
    }
    if (olc_not_null($heading) && olc_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . NEW_LINE;
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . NEW_LINE;
    }
}
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
              <center>
                <tr>
                  <td width="35%" align="right" class="dataTableContent"><b><?php 
echo TEXT_AFFILIATE_NAME;
?>
</b>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                  <td width="15%" class="dataTableContent"><?php 
echo $affiliate['affiliate_firstname'] . BLANK . $affiliate['affiliate_lastname'];
?>
</td>
                  <td width="35%" align="right" class="dataTableContent"><?php 
echo TEXT_AFFILIATE_JOINDATE;
?>
&nbsp;&nbsp;&nbsp;&nbsp;</td>
                  <td width="15%" class="dataTableContent"><?php 
echo olc_date_short($affiliate['affiliate_date_account_created']);
?>
</td>
                </tr>
                <tr>
                  <td width="35%" align="right" class="dataTableContent"><?php 
echo TEXT_IMPRESSIONS;
echo '<a href="javascript:popupWindow(\'' . (HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_HELP_1) . '\')">' . TEXT_SUMMARY_HELP . HTML_A_END;
?>
</td>
                  <td width="15%" class="dataTableContent"><?php 
echo $affiliate_impressions;
?>
</td>
                  <td width="35%" align="right" class="dataTableContent"><?php 
echo TEXT_VISITS;
         $products_price_real = olc_format_price($products_price_real, true, true);
     } else {
         require_once DIR_FS_INC . 'olc_get_smarty_config_variable.inc.php';
         $info_smarty->assign('PRODUCTS_SOLD_OUT', olc_get_smarty_config_variable($info_smarty, 'product_info', 'product_not_in_stock'));
         $products_price = str_replace(DASH, EMPTY_STRING, $products_price);
     }
 } else {
     $products_date_available = EMPTY_STRING;
 }
 //W. Kaiser - Baseprice
 require_once DIR_FS_INC . 'olc_get_vpe_and_baseprice_info.inc.php';
 olc_get_vpe_and_baseprice_info($info_smarty, $product_info, $products_price);
 //W. Kaiser - Baseprice
 $info_smarty->assign('PRODUCTS_MODEL', $product_info['products_model']);
 $info_smarty->assign('PRODUCTS_DATE_AVAILABLE', $products_date_available);
 $info_smarty->assign('PRODUCTS_ADDED', sprintf(TEXT_DATE_ADDED, olc_date_short($product_info['products_date_added'])));
 $info_smarty->assign('PRODUCTS_PRICE_RAW', $products_price_real);
 $info_smarty->assign('PRODUCTS_PRICE', $products_price);
 $info_smarty->assign('PRODUCTS_SPECIALPRICE', $price_special_info);
 $info_smarty->assign('PRODUCTS_ID', $products_id);
 $info_smarty->assign('PRODUCTS_QUANTITY', $product_info['products_quantity']);
 $info_smarty->assign('PRODUCTS_WEIGHT', $product_info['products_weight']);
 $info_smarty->assign('PRODUCTS_STATUS', $products_status);
 $info_smarty->assign('PRODUCTS_ORDERED', $product_info['products_ordered']);
 $info_smarty->assign('GENERAL_DISCLAIMER', GENERAL_DISCLAIMER);
 //W. Kaiser - AJAX
 $info_smarty->assign('PRODUCTS_DATE_ADDED', $product_info['products_date_added']);
 $info_smarty->assign('PRODUCTS_ID_FULL', isset($products_id_full) ? $products_id_full : $products_id);
 //W. Kaiser - AJAX
 $manufacturers_id = $product_info['manufacturers_id'];
 if ($manufacturers_id) {
if (!$IsCreateAccountOrIsEditAccountOrIsCheckout) {
    display_input_field('csID', false, '#FFDEAD', ENTRY_CID, EMPTY_STRING, 'csID', $cInfo->customers_cid, MAX_LENGTH, MAX_SIZE, EMPTY_STRING, NO_INPUT, false, EMPTY_STRING, EMPTY_STRING);
}
if ($EditPersonalData || $IsUserModeEdit) {
    if (ACCOUNT_GENDER == TRUE_STRING_S) {
        if ($customers_gender == 'w') {
            $customers_gender = 'f';
        }
        display_radio_field(array('INPUT_MALE', 'INPUT_FEMALE'), ENTRY_GENDER, EMPTY_STRING, 'customers_gender', array('m', 'f'), array(MALE, FEMALE), $customers_gender, $error, $entry_gender_error, ENTRY_GENDER_ERROR, EMPTY_STRING);
    }
    display_input_field('INPUT_FIRSTNAME', false, EMPTY_STRING, ENTRY_FIRST_NAME, EMPTY_STRING, 'customers_firstname', $customers_firstname, MAX_LENGTH, MAX_SIZE, EMPTY_STRING, $error, $entry_firstname_error, ENTRY_FIRST_NAME_ERROR, EMPTY_STRING, AJAX_VORNAMEN_VALIDATION, true, true);
    display_input_field('INPUT_LASTNAME', false, EMPTY_STRING, ENTRY_LAST_NAME, EMPTY_STRING, 'customers_lastname', $customers_lastname, MAX_LENGTH, MAX_SIZE, EMPTY_STRING, $error, $entry_lastname_error, ENTRY_LAST_NAME_ERROR, EMPTY_STRING);
    if ($not_IsCheckout) {
        if (ACCOUNT_DOB == TRUE_STRING_S) {
            $explanation_text = " (z.B. 11.12.1913)";
            display_input_field('INPUT_DOB', false, EMPTY_STRING, ENTRY_DATE_OF_BIRTH, EMPTY_STRING, 'customers_dob', olc_date_short($cInfo->customers_dob), MAX_LENGTH, MAX_SIZE, EMPTY_STRING, $error, $entry_dob_error, ENTRY_DATE_OF_BIRTH_ERROR, EMPTY_STRING, USE_AJAX, true);
            //$entry_dob_error, ENTRY_DATE_OF_BIRTH_ERROR, EMPTY_STRING,USE_AJAX && $IsUserMode,true);
        }
        if ($EditPersonalData) {
            //	W. Kaiser - eMail-type by customer
            $entry_error = EMPTY_STRING;
            if ($error) {
                if ($entry_email_address_error) {
                    $entry_error_desc = ENTRY_EMAIL_ADDRESS_ERROR;
                    $entry_error = true;
                } elseif ($entry_email_address_check_error) {
                    $entry_error_desc = ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
                    $entry_error = true;
                } elseif ($entry_email_address_exists) {
                    $entry_error_desc = ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
                    $entry_error = true;
</td>
      </tr>
<?php 
$affiliate_payment_query = olc_db_query("select * from " . TABLE_AFFILIATE_PAYMENT . " where affiliate_payment_id = '" . $_GET['pID'] . APOS);
$affiliate_payment = olc_db_fetch_array($affiliate_payment_query);
$affiliate_sales_query = olc_db_query("select * from " . TABLE_AFFILIATE_SALES . " where affiliate_payment_id = '" . $payments['affiliate_payment_id'] . "' order by affiliate_payment_date desc");
while ($affiliate_sales = olc_db_fetch_array($affiliate_sales_query)) {
    ?>

      <tr class="dataTableRow">
        <td class="dataTableContent" align="right" valign="top"><?php 
    echo $affiliate_sales['affiliate_orders_id'];
    ?>
</td>
        <td class="dataTableContent" align="center" valign="top"><?php 
    echo olc_date_short($affiliate_sales['affiliate_date']);
    ?>
</td>
        <td class="dataTableContent" align="right" valign="top"><b><?php 
    echo $currencies->display_price($affiliate_sales['affiliate_value'], '');
    ?>
</b></td>
        <td class="dataTableContent" align="right" valign="top"><?php 
    echo $affiliate_sales['affiliate_percent'];
    echo ENTRY_PERCENT;
    ?>
</td>
        <td class="dataTableContent" align="right" valign="top"><b><?php 
    echo $currencies->display_price($affiliate_sales['affiliate_payment'], '');
    ?>
</b></td>
     case 'confirm':
         $heading[] = array('text' => HTML_B_START . TEXT_INFO_HEADING_DELETE_CUSTOMER . HTML_B_END);
         $contents = array('form' => olc_draw_form('affiliate', FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=deleteconfirm'));
         $contents[] = array('text' => TEXT_DELETE_INTRO . '<br/><br/><b>' . $aInfo->affiliate_firstname . BLANK . $aInfo->affiliate_lastname . HTML_B_END);
         $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . BLANK . HTML_A_START . olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
         break;
     default:
         if (is_object($aInfo)) {
             $heading[] = array('text' => HTML_B_START . $aInfo->affiliate_firstname . BLANK . $aInfo->affiliate_lastname . HTML_B_END);
             $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_AFFILIATE, olc_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=confirm') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . olc_href_link(FILENAME_AFFILIATE_CONTACT, 'selected_box=affiliate&affiliate=' . $aInfo->affiliate_email_address) . '">' . olc_image_button('button_email.gif', IMAGE_EMAIL) . HTML_A_END);
             $affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id)\n        where o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and  affiliate_id = '" . $aInfo->affiliate_id . APOS;
             $affiliate_sales_values = olc_db_query($affiliate_sales_raw);
             $affiliate_sales = olc_db_fetch_array($affiliate_sales_values);
             $contents[] = array('text' => HTML_BR . TEXT_DATE_ACCOUNT_CREATED . BLANK . olc_date_short($aInfo->date_account_created));
             $contents[] = array('text' => EMPTY_STRING . TEXT_DATE_ACCOUNT_LAST_MODIFIED . BLANK . olc_date_short($aInfo->date_account_last_modified));
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_DATE_LAST_LOGON . BLANK . olc_date_short($aInfo->date_last_logon));
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_NUMBER_OF_LOGONS . BLANK . $aInfo->number_of_logons);
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_COMMISSION . BLANK . $aInfo->affiliate_commission_percent . ' %');
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_COUNTRY . BLANK . $aInfo->countries_name);
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_NUMBER_OF_SALES . BLANK . $affiliate_sales['count'], EMPTY_STRING);
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_SALES_TOTAL . BLANK . $currencies->display_price($affiliate_sales['total'], EMPTY_STRING));
             $contents[] = array('text' => EMPTY_STRING . TEXT_INFO_AFFILIATE_TOTAL . BLANK . $currencies->display_price($affiliate_sales['payment'], EMPTY_STRING));
         }
         break;
 }
 if (olc_not_null($heading) && olc_not_null($contents)) {
     echo '            <td width="25%" valign="top">' . NEW_LINE;
     $box = new box();
     echo $box->infoBox($heading, $contents);
     echo '            </td>' . NEW_LINE;
 }
        }
        ?>
                <td class="dataTableContent"><?php 
        echo HTML_A_START . olc_href_link(FILENAME_AFFILIATE_PAYMENT, olc_get_all_get_params(array('pID', 'action')) . 'pID=' . $pInfo->affiliate_payment_id . '&action=edit') . '">' . olc_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $payments['affiliate_firstname'] . BLANK . $payments['affiliate_lastname'];
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        echo $currencies->format(strip_tags($payments['affiliate_payment']));
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        echo $currencies->format(strip_tags($payments['affiliate_payment'] + $payments['affiliate_payment_tax']));
        ?>
</td>
                <td class="dataTableContent" align="center"><?php 
        echo olc_date_short($payments['affiliate_payment_date']);
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        echo $payments['affiliate_payment_status_name'];
        ?>
</td>
                <td class="dataTableContent" align="right"><?php 
        if (is_object($pInfo) && $payments['affiliate_payment_id'] == $pInfo->affiliate_payment_id) {
            echo olc_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', '');
        } else {
            echo HTML_A_START . olc_href_link(FILENAME_AFFILIATE_PAYMENT, olc_get_all_get_params(array('pID')) . 'pID=' . $payments['affiliate_payment_id']) . '">' . olc_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . HTML_A_END;
        }
        ?>
&nbsp;</td>
              </tr>
    }
    $smarty->assign('products_history', $products_history);
} else {
    $order_content = array();
    if (olc_count_customer_orders() > 0) {
        $orders_query = olc_db_query("\n\t\tselect\n\t  o.orders_id,\n\t  o.date_purchased,\n\t  o.delivery_name,\n\t  o.delivery_country,\n\t  o.billing_name,\n\t  o.billing_country,\n\t  ot.text as order_total,\n\t  s.orders_status_name\n\t  from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s\n\t  where\n\t  o.customers_id = '" . CUSTOMER_ID . "' and\n\t  o.orders_id = ot.orders_id and\n\t  ot.class = 'ot_total' and\n\t  o.orders_status = s.orders_status_id and\n\t  s.language_id = '" . SESSION_LANGUAGE_ID . "'\n\t  order by orders_id desc limit 3");
        while ($orders = olc_db_fetch_array($orders_query)) {
            $order_name = $orders['delivery_name'];
            if ($order_name) {
                $order_country = $orders['delivery_country'];
            } else {
                $order_name = $orders['billing_name'];
                $order_country = $orders['billing_country'];
            }
            $orders_id = $orders['orders_id'];
            $order_content[] = array('ORDER_ID' => $orders_id, 'ORDER_DATE' => olc_date_short($orders['date_purchased']), 'ORDER_STATUS' => $orders['orders_status_name'], 'ORDER_TOTAL' => $orders['order_total'], 'ORDER_LINK' => olc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders_id, SSL), 'ORDER_BUTTON' => HTML_A_START . olc_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders_id, SSL) . '">' . olc_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . HTML_A_END);
        }
    }
    $smarty->assign('LINK_EDIT', olc_href_link(FILENAME_ACCOUNT_EDIT));
    $smarty->assign('LINK_ADDRESS', olc_href_link(FILENAME_ADDRESS_BOOK));
    $smarty->assign('LINK_PASSWORD', olc_href_link(FILENAME_ACCOUNT_PASSWORD));
    $smarty->assign('LINK_ORDERS', olc_href_link(FILENAME_ACCOUNT_HISTORY));
    $smarty->assign('LINK_NEWSLETTER', olc_href_link(FILENAME_NEWSLETTER));
    $smarty->assign('LINK_NOTIFICATIONS', olc_href_link(FILENAME_ACCOUNT_NOTIFICATIONS));
    //$smarty->assign('LINK_ALL',olc_href_link(FILENAME_ACCOUNT_HISTORY));
    $smarty->assign('order_content', $order_content);
}
//$smarty->assign('also_purchased_history', $also_purchased_history);
$main_content = $smarty->fetch(CURRENT_TEMPLATE_MODULE . 'account' . HTML_EXT, SMARTY_CACHE_ID);
$smarty->assign(MAIN_CONTENT, $main_content);
require BOXES;
                    $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image(DIR_WS_IMAGES . 'graphs/banner_infobox-' . $banner_id . '.' . $banner_extension));
                } else {
                    include DIR_WS_FUNCTIONS . 'html_graphs.php';
                    $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_banner_graph_infoBox($bInfo->banners_id, '3'));
                }
                $contents[] = array('text' => olc_image(DIR_WS_IMAGES . 'graph_hbar_blue.gif', 'Blue', '5', '5') . BLANK . TEXT_BANNERS_BANNER_VIEWS . HTML_BR . olc_image(DIR_WS_IMAGES . 'graph_hbar_red.gif', 'Red', '5', '5') . BLANK . TEXT_BANNERS_BANNER_CLICKS);
                if ($bInfo->date_scheduled) {
                    $contents[] = array('text' => HTML_BR . sprintf(TEXT_BANNERS_SCHEDULED_AT_DATE, olc_date_short($bInfo->date_scheduled)));
                }
                if ($bInfo->expires_date) {
                    $contents[] = array('text' => HTML_BR . sprintf(TEXT_BANNERS_EXPIRES_AT_DATE, olc_date_short($bInfo->expires_date)));
                } elseif ($bInfo->expires_impressions) {
                    $contents[] = array('text' => HTML_BR . sprintf(TEXT_BANNERS_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions));
                }
                if ($bInfo->date_status_change) {
                    $contents[] = array('text' => HTML_BR . sprintf(TEXT_BANNERS_STATUS_CHANGE, olc_date_short($bInfo->date_status_change)));
                }
            }
            break;
    }
    if (olc_not_null($heading) && olc_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . NEW_LINE;
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . NEW_LINE;
    }
    ?>
	</tr>
	</table></td>
	</tr>
	<?php 
                if (olc_not_null($cInfo->last_modified)) {
                    $contents[] = array('text' => TEXT_LAST_MODIFIED . HTML_NBSP . olc_date_short($cInfo->last_modified));
                }
                $contents[] = array('text' => HTML_BR . olc_info_image_c($cInfo->categories_image, $cInfo->categories_name) . HTML_BR . $cInfo->categories_image);
                $contents[] = array('text' => HTML_BR . TEXT_SUBCATEGORIES . HTML_NBSP . $cInfo->childs_count . HTML_BR . TEXT_PRODUCTS . HTML_NBSP . $cInfo->products_count);
            } elseif (is_object($pInfo)) {
                // product info box contents
                $heading[] = array('text' => HTML_B_START . olc_get_products_name($pInfo->products_id, $_SESSION['languages_id']) . HTML_B_END);
                $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . olc_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . olc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . olc_image_button('button_copy_to.gif', IMAGE_COPY_TO) . HTML_A_END . olc_draw_form('edit_attributes', FILENAME_NEW_ATTRIBUTES, EMPTY_STRING, 'post') . '
		<input type="hidden" name="action" value="edit"><input type="hidden" name="current_product_id" value="' . $pInfo->products_id . '"><input type="hidden" name="cpath" value="' . $cPath . '">' . olc_image_submit('button_edit_attributes.gif', 'edit_attributes') . '</form>');
                $contents[] = array('text' => HTML_BR . TEXT_DATE_ADDED . HTML_NBSP . olc_date_short($pInfo->products_date_added));
                if (olc_not_null($pInfo->products_last_modified)) {
                    $contents[] = array('text' => TEXT_LAST_MODIFIED . HTML_NBSP . olc_date_short($pInfo->products_last_modified));
                }
                if (date('Y-m-d') < $pInfo->products_date_available) {
                    $contents[] = array('text' => sprintf(TEXT_DATE_AVAILABLE, olc_date_short($pInfo->products_date_available)));
                }
                $contents[] = array('text' => HTML_BR . olc_product_info_image($pInfo->products_image, $pInfo->products_name) . HTML_BR . $pInfo->products_image);
                // START IN-SOLUTION Berechung des Bruttopreises
                $price = $pInfo->products_price;
                $price = olc_round($price, PRICE_PRECISION);
                $price_string = TEXT_PRODUCTS_PRICE_INFO . HTML_NBSP . $currencies->format($price);
                if (PRICE_IS_BRUTTO == TRUE_STRING_S && ($_GET['read'] == 'only' || $action != 'new_product_preview')) {
                    $price_netto = olc_round($price, PRICE_PRECISION);
                    $tax_query = olc_db_query("select tax_rate from " . TABLE_TAX_RATES . " where tax_class_id = '" . $pInfo->products_tax_class_id . APOS);
                    $tax = olc_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' => HTML_BR . $price_string . HTML_BR . TEXT_PRODUCTS_DISCOUNT_ALLOWED_INFO . HTML_NBSP . $pInfo->products_discount_allowed . HTML_BR . TEXT_PRODUCTS_QUANTITY_INFO . HTML_NBSP . $pInfo->products_quantity);
                // END IN-SOLUTION
 function ProductsDataSheet($languages_id, $products_id)
 {
     global $currencies;
     global $docfilename;
     //Convertion pixels -> mm
     $this->pdf_to_mm_faktor = 1 / $this->k;
     $imagewidth = PRODUCT_IMAGE_INFO_WIDTH * $this->pdf_to_mm_faktor;
     $imageheight = PRODUCT_IMAGE_INFO_HEIGHT * $this->pdf_to_mm_faktor;
     //W. Kaiser -- AJAX
     //Use 'product_info.php' also for printing!!
     $isprint_version = true;
     $is_pdf = true;
     include DIR_WS_MODULES . 'product_info.php';
     //W. Kaiser -- AJAX
     global $products_data;
     //Get Data fram Smarty
     $products_data = array();
     $products_data[] = $imagewidth;
     $products_data[] = $imageheight;
     while (list($key, $value) = each($info_smarty->_tpl_vars)) {
         $products_data[$key] = $value;
     }
     require_once DIR_FS_INC . 'olc_get_smarty_config_variable.inc.php';
     $products_data['SHIPPING_DESC'] = olc_get_smarty_config_variable($info_smarty, 'product_info', 'text_shippingtime');
     $this->AddPage();
     $this->DrawCells($products_data);
     $this->SetY(max($this->y_after_description, $this->y_after_image) + $this->cells_height);
     if (PDF_SHOW_OPTIONS) {
         $products_options_name_sql = "\n\t\t\t\tselect distinct\n\t\t\t\tpopt.products_options_id,\n\t\t\t\tpopt.products_options_name\n\t\t\t\tfrom " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib\n\t\t\t\twhere\n\t\t\t\tpatrib.products_id='" . $products_id . "' and\n\t\t\t\tpatrib.options_id = popt.products_options_id and\n\t\t\t\tpopt.language_id = '" . SESSION_LANGUAGE_ID . APOS;
         $products_options_name = olc_db_query($products_options_name_sql);
         if (olc_db_num_rows($products_options_name)) {
             $this->DrawSeparatorLine();
             //pov.products_options_values_thumbnail,
             $products_options_sql0 = "\n\t\t\t\tselect\n\t\t\t\tpov.products_options_values_id,\n\t\t\t\tpov.products_options_values_name,\n\t\t\t\tpa.options_values_price,\n\t\t\t\tpa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where\n\t\t\t\tpa.products_id = '" . $products_id . "'\n\t\t\t\tand pa.options_id = '#'\n\t\t\t\tand pa.options_values_id = pov.products_options_values_id\n\t\t\t\tand pov.language_id = '" . SESSION_LANGUAGE_ID . "'\n\t\t\t\torder by pov.products_options_values_name";
             $this->SetFont($this->font, BOLD, 10);
             $special_price_color_text = explode(COMMA, PDF_SPECIAL_PRICE_COLOR_TEXT);
             $this->SetTextColor($special_price_color_text[0], $special_price_color_text[1], $special_price_color_text[2]);
             $this->MultiCell(0, 8, TEXT_PRODUCTS_OPTIONS . $print_catalog_array['name'], 0, LEFT, 0);
             $this->SetFont($this->font, EMPTY_STRING, 8);
             $options_color_text = explode(COMMA, PDF_OPTIONS_COLOR);
             $this->SetTextColor($options_color_text[0], $options_color_text[1], $options_color_text[2]);
             $options_color_text = explode(COMMA, PDF_OPTIONS_BG_COLOR);
             $this->SetFillColor($options_color_text[0], $options_color_text[1], $options_color_text[2]);
             if (PDF_OPTIONS_AS_IMAGES_ENABLED == TRUE_STRING_S) {
                 //OAI query
                 if (PDF_SHOW_OPTIONS_VERTICAL != 0) {
                     while ($products_options_name_values = olc_db_fetch_array($products_options_name)) {
                         $this->Ln(6);
                         $this->SetFont($this->font, BOLD, 11);
                         $this->Cell(190, $this->cells_height, $products_options_name_values['products_options_name'], 0, 0, LEFT);
                         $this->Ln();
                         $products_options_sql = str_replace(HASH, $products_options_name_values['products_options_id'], $products_options_sql0);
                         $products_options = olc_db_query($products_options_sql);
                         $count_options_values = olc_db_num_rows($products_options);
                         $count_options = 0;
                         $largest_y = $this->GetY();
                         //OAI query
                         $products_options_query = olc_db_query($products_options_query_sql);
                         while ($products_options_values = olc_db_fetch_array($products_options_query)) {
                             $products_options_values_name = $products_options_values['products_options_values_name'];
                             $w = $this->GetStringWidth($products_options_values_name) + 2;
                             $this->SetFont($this->font, EMPTY_STRING, 10);
                             $this->SetTextColor($body_color_text[0], $body_color_text[1], $body_color_text[2]);
                             $option_string = $products_options_values_name;
                             $current_x = $this->GetX();
                             if (PDF_SHOW_OPTIONS_PRICE) {
                                 $options_values_price = $products_options_values['options_values_price'];
                                 if ($options_values_price != ' 0.0000') {
                                     $option_string .= LPAREN . $products_options_values['price_prefix'] . olc_format_price($options_values_price, true, true, true) . RPAREN;
                                 }
                             }
                             $count_options++;
                             $add_to = $count_options_values != $count_options ? ',' : '.';
                             $this->Write($this->cells_height, $option_string . $add_to);
                             $largest_y = $this->GetY();
                             $next_x = $this->GetX();
                             if ($products_options_name_values['products_options_images_enabled'] == TRUE_STRING_S) {
                                 $path_to_image = DIR_IMAGE . 'options/' . $products_options_values['products_options_values_thumbnail'];
                                 $img_size = GetImageSize($path_to_image);
                                 $img_h = $img_size[1] * $this->pdf_to_mm_faktor;
                                 $img_w = $img_size[0] * $this->pdf_to_mm_faktor;
                                 if ($next_x < $current_x + $img_w) {
                                     $next_x = $current_x + $img_w;
                                 }
                                 $current_y = $this->GetY();
                                 $image_y = $this->GetY() + $this->cells_height;
                                 $largest_y = $image_y + $img_h;
                                 $this->SetY($image_y);
                                 $this->SetX($current_x);
                                 $this->ShowImage($img_w, $img_h, $path_to_image);
                                 //, false, 0);
                                 $this->SetY($current_y);
                                 $this->SetX($next_x);
                             }
                             $this->Cell(3, 6, EMPTY_STRING, 0, 0, CENTER);
                             $this->SetTextColor('Black');
                         }
                         $this->SetY($largest_y);
                     }
                 } else {
                     // Option values are displayed vertically
                     while ($products_options_name_values = olc_db_fetch_array($products_options_name)) {
                         $this->Ln(6);
                         $this->SetFont($this->font, BOLD, 11);
                         $this->Cell(190, $this->cells_height, $products_options_name_values['products_options_name'], 0, 0, LEFT);
                         $this->Ln();
                         $products_options_sql = str_replace(HASH, $products_options_name_values['products_options_id'], $products_options_sql0);
                         $products_options = olc_db_query($products_options_sql);
                         $count_options_values = olc_db_num_rows($products_options);
                         //OAI query
                         $products_options_query = olc_db_query($products_options_query_sql);
                         // Loop on all option values
                         while ($products_options_values = olc_db_fetch_array($products_options_query)) {
                             $this->SetFont($this->font, EMPTY_STRING, 9);
                             $this->SetTextColor($body_color_text[0], $body_color_text[1], $body_color_text[2]);
                             $option_string = $products_options_values['products_options_values_name'];
                             if (PDF_SHOW_OPTIONS_PRICE) {
                                 $options_values_price = $products_options_values['options_values_price'];
                                 if ($options_values_price != ' 0.0000') {
                                     $option_string .= LPAREN . $products_options_values['price_prefix'] . olc_format_price($options_values_price, true, true, true) . RPAREN;
                                 }
                             }
                             $count_options++;
                             $add_to = $count_options_values != $count_options ? ',' : '.';
                             $this->Write($this->cells_height, $option_string . $add_to);
                             if ($products_options_name_values['products_options_images_enabled'] == TRUE_STRING_S) {
                                 $path_to_image = DIR_IMAGE . 'options/' . $products_options_values['products_options_values_thumbnail'];
                                 $img_size = GetImageSize($path_to_image);
                                 $img_h = $img_size[1] * $this->pdf_to_mm_faktor;
                                 $img_w = $img_size[0] * $this->pdf_to_mm_faktor;
                                 $this->SetX(50);
                                 $this->ShowImage($img_w, $img_h, $path_to_image);
                                 //, false, 0);
                                 $this->SetX(0);
                             }
                             $this->Ln();
                         }
                         // end loop on options values
                     }
                     // end loop on options
                 }
             } else {
                 $this->Ln(-$this->cells_height);
                 while ($products_options_name_values = olc_db_fetch_array($products_options_name)) {
                     $this->Ln($this->cells_height);
                     $this->SetFont($this->font, BOLD, 11);
                     $this->Cell($this->w, $this->cells_height, $products_options_name_values['products_options_name'], 0, 0, LEFT);
                     $this->Ln();
                     $products_options_sql = str_replace(HASH, $products_options_name_values['products_options_id'], $products_options_sql0);
                     $products_options = olc_db_query($products_options_sql);
                     $option_string = EMPTY_STRING;
                     $count_options_values = olc_db_num_rows($products_options);
                     $count_options = 0;
                     while ($products_options_values = olc_db_fetch_array($products_options)) {
                         $option_string .= $products_options_values['products_options_values_name'];
                         //. $option_value;
                         if (PDF_SHOW_OPTIONS_PRICE) {
                             $options_values_price = $products_options_values['options_values_price'];
                             if ($options_values_price != ' 0.0000') {
                                 $option_string .= LPAREN . $products_options_values['price_prefix'] . olc_format_price($options_values_price, true, true, true) . RPAREN;
                             }
                         }
                         $count_options++;
                         $option_string .= $count_options_values != $count_options ? COMMA_BLANK : DOT;
                     }
                     $this->SetFont($this->font, EMPTY_STRING, 8);
                     $w = $this->w - $this->lMargin - $this->rMargin;
                     $this->SetX($this->lMargin);
                     $this->MultiCell($w, $this->cells_height, $option_string, 0, LEFT, 1);
                 }
             }
         }
     }
     $s = $products_data['PRODUCTS_SOLD_OUT'];
     if ($s) {
         $this->Ln($this->cells_height * 2);
         $y = $this->GetY();
         $this->SetTextColor('red');
         $this->SetFont($this->font, BOLD, $this->FontSizePt);
         $s = strip_tags($s);
         $this->Text($this->lMargin, $y, $s);
         $s1 = $products_data['PRODUCTS_DATE_AVAILABLE'];
         if ($s1) {
             $this->SetTextColor('Darkgreen');
             $this->Text($this->lMargin + $this->GetStringWidth($s), $y, BLANK . strip_tags($s1));
         }
         $this->Ln($this->cells_height);
     }
     if (PDF_SHOW_DATE_ADDED_AVAILABLE) {
         //Date available
         $s = $products_data['PRODUCTS_DATE_ADDED'];
         if ($s) {
             $x = $this->GetX();
             $y = $this->GetY();
             $this->SetFont($this->font, ITALIC, 9);
             $this->Ln($this->cells_height);
             $new_color_table = explode(COMMA, PDF_HEADER_COLOR_TABLE);
             $this->SetFillColor($new_color_table[0], $new_color_table[1], $new_color_table[2]);
             $product_name_color_text = explode(COMMA, PDF_PRODUCT_NAME_COLOR_TEXT);
             $this->SetTextColor($product_name_color_text[0], $product_name_color_text[1], $product_name_color_text[2]);
             $this->MultiCell(0, $this->cells_height, sprintf(TEXT_DATE_ADDED, olc_date_short($s)), 0, LEFT, 1);
         }
     }
 }
$smarty->assign('FORM_ACTION', olc_draw_form('params', olc_href_link(FILENAME_AFFILIATE_SALES), 'get', SSL));
$affiliate_sales_table = '';
if ($affiliate_sales_split->number_of_rows > 0) {
    $number_of_sales = 0;
    $sum_of_earnings = 0;
    do {
        $number_of_sales++;
        if ($affiliate_sales['orders_status_id'] >= AFFILIATE_PAYMENT_ORDER_MIN_STATUS) {
            $sum_of_earnings += $affiliate_sales['affiliate_payment'];
        }
        if ($number_of_sales / 2 == floor($number_of_sales / 2)) {
            $affiliate_sales_table .= '<tr class="productListing-even">';
        } else {
            $affiliate_sales_table .= '<tr class="productListing-odd">';
        }
        $affiliate_sales_table .= '<td class="smallText" align="center">' . olc_date_short($affiliate_sales['affiliate_date']) . '</td>';
        $affiliate_sales_table .= '<td class="smallText" align="right">' . $currencies->display_price($affiliate_sales['affiliate_value'], '') . '</td>';
        $affiliate_sales_table .= '<td class="smallText" align="right">' . $affiliate_sales['affiliate_percent'] . " %" . '</td>';
        $affiliate_sales_table .= '<td class="smallText" align="right">' . ($affiliate_sales['level'] > 0 ? $affiliate_sales['level'] : TEXT_AFFILIATE_PERSONAL_LEVEL_SHORT) . '</td>';
        $affiliate_sales_table .= '<td class="smallText" align="right">' . $currencies->display_price($affiliate_sales['affiliate_payment'], '') . '</td>';
        $affiliate_sales_table .= '<td class="smallText" align="right">' . ($affiliate_sales['orders_status'] != '' ? $affiliate_sales['orders_status'] : TEXT_DELETED_ORDER_BY_ADMIN) . '</td>';
        $affiliate_sales_table .= '</tr>';
    } while ($affiliate_sales = olc_db_fetch_array($affiliate_sales_values));
    $smarty->assign('affiliate_sales_table', $affiliate_sales_table);
}
if ($affiliate_sales_split->number_of_rows > 0) {
    $smarty->assign('affiliate_sales_count', $affiliate_sales_split->display_count(TEXT_DISPLAY_NUMBER_OF_SALES));
    $smarty->assign('affiliate_sales_links', $affiliate_sales_split->display_links(MAX_DISPLAY_PAGE_LINKS, olc_get_all_get_params(array('page', 'info', 'x', 'y'))));
}
$smarty->assign('affiliate_sales_total', $currencies->display_price($sum_of_earnings, ''));
$main_content = $smarty->fetch(CURRENT_TEMPLATE_MODULE . 'affiliate_sales' . HTML_EXT, SMARTY_CACHE_ID);
                    $amount = $currencies->format($amount);
                }
                if ($_GET['action'] == 'voucherdelete') {
                    $contents[] = array('text' => TEXT_CONFIRM_DELETE . '</br></br>' . HTML_A_START . olc_href_link('coupon_admin.php', 'action=confirmdelete&cid=' . $_GET['cid'], NONSSL) . '">' . olc_image_button('button_confirm.gif', 'Confirm Delete Voucher') . HTML_A_END . HTML_A_START . olc_href_link('coupon_admin.php', 'cid=' . $cInfo->coupon_id, NONSSL) . '">' . olc_image_button('button_cancel.gif', 'Cancel') . HTML_A_END);
                } else {
                    $prod_details = NONE;
                    if ($cInfo->restrict_to_products) {
                        $prod_details = '<A href="listproducts.php?cid=' . $cInfo->coupon_id . '" TARGET="_blank" onclick="javascript:window.open(\'listproducts.php?cid=' . $cInfo->coupon_id . '\', \'Valid_Categories\', \'scrollbars=yes,resizable=yes,menubar=yes,width=600,height=600\'); return false">View</A>';
                    }
                    $cat_details = NONE;
                    if ($cInfo->restrict_to_categories) {
                        $cat_details = '<A href="listcategories.php?cid=' . $cInfo->coupon_id . '" TARGET="_blank" onclick="javascript:window.open(\'listcategories.php?cid=' . $cInfo->coupon_id . '\', \'Valid_Categories\', \'scrollbars=yes,resizable=yes,menubar=yes,width=600,height=600\'); return false">View</A>';
                    }
                    $coupon_name_query = olc_db_query("select coupon_name from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cInfo->coupon_id . "' and language_id = '" . SESSION_LANGUAGE_ID . APOS);
                    $coupon_name = olc_db_fetch_array($coupon_name_query);
                    $contents[] = array('text' => COUPON_NAME . '&nbsp;::&nbsp; ' . $coupon_name['coupon_name'] . HTML_BR . COUPON_AMOUNT . '&nbsp;::&nbsp; ' . $amount . HTML_BR . COUPON_STARTDATE . '&nbsp;::&nbsp; ' . olc_date_short($cInfo->coupon_start_date) . HTML_BR . COUPON_FINISHDATE . '&nbsp;::&nbsp; ' . olc_date_short($cInfo->coupon_expire_date) . HTML_BR . COUPON_USES_COUPON . '&nbsp;::&nbsp; ' . $cInfo->uses_per_coupon . HTML_BR . COUPON_USES_USER . '&nbsp;::&nbsp; ' . $cInfo->uses_per_user . HTML_BR . COUPON_PRODUCTS . '&nbsp;::&nbsp; ' . $prod_details . HTML_BR . COUPON_CATEGORIES . '&nbsp;::&nbsp; ' . $cat_details . HTML_BR . DATE_CREATED . '&nbsp;::&nbsp; ' . olc_date_short($cInfo->date_created) . HTML_BR . DATE_MODIFIED . '&nbsp;::&nbsp; ' . olc_date_short($cInfo->date_modified) . '<br/><br/>' . '<center><a href="' . olc_href_link('coupon_admin.php', 'action=email&cid=' . $cInfo->coupon_id, NONSSL) . '">' . olc_image_button('button_email.gif', 'Email Voucher') . HTML_A_END . HTML_A_START . olc_href_link('coupon_admin.php', 'action=voucheredit&cid=' . $cInfo->coupon_id, NONSSL) . '">' . olc_image_button('button_edit.gif', 'Edit Voucher') . HTML_A_END . HTML_A_START . olc_href_link('coupon_admin.php', 'action=voucherdelete&cid=' . $cInfo->coupon_id, NONSSL) . '">' . olc_image_button('button_delete.gif', 'Delete Voucher') . HTML_A_END . '<br/><a href="' . olc_href_link('coupon_admin.php', 'action=voucherreport&cid=' . $cInfo->coupon_id, NONSSL) . '">' . olc_image_button('button_report.gif', 'Voucher Report') . '</a></center>');
                }
                break;
        }
        ?>
    <td width="25%" valign="top">
<?php 
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . NEW_LINE;
}
?>
      </tr>
    </table></td>
<?php 
require DIR_WS_INCLUDES . 'application_bottom.php';
    $affiliate_clickthroughs_values = olc_db_query($affiliate_clickthroughs_raw);
    $number_of_clickthroughs = '0';
    while ($affiliate_clickthroughs = olc_db_fetch_array($affiliate_clickthroughs_values)) {
        $number_of_clickthroughs++;
        if ($number_of_clickthroughs / 2 == floor($number_of_clickthroughs / 2)) {
            echo '                  <tr class="productListing-even">';
        } else {
            echo '                  <tr class="productListing-odd">';
        }
        ?>
                <td class="dataTableContent"><?php 
        echo $affiliate_clickthroughs['affiliate_firstname'] . BLANK . $affiliate_clickthroughs['affiliate_lastname'];
        ?>
</td>
                <td class="dataTableContent" align="center"><?php 
        echo olc_date_short($affiliate_clickthroughs['affiliate_clientdate']);
        ?>
</td>
<?php 
        if ($affiliate_clickthroughs['affiliate_products_id'] > 0) {
            $link_to = HTML_A_START . olc_catalog_href_link(FILENAME_CATALOG_PRODUCT_INFO, 'products_id=' . $affiliate_clickthroughs['affiliate_products_id']) . '" target="_blank">' . $affiliate_clickthroughs['products_name'] . HTML_A_END;
        } else {
            $link_to = "Startpage";
        }
        ?>
                <td class="dataTableContent"><?php 
        echo $link_to;
        ?>
</td>
                <td class="dataTableContent" align="center"><?php 
        echo $affiliate_clickthroughs['affiliate_clientbrowser'];
        $contents[] = array('text' => HTML_BR . TEXT_INFO_CLASS_DESCRIPTION . HTML_BR . olc_draw_input_field('tax_class_description', $tcInfo->tax_class_description));
        $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_update.gif', IMAGE_UPDATE) . '&nbsp;<a href="' . olc_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
        break;
    case 'delete':
        $heading[] = array('text' => HTML_B_START . TEXT_INFO_HEADING_DELETE_TAX_CLASS . HTML_B_END);
        $contents = array('form' => olc_draw_form('classes', FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=deleteconfirm'));
        $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
        $contents[] = array('text' => '<br/><b>' . $tcInfo->tax_class_title . HTML_B_END);
        $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . olc_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
        break;
    default:
        if (is_object($tcInfo)) {
            $heading[] = array('text' => HTML_B_START . $tcInfo->tax_class_title . HTML_B_END);
            $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=edit') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_TAX_CLASSES, 'page=' . $_GET['page'] . '&tID=' . $tcInfo->tax_class_id . '&action=delete') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
            $contents[] = array('text' => HTML_BR . TEXT_INFO_DATE_ADDED . BLANK . olc_date_short($tcInfo->date_added));
            $contents[] = array('text' => '' . TEXT_INFO_LAST_MODIFIED . BLANK . olc_date_short($tcInfo->last_modified));
            $contents[] = array('text' => HTML_BR . TEXT_INFO_CLASS_DESCRIPTION . HTML_BR . $tcInfo->tax_class_description);
        }
        break;
}
if (olc_not_null($heading) && olc_not_null($contents)) {
    echo '            <td width="25%" valign="top">' . NEW_LINE;
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . NEW_LINE;
}
?>
          </tr>
        </table></td>
      </tr>
    </table></td>
switch ($coupon['coupon_type']) {
    case 'F':
        $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, $olPrice->olcFormat($coupon['coupon_amount'], true));
        break;
    case 'P':
        $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, number_format($coupon['coupon_amount'], 2) . '%');
        break;
    case 'S':
        $text_coupon_help .= TEXT_COUPON_HELP_FREESHIP;
        break;
    default:
}
if ($coupon['coupon_minimum_order'] > 0) {
    $text_coupon_help .= sprintf(TEXT_COUPON_HELP_MINORDER, $olPrice->olcFormat($coupon['coupon_minimum_order'], true));
}
$text_coupon_help .= sprintf(TEXT_COUPON_HELP_DATE, olc_date_short($coupon['coupon_start_date']), olc_date_short($coupon['coupon_expire_date']));
$text_coupon_help .= HTML_B_START . TEXT_COUPON_HELP_RESTRICT . HTML_B_END;
$text_coupon_help .= '<br/><br/>' . TEXT_COUPON_HELP_CATEGORIES;
$coupon_get = olc_db_query("select restrict_to_categories from " . TABLE_COUPONS . " where coupon_id='" . (int) $_GET['cID'] . APOS);
$get_result = olc_db_fetch_array($coupon_get);
$cat_ids = split("[,]", $get_result['restrict_to_categories']);
for ($i = 0; $i < count($cat_ids); $i++) {
    $result = olc_db_query("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id and cd.language_id = '" . SESSION_LANGUAGE_ID . "' and c.categories_id='" . $cat_ids[$i] . APOS);
    if ($row = olc_db_fetch_array($result)) {
        $cats .= HTML_BR . $row["categories_name"];
    }
}
if ($cats == '') {
    $cats = '<br />NONE';
}
$text_coupon_help .= $cats;
            $contents[] = array('text' => '<br/><b>' . $abInfo->affiliate_banners_title . HTML_B_END);
            if ($abInfo->affiliate_banners_image) {
                $contents[] = array('text' => HTML_BR . olc_draw_checkbox_field('delete_image', 'on', true) . BLANK . TEXT_INFO_DELETE_IMAGE);
            }
            $contents[] = array('align' => 'center', 'text' => HTML_BR . olc_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $_GET['abID']) . '">' . olc_image_button('button_cancel.gif', IMAGE_CANCEL) . HTML_A_END);
            break;
        default:
            if (is_object($abInfo)) {
                $sql = "select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $abInfo->affiliate_products_id . "' and language_id = '" . SESSION_LANGUAGE_ID . APOS;
                $product_description_query = olc_db_query($sql);
                $product_description = olc_db_fetch_array($product_description_query);
                $heading[] = array('text' => HTML_B_START . $abInfo->affiliate_banners_title . HTML_B_END);
                $contents[] = array('align' => 'center', 'text' => HTML_A_START . olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=new') . '">' . olc_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . olc_href_link(FILENAME_AFFILIATE_BANNER_MANAGER, 'page=' . $_GET['page'] . '&abID=' . $abInfo->affiliate_banners_id . '&action=delete') . '">' . olc_image_button('button_delete.gif', IMAGE_DELETE) . HTML_A_END);
                $contents[] = array('text' => $product_description['products_name']);
                $contents[] = array('text' => HTML_BR . TEXT_BANNERS_DATE_ADDED . BLANK . olc_date_short($abInfo->affiliate_date_added));
                $contents[] = array('text' => '' . sprintf(TEXT_BANNERS_STATUS_CHANGE, olc_date_short($abInfo->affiliate_date_status_change)));
            }
            break;
    }
    if (olc_not_null($heading) && olc_not_null($contents)) {
        echo '            <td width="25%" valign="top">' . NEW_LINE;
        $box = new box();
        echo $box->infoBox($heading, $contents);
        echo '            </td>' . NEW_LINE;
    }
    ?>
	</tr>
	</table></td>
	</tr>
	<?php 
}
     }
 }
 if (strlen($a_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_firstname_error = true;
 } else {
     $entry_firstname_error = false;
 }
 if (strlen($a_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_lastname_error = true;
 } else {
     $entry_lastname_error = false;
 }
 if (ACCOUNT_DOB == TRUE_STRING_S) {
     if (checkdate(substr(olc_date_short($a_dob), 4, 2), substr(olc_date_short($a_dob), 6, 2), substr(olc_date_short($a_dob), 0, 4))) {
         $entry_date_of_birth_error = false;
     } else {
         $error = true;
         $entry_date_of_birth_error = true;
     }
 }
 if (strlen($a_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
     $error = true;
     $entry_email_address_error = true;
 } else {
     $entry_email_address_error = false;
 }
 if (!olc_validate_email($a_email_address)) {
     $error = true;
     $entry_email_address_check_error = true;