From 35532d3731107de625322e3743d90daf9f16f4af Mon Sep 17 00:00:00 2001 From: andryeyev Date: Mon, 30 Nov 2015 14:26:22 +0200 Subject: [PATCH] - купон больше приходит после регистрации --- account/auto_registration.php | 2 +- account/func/func.eMailing.php | 375 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 files changed, 179 insertions(+), 198 deletions(-) diff --git a/account/auto_registration.php b/account/auto_registration.php index 8c0c884..bcae8b5 100644 --- a/account/auto_registration.php +++ b/account/auto_registration.php @@ -61,7 +61,7 @@ if (!isset($_POST['form']['no_account'])) { // - eMailing('auto'); + //eMailing('auto'); } } else { diff --git a/account/func/func.eMailing.php b/account/func/func.eMailing.php index aac737c..5e78d21 100644 --- a/account/func/func.eMailing.php +++ b/account/func/func.eMailing.php @@ -142,11 +142,15 @@ function MimeEncode($str, $data_charset='windows-1251', $send_charset='windows-1 } -function eMailing ($action, $user_id='',$order_id='',$discont_id='') { +function eMailing ($action, $user_id='',$order_id='',$discont_id='') +{ + switch ($action) + { + // ===================== + // ==== ==== + // ===================== - switch ($action) { - - case 'reg': // ===================[ ]========================= + case 'reg': global $_POST; @@ -191,16 +195,15 @@ function eMailing ($action, $user_id='',$order_id='',$discont_id='') { sendMail ($admin['email'], $admin['username'], 'registration@extremstyle.ua', 'extremstyle.ua', $subject, $mail); } - - - - - - - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - $result2 = mysql_query("SELECT * FROM `card` ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); + break; + + // ============== + // ==== NONE ==== + // ============== + + case 'NONE': + + $result2 = mysql_query("SELECT * FROM `card` ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); // $row55 = mysql_fetch_assoc($result2); if(!@$row55['card']) $row55['card'] = 0; @@ -209,88 +212,76 @@ function eMailing ($action, $user_id='',$order_id='',$discont_id='') { $discont_id = $row55['card']; $result2 = mysql_query("INSERT INTO `card` (`card`,`user_id`) VALUES ('".$row55['card']."','".$user['id']."')"); } - - - - - - -$result2 = mysql_query("SELECT * FROM `card` WHERE `card`='".$discont_id."' ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); -$cc = mysql_fetch_assoc($result2); -$to = $user['email']; -$subject = ' ExtremStyle'; -$message = << -
-
- - - - - - - - - - - - -
- - - - - - - - -
- - -
{$cc['card']}
-
- - -
-
- -
- " "! -
- , , *, . -

-* , -
- - -

- :\r\n -http://extremstyle.ua/discont.php?id={$cc['id']}&uid={$user['id']} - - - - + + $result2 = mysql_query("SELECT * FROM `card` WHERE `card`='".$discont_id."' ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); + $cc = mysql_fetch_assoc($result2); + $to = $user['email']; + $subject = ' ExtremStyle'; + $message = +<< +
+
+ + + + + + + + + + + + +
+ + + + + + + + +
+ + +
{$cc['card']}
+
+ + +
+
+ +
+ " "! +
+ , , *, . +

+ * , +
+ + +

+ :\r\n + http://extremstyle.ua/discont.php?id={$cc['id']}&uid={$user['id']} + HTML; -$headers = 'From: ExtremStyle.ua ' . "\r\n"; - -$headers .= 'Content-Type: text/html; charset=windows-1251' . "\r\n"; - -//if($row2['active']=='0') -//@mail($to, $subject, $message, $headers); - - - -//////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - break; + $headers = 'From: ExtremStyle.ua ' . "\r\n"; + + $headers .= 'Content-Type: text/html; charset=windows-1251' . "\r\n"; + + //if($row2['active']=='0') + //@mail($to, $subject, $message, $headers); + + break; + + // ======================== + // ==== ==== + // ======================== - case 'auto': // ===================[ ]========================= + case 'auto': global $_POST; @@ -334,22 +325,8 @@ $headers .= 'Content-Type: text/html; charset=windows-1251' . "\r\n"; // sendMail ($admin['email'], $admin['username'], 'registration@extremstyle.ua', 'extremstyle.ua', $subject, $mail); // } - - - - - - - - - - - - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - $result2 = mysql_query("SELECT * FROM `card` ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); + + $result2 = mysql_query("SELECT * FROM `card` ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); // $row55 = mysql_fetch_assoc($result2); if(!@$row55['card']) $row55['card'] = 0; @@ -358,13 +335,14 @@ $headers .= 'Content-Type: text/html; charset=windows-1251' . "\r\n"; $discont_id = $row55['card']; $result2 = mysql_query("INSERT INTO `card` (`card`,`user_id`) VALUES ('".$row55['card']."','".$user['id']."')"); } - - -$result2 = mysql_query("SELECT * FROM `card` WHERE `card`='".$discont_id."' ORDER BY `card` DESC LIMIT 1;") or die(mysql_error()); -$cc = mysql_fetch_assoc($result2); -$to = $user['email']; -$subject = ' ExtremStyle'; -$message = <<

@@ -439,30 +417,21 @@ $message = << - - -\"Share - - - -\"Share - - - - -\"Share - - -"; + + + \"Share + + + + \"Share + + + + + \"Share + + + "; } $mail= ' - - - -
-
+ + + +
+
,'. $user['username'].'!

.
.


'; -if(!@ShowOrder($user_id, $order_id, $mail)) return false; - - $mail= ShowOrder($user_id, $order_id, $mail); - - $mail.=" - :
-- 1000 . - 30 50 . .
-- 1000 . - .
-
- 1000 - ( ). -

+ if(!@ShowOrder($user_id, $order_id, $mail)) return false; + + $mail= ShowOrder($user_id, $order_id, $mail); + + $mail.=" + :
+ - 1000 . - 30 50 . .
+ - 1000 . - .
+
+ 1000 - ( ). +

: ".$datas." @@ -589,8 +558,12 @@ if(!@ShowOrder($user_id, $order_id, $mail)) return false; eMailing('xml', $user_id, $order_id); break; + + // ======================= + // ==== ==== + // ======================= - case 'order-changed': // ===================[ ]========================= + case 'order-changed': global $lang; @@ -631,8 +604,12 @@ if(!@ShowOrder($user_id, $order_id, $mail)) return false; sendMail ($admin['email'], $admin['username'], 'order@extremstyle.ua', 'extremstyle.ua', $subject, $mail); } - break; - + break; + + // ============= + // ==== xml ==== + // ============= + case 'xml': // @@ -728,7 +705,11 @@ if(!@ShowOrder($user_id, $order_id, $mail)) return false; break; - case 'remind': // ===================[ ]========================= + // ============================ + // ==== ==== + // ============================ + + case 'remind': // $sql = "SELECT * FROM zlo_users as u WHERE u.id=$user_id"; -- libgit2 0.21.4