set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
$valid_product = false;
if (isset($HTTP_GET_VARS['products_id'])) {
$product_info_query = tep_db_query("select pd.products_name, p.products_model, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
if (tep_db_num_rows($product_info_query)) {
$valid_product = true;
$product_info = tep_db_fetch_array($product_info_query);
}
}
if ($valid_product == false) {
// tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ASK_QUESTION);
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
include_once 'securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// you should handle the error so that the form processor doesn't continue
// or you can use the following code if there is no validation or you do not know how
$the_message = SECURITY_CODE_ERROR;
// exit;
}
else
{
$error = false;
$to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
$to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
$from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
$from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
$message = tep_db_prepare_input($HTTP_POST_VARS['message']);
if (empty($from_name)) {
$error = true;
$messageStack->add('friend', ERROR_FROM_NAME);
}
if (!tep_validate_email($from_email_address)) {
$error = true;
$messageStack->add('friend', ERROR_FROM_ADDRESS);
}
if ($error == false) {
$email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
$email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], $product_info['products_model'], STORE_NAME) . "\n\n";
if (tep_not_null($message)) {
$email_body .= $message . "\n\n";
}
$email_body .= sprintf(TEXT_EMAIL_LINK, tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])) . "\n\n" .
sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $email_subject, $email_body, $from_name, $from_email_address);
$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');
tep_redirect(tep_href_link(FILENAME_ASK_QUESTION_POPUP, 'products_id=' . $HTTP_GET_VARS['products_id']));
}
}
}
elseif (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);
$from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
$from_email_address = $account['customers_email_address'];
}
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_ASK_QUESTION_POPUP, 'products_id=' . $HTTP_GET_VARS['products_id']));
?>
>
|
|
|
size('friend') > 0) {
?>
output('friend'); ?> |
|
|
|
|
|
|
|