[Phesis-commits] Loaded_3/admin/admin gv_mail.php,1.1,1.2
Status: Beta
Brought to you by:
wilt
|
From: <wi...@us...> - 2002-10-06 16:00:43
|
Update of /cvsroot/phesis/Loaded_3/admin/admin
In directory usw-pr-cvs1:/tmp/cvs-serv25667/admin/admin
Modified Files:
gv_mail.php
Log Message:
update to curretn credit class gv
Index: gv_mail.php
===================================================================
RCS file: /cvsroot/phesis/Loaded_3/admin/admin/gv_mail.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** gv_mail.php 9 Sep 2002 20:32:30 -0000 1.1
--- gv_mail.php 6 Oct 2002 16:00:39 -0000 1.2
***************
*** 16,20 ****
! if ( ($HTTP_GET_VARS['action'] == 'send_email_to_user') && ($HTTP_POST_VARS['customers_email_address']) && (!$HTTP_POST_VARS['back_x']) ) {
switch ($HTTP_POST_VARS['customers_email_address']) {
case '***':
--- 16,20 ----
! if ( ($HTTP_GET_VARS['action'] == 'send_email_to_user') && ($HTTP_POST_VARS['customers_email_address'] || $HTTP_POST_VARS['email_to']) && (!$HTTP_POST_VARS['back_x']) ) {
switch ($HTTP_POST_VARS['customers_email_address']) {
case '***':
***************
*** 31,34 ****
--- 31,37 ----
$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
$mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+ if ($HTTP_POST_VARS['email_to']) {
+ $mail_sent_to = $HTTP_POST_VARS['email_to'];
+ }
break;
}
***************
*** 60,70 ****
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
// now create the tracking entry
! $gv_query=tep_db_query("insert into gv_tracking (gv_number, date_created, customer_id_sent, sent_firstname, sent_surname, emailed_to, gv_amount) values ('".$id1."', NOW(),'0','Sent by','Admin','".$mail['customers_email_address']."','".$HTTP_POST_VARS['amount']."')");
}
-
tep_redirect(tep_href_link(FILENAME_GV_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
}
! if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['customers_email_address']) ) {
$messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
}
--- 63,96 ----
$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
// now create the tracking entry
! $gv_query=tep_db_query("insert into gv_tracking (gv_number, date_created, customer_id_sent, sent_firstname, sent_surname, emailed_to, gv_amount) values ('".$id1."', NOW(),'0','Sent by','Admin','".$mail['customers_email_address']."','".$HTTP_POST_VARS['amount']."')");
! }
! if ($HTTP_POST_VARS['email_to']) {
! $salt=$HTTP_POST_VARS['email_to'];
! $gvid = md5(uniqid("","salt"));
! $gvid .= md5(uniqid("","salt"));
! $gvid .= md5(uniqid("","salt"));
! $gvid .= md5(uniqid("","salt"));
! srand((double)microtime()*1000000); // seed the random number generator
! $random_start = @rand(0, (128-16));
! $id1=substr($gvid, $random_start,16);
! $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
! $message .= "\n\n" . TEXT_GV_WORTH . $currencies->format($HTTP_POST_VARS['amount']) . "\n\n";
! $message .= TEXT_TO_REDEEM;
! $message .= TEXT_WHICH_IS . $id1 . TEXT_IN_CASE . "\n\n";
! $message .= HTTP_SERVER . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='.$id1 . "\n\n";
! $message .= TEXT_OR_VISIT . HTTP_SERVER . DIR_WS_CATALOG . 'gv_redeem.php' . TEXT_ENTER_CODE . $id1;
!
! //Let's build a message object using the email class
! $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
! // add the message to the object
! $mimemessage->add_text($message);
! $mimemessage->build_message();
! $mimemessage->send('Friend', $HTTP_POST_VARS['email_to'], '', $from, $subject);
! $gv_query=tep_db_query("insert into gv_tracking (gv_number, date_created, customer_id_sent, sent_firstname, sent_surname, emailed_to, gv_amount) values ('".$id1."', NOW(),'0','Sent by','Admin','".$HTTP_POST_VARS['email_to']."','".$HTTP_POST_VARS['amount']."')");
}
tep_redirect(tep_href_link(FILENAME_GV_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
}
! if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['customers_email_address']) && (!$HTTP_POST_VARS['email_to']) ) {
$messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
}
***************
*** 111,115 ****
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
! if ( ($HTTP_GET_VARS['action'] == 'preview') && ($HTTP_POST_VARS['customers_email_address']) ) {
switch ($HTTP_POST_VARS['customers_email_address']) {
case '***':
--- 137,141 ----
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
! if ( ($HTTP_GET_VARS['action'] == 'preview') && ($HTTP_POST_VARS['customers_email_address'] || $HTTP_POST_VARS['email_to']) ) {
switch ($HTTP_POST_VARS['customers_email_address']) {
case '***':
***************
*** 121,124 ****
--- 147,153 ----
default:
$mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
+ if ($HTTP_POST_VARS['email_to']) {
+ $mail_sent_to = $HTTP_POST_VARS['email_to'];
+ }
break;
}
***************
*** 205,209 ****
--- 234,245 ----
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
+ <tr>
+ <td class="main"><?php echo TEXT_TO; ?></td>
+ <td><?php echo tep_draw_input_field('email_to'); ?></td>
+ </tr>
<tr>
+ <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+ </tr>
+ <tr>
<td class="main"><?php echo TEXT_FROM; ?></td>
<td><?php echo tep_draw_input_field('from', EMAIL_FROM); ?></td>
|