Exemple #1
0
require_once('Zend/Validate/StringLength.php');

require_once($cfg['path'] . '/helpers/constants.php');

$tpl['user']['errors'] = array();
$tpl['user']['send_status'] = false;
$tpl['user']['email'] =request('email');

$tpl['user']['subscr'] = isset($_REQUEST['subscr'])?1:0; 
$tpl['user']['subscr_shop'] = isset($_REQUEST['subscr_shop'])?1:0; 
$tpl['user']['user_exist'] = request('user_exist'); 
$tpl['user']['password'] = request('password'); 
$datatype = request('datatype'); 
IF($datatype=='json'){
    $validator = new Zend_Validate_EmailAddress(); 
    $mail_class = new mails();
    
    if (!$tpl['user']['user_exist']){    
        //генерирум рандомный пароль для регистрации
        $password = generateString(8); 
        
        if (!$validator->isValid($tpl['user']['email'])) {
            $tpl['user']['errors'] = "Неверный Email";
        }  else if($userData = $user_class->getRowByParams(array('email'=>$tpl['user']['email']))){
            $tpl['user']['errors'][] = "Пользователь с таким Email уже существует в системе";
        } else {
             $data = array('email'=>$tpl['user']['email'],
                           'userpassword' => $password,
                           'userlogin'=>$tpl['user']['email']);                                                
             //регистрируем
             $userId = $user_class->addNewUser($data);
Exemple #2
0
		if (!$user_to) $tpl['collector']['errors'][] = "Не указан пользователь";
		if (!$topic) $tpl['collector']['errors'][] = "Не заполнена тема";
		if (!$details) $tpl['collector']['errors'][] = "Не заполнен текст";
		
		if(!$tpl['collector']['errors']){
			$data = array('user_from'=>$user_from, 
						  'user_to'=>$user_to,
						  'topic'=>$topic,
						  'details'=>$details, 
						  'date'=>time());
			$collectors_class->addMessage($data);	
			$message = "<p>Уважаемый пользователь Клуба Нумизмат.
			<br><b>Пользователь: </b>".$tpl['user']['fio']."
			<br>отправил Вам сообщение
			<br><br><b>Текст сообщения:</b>
			<br>".str_replace(chr(13), "<br>", $details)."
			<br><br>Это сообщение сохранено в Вашем профайле на сервере.
			<br><br>Клуб Нумизмат - <a href=http://www.numizmatik.ru>www.numizmatik.ru</a>";
					
			$mail_class = new mails();
			
			$mail_class->commonMail($tpl['collector']['user_to']['email'],"Клуб Нумизмат",$message);	
					
			$tpl['collector']['send_status'] = "<br><b>Ваше сообщение успешно отправлено</b><br>";
		}	
	}	
}



?>
Exemple #3
0
		$content .= "</table>";	
	}
	
	//подставляем содержимое заказа
	
	$message_user = str_replace("___content___", $content, $message_user);
	$message_user = str_replace("___sum___", $sum, $message_user);
	$message_user = str_replace("___SendPostBanderoleNumber___", $SendPostBanderoleNumber, $message_user);
	
	$recipient = $rows["email"];
	//$recipient = '*****@*****.**';
	$subject = "Клуб Нумизмат | Заказ № ".$rows["order"];
	
	$mail_class = new mails();	
	$mail_class->subscriptionLetter($recipient,$subject,$message_user);
	$mail_class = new mails();
	$mail_class->subscriptionLetter("*****@*****.**",$subject,$message_user);
	

	/*mail($recipient, $subject, $message_user, $headers);
	$recipient = $email_admin;
	mail($recipient, $subject, $message_user, $headers);
	//echo $message_user;	
	//делаем update
	$sql_update = "update `order` set Reminder=2 where `order`='".$rows["order"]."';";*/
	
	$shopcoins_class->updateTableRow('order',array('Reminder'=>2) ,'`order`='.$rows["order"]);	
	//$result_update = mysql_query($sql_update);
	
	if ($rows['user'] && $rows['user'] != 811) {	
		$cron_class->writeMessagePost($rows['user'], $message_user);
Exemple #4
0
<?
require_once($cfg['path'] . '/models/user.php');
require_once($cfg['path'] . '/models/mails.php');
require_once('Zend/Validate/EmailAddress.php');
require_once('Zend/Validate/StringLength.php');

require_once($cfg['path'] . '/helpers/constants.php');

$tpl['user']['errors'] = array();
$tpl['user']['send_status'] = false;

$validator = new Zend_Validate_EmailAddress(); 

$mail_class = new mails();
switch ($tpl['task']){    
    case 'registration':{
    	
        $tpl['user']['password'] = request('password');
        $tpl['user']['email'] =request('email');
        $tpl['user']['codeforfrend'] =request('codeforfrend');
        $tpl['user']['password_repeat'] = request('password_repeat');
        
        $inttostring = rand(1,99);
        
        $tpl['user']['inttostring'] = Constants::inttostring($inttostring);      
           
        $tpl['user']['inttostringm'] = md5("Numizmatik".$inttostring);      
        //проверяем что пароль не меньше пяти символов
        $pwdValdator =  new Zend_Validate_StringLength(array('min' => 5));
        $user_inttostring = request('inttostring');
        $user_inttostringm = request('inttostringm');
Exemple #5
0
     /*$sql_update = "update shopcoins 
     		set  amount=amount-".$amount."
     		".($amount>=$oldamount?", `check`=0":"")."
     		, reserveorder='".$shopcoinsorder.", dateorder=".time()."'
     		where shopcoins='".$shopcoins."';";*/
 } elseif ($ShopcoinsMaterialtype == 3 || $ShopcoinsMaterialtype == 3) {
     $data_update = array('amount' => $oldamount - $amount, 'dateorder' => time());
     if ($amount >= $oldamount) {
         $data_update['check'] = 0;
     }
 } else {
     $data_update = array('reserveorder' => $shopcoinsorder, 'dateorder' => time(), 'check' => 0);
 }
 $shopcoins_class->updateRow($data_update, "shopcoins='{$shopcoins}'");
 $item = $shopcoins_class->getItem($shopcoins, true);
 $mail_class = new mails();
 $mail_text = '<table border="0" cellpadding="0" cellspacing="0" width="650">';
 $mail_text .= '<tr><td colspan="2" style="font-size:14px;font-weight:bold;"><br>';
 $mail_text .= 'Благодарим Вас за то, что воспользовались услугами нашего магазина.<br>';
 $mail_text .= 'Вами сделан заказ ' . $shopcoinsorder . ' на сумму ' . $price . ' руб. В ближайшее рабочее время с Вами свяжется наш сотрудник.<br>';
 $mail_text .= '<br>ФИО: ' . $onefio . '<br>';
 $mail_text .= 'Телефон: ' . $onephone . '<br>';
 $mail_text .= '<br><br>Вы можете связаться с менеджером по адресу <a href=mailto:administrator@numizmatik.ru>administrator@numizmatik.ru</a> в рабочие дни или по телефону 8-800-333-14-77 (бесплатный звонок по России) (<b><font color=red>+3 GMT MSK</font></b>).';
 $mail_text .= '</td></tr></table>';
 $mail_text .= '<table border="0" cellpadding="0" cellspacing="0" width="650" style="border:1px solid #cccccc;border-collapse:collapse;margin-top:20px;">';
 $mail_text .= '<tr><td  style="border:1px solid #cccccc;padding:10px;"></td><td  style="border:1px solid #cccccc;padding:10px;">Наименование</td><td style="border:1px solid #cccccc;padding:10px;">Группа (страна)</td><td style="border:1px solid #cccccc;padding:10px;">Год</td><td style="border:1px solid #cccccc;padding:10px;">Номер</td><td  style="border:1px solid #cccccc;padding:10px;">Цена</td></tr>';
 $mail_text .= '<tr>';
 $mail_text .= '<td  style="border:1px solid #cccccc;padding:10px;"><img style="max-width:100px;border:1px solid #cccccc;" src="http://www.numizmatik.ru/shopcoins/images/' . $item["image_small"] . '"/></td>';
 $mail_text .= '<td  style="border:1px solid #cccccc;padding:10px;"><a href=' . $cfg['site_dir'] . 'shopcoins/show.php?catalog=' . $item["catalog"] . ' target=_blank>' . $item["name"] . '</a></td>';
 $mail_text .= '<td  style="border:1px solid #cccccc;padding:10px;">' . $item["gname"] . '</td>';
 $mail_text .= '<td  style="border:1px solid #cccccc;padding:10px;">' . $item["year"] . '</td>';
							'password'=>'',
							'email'=>strip_tags($email), 
							'name'=>strip_tags($name), 
							'url'=>strip_tags($url), 
							'description'=>strip_tags($text),
							'enterdate' => $timenow,
							'keywords' => strip_tags($ratingkeywords));
			
			$my_id =  $ratinguser_class->addUrl($data);			
				
			$sql = "Select Name from `group` where `group`=$group;";
					
			$ratinggroup = $shopcoins_class->getOneSql($sql);
			
			$data_mail = array();
			$data_mail['my_id'] = $my_id;
			$data_mail['email'] = $email;
			$data_mail['name'] = $name;
			$data_mail['url'] = $url;
			$data_mail['ratinggroup'] = $ratinggroup;
			$data_mail['text'] = $text;
			
			$mail_class->ratingMail($data_mail);
			$mail_class = new mails();
			//отсылаем письмо тех-поддержке			
			$mail_class->ratingMailSupport($data_mail);
		}		
	}
}
?>
Exemple #7
0
                    		 'sum'=>$sum, 
                			 'check'=>1,
                			 'FinalSum' => $FinalSum, 
                			 'NeedCall' => 2, 
                			 'suminsurance'=>'0');

			$order_class->updateRow($data_order,"`order`='".$shopcoinsorder."'");
						
			$tpl['submitorder']['sum'] = $sum;
			$tpl['submitorder']['FinalSum'] = $FinalSum;
			
			$mail_class = new mails();		
			include $cfg['path']."/views/mails/ordermail.tpl.php";
								
			$mail_class->orderLetter($user_data,$mail_text);   
			$mail_class = new mails();
			$mail_class->orderLetter(array('email'=>'*****@*****.**','userlogin'=>'*****@*****.**'),$mail_text);
			//удаляем cookies пользователя------------------------------------------------------------------------------------------
			//удаляем cookies пользователя------------------------------------------------------------------------------------------			
            setcookie("shopcoinsorder", 0, time() + 2, "/shopcoins/", $domain);
            setcookie("shopcoinsorder", 0, time() + 2, "/shopcoins/");
            setcookie("shopcoinsorder", 0, time() + 2, "/shopcoins/", ".shopcoins.numizmatik.ru");
            setcookie("shopcoinsorder", 0, time() + 2, "/");
            
            setcookie("order", 0, time() + 2, "/shopcoins/", $domain);
            setcookie("order", 0, time() + 2, "/shopcoins/");
            setcookie("order", 0, time() + 2, "/shopcoins/", ".shopcoins.numizmatik.ru");
            setcookie("order", 0, time() + 2, "/");            
            
            unset($_SESSION['shopcoinsorder']);
            unset($_SESSION['order']);                   
Exemple #8
0
<?
header('Pragma: no-cache');

require_once($cfg['path'] . '/models/mails.php');
require_once('Zend/Validate/EmailAddress.php');

$validator = new Zend_Validate_EmailAddress();
$mail_class = new mails(true);

$data_result = array();
$data_result['error'] = null;
$data_result['value'] = false;

$fio = request('fio');
$email = request('email');
$emailfriend =  request('emailfriend');
$messageform =  request('messageform');
$link =  request('link');

if (!$validator->isValid($email)) {
    $data_result['error'] = "Неверный Email отправителя";
} else if (!$validator->isValid($emailfriend)) {
    $data_result['error'] = "Неверный Email друга";
} else if ($fio&&$email&&$emailfriend&&$messageform&&$link){
    $data['mailfrom'] = $email;
    $data['fiofrom'] = $fio;
    $data['mailfriend'] = $emailfriend;
    $data['message'] = $messageform;
    $data['link'] = $link;
    //echo $recipient;
    $mail_class->CatalogCoinsLetter($data);
Exemple #9
0
<?php

require_once "new/config.php";
require_once "new/models/mails.php";
$mail_class = new mails();
if (isset($_GET['gate_pass']) and $_GET['gate_pass'] == '1020304050' and isset($_POST['data'])) {
    // $handle =  mysql_connect('localhost', 'tester', '1020304050'  ) or die( 'Could not open connection to server' );
    // mysql_select_db( 'tet', $handle ) or die( 'Could not select database '. $handle );
    // mysql_query("SET NAMES 'cp1251'");
    // mysql_query("SET CHARACTER SET 'cp1251'");
    $data = unserialize(urldecode($_POST['data']));
    if (!isset($data['status'])) {
        die('Error!');
    }
    $insert_array = array();
    foreach ($data['data'] as $row) {
        $insert_array["email"] = $row["email"];
        $insert_array["subject"] = $row["subject"];
        $insert_array["message"] = $row["message"];
        $insert_array["headers"] = $row["headers"];
        $insert_array["is_new_send_method"] = $row["is_new_send_method"];
        $insert_array["is_send"] = 1;
        if ($insert_array["is_new_send_method"]) {
            $mail_class->subscriptionLetter($row["email"], iconv("cp1251", "utf-8", $row["subject"]), iconv("cp1251", "utf-8", $row["message"]));
        } else {
            mail($row["email"], $row["subject"], $row["message"], $row["headers"]);
        }
    }
} else {
    die('Security error!');
}