[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/templates/fallback/content/ -> wishlist_email.tpl.php (source)

   1  <!-- body_text //-->
   2      <table border="0" width="100%" cellspacing="0" cellpadding="0">
   3        <tr>
   4          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
   5            <tr>
   6              <td class="pageHeading"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></td>
   7              <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_contact_us.gif', sprintf(HEADING_TITLE, $product_info['products_name']), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
   8            </tr>
   9          </table></td>
  10        </tr>
  11        <tr>
  12          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  13        </tr>
  14  <?php
  15      $error = false;
  16  
  17      if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && !tep_validate_email(trim($HTTP_POST_VARS['friendemail']))) {
  18        $friendemail_error = true;
  19        $error = true;
  20      } else {
  21        $friendemail_error = false;
  22      }
  23  
  24      if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && empty($HTTP_POST_VARS['friendname'])) {
  25        $friendname_error = true;
  26        $error = true;
  27      } else {
  28        $friendname_error = false;
  29      }
  30  
  31      if (tep_session_is_registered('customer_id')) {
  32        $from_name = $account_values['customers_firstname'] . ' ' . $account_values['customers_lastname'];
  33        $from_email_address = $account_values['customers_email_address'];
  34      } else {
  35        $from_name = $HTTP_POST_VARS['yourname'];
  36        $from_email_address = $HTTP_POST_VARS['from'];
  37      }
  38  
  39      if (!tep_session_is_registered('customer_id')) {
  40        if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && !tep_validate_email(trim($from_email_address))) {
  41          $fromemail_error = true;
  42          $error = true;
  43        } else {
  44          $fromemail_error = false;
  45        }
  46      }
  47  
  48      if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && empty($from_name)) {
  49        $fromname_error = true;
  50        $error = true;
  51      } else {
  52        $fromname_error = false;
  53      }
  54  
  55      if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && ($error == false)) {
  56        $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
  57        $email_body = sprintf(TEXT_EMAIL_INTRO, $HTTP_POST_VARS['friendname'], $from_name, $HTTP_POST_VARS['products_name'], STORE_NAME) . "\n\n";
  58  
  59  //      if (tep_not_null($HTTP_POST_VARS['yourmessage'])) {
  60          $email_body .= $wishliststring . "\n\n" . $HTTP_POST_VARS['yourmessage'] . "\n\n";
  61  //      }
  62  
  63        $email_body .= sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n"). "<A HREF=\"". HTTP_SERVER . DIR_WS_CATALOG ."\"><b><i>".STORE_NAME."</i></b></A> "."\n";
  64  
  65                       "\n\n" . $mywishlist .= $wishlist_query_array[1] ."\n";
  66  
  67  
  68        tep_mail($HTTP_POST_VARS['friendname'], $HTTP_POST_VARS['friendemail'], $email_subject, stripslashes($email_body), '', $from_email_address);
  69  ?>
  70        <tr>
  71          <td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
  72            <tr>
  73              <td class="main"><?php echo sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $HTTP_POST_VARS['friendemail']); ?></td>
  74            </tr>
  75          </table></td>
  76        </tr>
  77        <tr>
  78          <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_WISHLIST) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
  79        </tr>
  80  <?php
  81      } else {
  82        if (tep_session_is_registered('customer_id')) {
  83          $your_name_prompt = $account_values['customers_firstname'] . ' ' . $account_values['customers_lastname'];
  84          $your_email_address_prompt = $account_values['customers_email_address'];
  85        } else {
  86          $your_name_prompt = tep_draw_input_field('yourname', (($fromname_error == true) ? $HTTP_POST_VARS['yourname'] : $HTTP_GET_VARS['yourname']));
  87          if ($fromname_error == true) $your_name_prompt .= '&nbsp;' . TEXT_REQUIRED;
  88          $your_email_address_prompt = tep_draw_input_field('from', (($fromemail_error == true) ? $HTTP_POST_VARS['from'] : $HTTP_GET_VARS['from']));
  89          if ($fromemail_error == true) $your_email_address_prompt .= ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
  90        }
  91  ?>
  92        <tr>
  93          <td><?php echo tep_draw_form('email_friend', tep_href_link(FILENAME_WISHLIST_SEND, 'action=process&products_id=' . $HTTP_GET_VARS['products_id'])) . tep_draw_hidden_field('products_name', $product_info['products_name']); ?><table border="0" width="100%" cellspacing="0" cellpadding="2">
  94            <tr>
  95              <td class="formAreaTitle"><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></td>
  96            </tr>
  97            <tr>
  98              <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
  99                <tr>
 100                  <td class="main"><table border="0" cellspacing="0" cellpadding="2">
 101                    <tr>
 102                      <td class="main"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
 103                      <td class="main"><?php echo $your_name_prompt; ?></td>
 104                    </tr>
 105                    <tr>
 106                      <td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
 107                      <td class="main"><?php echo $your_email_address_prompt; ?></td>
 108                    </tr>
 109                  </table></td>
 110                </tr>
 111              </table></td>
 112            </tr>
 113            <tr>
 114              <td class="formAreaTitle"><br><?php echo FORM_TITLE_FRIEND_DETAILS; ?></td>
 115            </tr>
 116            <tr>
 117              <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
 118                <tr>
 119                  <td class="main"><table border="0" cellspacing="0" cellpadding="2">
 120                    <tr>
 121                      <td class="main"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
 122                      <td class="main"><?php echo tep_draw_input_field('friendname', (($friendname_error == true) ? $HTTP_POST_VARS['friendname'] : $HTTP_GET_VARS['friendname'])); if ($friendname_error == true) echo '&nbsp;' . TEXT_REQUIRED;?></td>
 123                    </tr>
 124                    <tr>
 125                      <td class="main"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
 126                      <td class="main"><?php echo tep_draw_input_field('friendemail', (($friendemail_error == true) ? $HTTP_POST_VARS['friendemail'] : $HTTP_GET_VARS['send_to'])); if ($friendemail_error == true) echo ENTRY_EMAIL_ADDRESS_CHECK_ERROR; ?></td>
 127                    </tr>
 128                  </table></td>
 129                </tr>
 130              </table></td>
 131            </tr>
 132            <tr>
 133              <td class="formAreaTitle"><br><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></td>
 134            </tr>
 135            <tr>
 136              <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea">
 137                <tr>
 138                  <td><textarea name="yourmessage" cols=40 rows=4></textarea></td>
 139                </tr>
 140              </table></td>
 141            </tr>
 142            <tr>
 143              <td><br><table border="0" width="100%" cellspacing="0" cellpadding="0">
 144                <tr>
 145                  <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_WISHLIST) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
 146                  <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
 147                </tr>
 148              </table></td>
 149            </tr>
 150          </table></form></td>
 151        </tr>
 152  <?php
 153      }
 154  
 155  ?>
 156      </table>
 157  <!-- body_text_eof //-->


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7