array('name'=>'Mr. Vassilios Roussis','email'=>'v.roussis@it-concept.at','country'=>'41,43,1257,49,1414,30'), ******************************************************************************/ if (!isset($config)) { require_once('config.php'); require_once('libraries/phpmailer/PHPMailerAutoload.php'); } $time = time(); $arrPartners = array( 0 => array('name' => 'Mr. Libor Čermák', 'email' => 'info@archline.cz', 'country' => '42,421,1403'), 1 => array('name' => 'CADLINE Software srl', 'email' => 'segreteria@cadlinesw.com', 'country' => '39'), 2 => array('name' => 'Wannes Malaise', 'email' => 'ornatadesign@hotmail.com', 'country' => '31,32'), // 3=>array('name'=>'Mr. Moore','email'=>'larry@byggdata.no','country'=>'47,1376'), ); if (date('H:i:s', $time) >= '13:15:00' && date('H:i:s', $time) <= '13:15:05') { foreach ($arrPartners as $partner) { $msg = ""; $msh->query(" SELECT h.nEventID,h.nUserID,u.strName,u.strTel,u.strMobil,e.email AS strEmail,u.nCtrID,c.ctrNameEng,u.strZip,u.strCity,u.strStreet,h.nTopicID,t.strTopic_Eng,h.dateEvent,h.strPlace,h.strInfo,DATE(h.insertDate) AS insertDate,h.nManagerID FROM " . CRMADATBAZIS . ".u_history h LEFT OUTER JOIN " . CRMADATBAZIS . ".users u ON u.nUserID=h.nUserID LEFT OUTER JOIN " . CRMADATBAZIS . ".countries c ON u.nCtrID=c.ctrID LEFT OUTER JOIN " . CRMADATBAZIS . ".u_topic t ON h.nTopicID=t.nTopicID LEFT OUTER JOIN (SELECT email,nUserID FROM " . CRMADATBAZIS . ".u_emails WHERE active=1) e ON u.nUserID=e.nUserID WHERE u.nCtrID IN (" . $partner['country'] . ") AND DATE(h.insertDate)='" . date('Y-m-d', $time - 86400) . "' ORDER BY nEventID ASC LIMIT 999;"); $res = $msh->fetchAssoc(); if (count($res)) { $msg = "
Dear " . $partner['name'] . ",
Please find the details from people who did any action on our website www.archlinexp.com:
(Program download, read letters, etc.)
| Row | Name | Phone | Mobil | Country | Zip | City | Street | Event date | Topic | Info | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| " . ($key + 1) . " | " . $row['strName'] . " | " . $row['strTel'] . " | " . $row['strMobil'] . " | " . $row['strEmail'] . " | " . $row['ctrNameEng'] . " | " . $row['strZip'] . " | " . $row['strCity'] . " | " . $row['strStreet'] . " | " . $row['dateEvent'] . " | " . $row['strTopic_Eng'] . " | " . $row['strInfo'] . " |
Please contact the user directly.
This email is generated automatically by the CRM system.
CADLine Kft.
"; $mail = new PHPMailer; $mail->CharSet = 'UTF-8'; // $mail->isSendmail(); $mail->isSMTP(); $mail->Host = $mailconfig['Host']; $mail->SMTPAuth = true; $mail->Username = $mailconfig['Username']; $mail->Password = $mailconfig['Password']; $mail->SMTPSecure = $mailconfig['SMTPSecure']; $mail->Port = $mailconfig['Port']; $mail->isHTML(TRUE); $mail->setFrom('info@archlinexp.com'); $mail->addAddress($partner['email']); $mail->addBCC('ztoth@cadline.hu'); $mail->addBCC('webdeveloper@cadline.hu'); $mail->Subject = 'User action report'; $mail->msgHTML($msg); $mail->AltBody = strip_tags($msg); $mail->send(); unset($mail); } } unset($msg); }