query($sql); $kulcsokobjarray = crm_database::getInstance()->fetchAssoc(); $kulcsok = array(); foreach ($kulcsokobjarray as $obj) { $object = (object)$obj; $ctrName = "ures"; crm_database::getInstance()->query("SELECT hlCtrID, hlUser FROM " . CRMADATBAZIS . ".hardlock WHERE hlNum='" . substr($object->pwd, 0, 6) . "'"); $hardlock = crm_database::getInstance()->fetchNext(); $h = (object)$hardlock; if ($h->hlCtrID) { crm_database::getInstance()->query("SELECT ctrName FROM " . CRMADATBAZIS . ".countries WHERE ctrID=" . $h->hlCtrID); $orszag = crm_database::getInstance()->fetchNext(); $o = (object)$orszag; $ctrName = $o->ctrName; } if (is_numeric($h->hlUser)) { crm_database::getInstance()->query("SELECT strName FROM " . CRMADATBAZIS . ".users WHERE nUserID=" . $h->hlUser); $user = crm_database::getInstance()->fetchNext(); $u = (object)$user; $user = $u->strName; } else $user = $h->hlUser; $hibahun = $hibaeng = ""; if (strstr($object->error, "error: nincs ilyen password")) { $hibahun = "nincs ilyen Sorozatszám"; $hibaeng = "no Serial code in CRM database"; $support = "Check user figures and send order to CadLine"; } elseif (strstr($object->error, "error: nem aktiv a program")) { $hibahun = "nem aktiv a program"; $hibaeng = "this Serial code is not active"; $support = "Check why? (Maybe prohibited, but old hardlock was not sent back to office.)"; } elseif (strstr($object->error, "error: nincs vasarlasi idopont")) { $hibahun = "nincs vasarlasi idopont a CRM-ben"; $hibaeng = "no selling date setup in database"; $support = "Check the User payments and ask new activation code from CadLine"; } elseif (strstr($object->error, "error: hianyzo kod")) { $hibahun = "hianyzo Aktiválási kod"; $hibaeng = "no Activation code in CRM"; $support = "Check the User payments and ask new activation code from CadLine"; } elseif (strstr($object->error, "error: masik gep van regisztralva")) { $hibahun = "masik gep van regisztralva - Feloldás kell"; $hibaeng = "this is already registered on another PC"; $support = "Check it, maybe user tried to download more times. If its OK, ask to release from CadLine (after that user can register again and can use for more 60 days!) Its your decision."; } elseif (strstr($object->error, "error: nincs kifizetve")) { $hibahun = "nincs kifizetve, aktiválási kód lejárt"; $hibaeng = "the program is not paid in CRM system"; $support = "Check the payment and ask new activation from CadLine"; } elseif (strstr($object->error, "error: tul sok telepites")) { $hibahun = "túl sok telepités - Feloldás kell"; $hibaeng = "the program already registered "; $support = "Check, discuss with user why tried it twice, and If its OK, ask to release from CadLine (after that user can register again and can use for more 60 days!) Its your decision."; } preg_match('/\d{16}/', $object->error, $serialmatch); crm_database::getInstance()->query("SELECT * FROM " . CRMADATBAZIS . ".`h_programs` WHERE `prPass` = '" . $object->pwd . "' ORDER BY `prID` DESC LIMIT 1"); $arrDealer = crm_database::getInstance()->fetchAssoc(); $ujhibaskulcs = array(); $ujhibaskulcs['kulcs'] = $object->pwd; $ujhibaskulcs['serial'] = $serialmatch[0]; $ujhibaskulcs['ctrName'] = $ctrName; $ujhibaskulcs['user'] = $user; $ujhibaskulcs['hibahun'] = $hibahun; $ujhibaskulcs['hibaeng'] = $hibaeng; $ujhibaskulcs['support'] = $support; $ujhibaskulcs['dealer'] = $arrDealer[0]['prDealer']; $kulcsok[] = $ujhibaskulcs; } $htmlkulcsok = "\n"; $htmlkulcsok .= "\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; //$htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\n"; foreach ($kulcsok as $kulcs) { $htmlkulcsok .= "\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; //$htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\t\n"; $htmlkulcsok .= "\n"; } $htmlkulcsok .= "
Hardlock NoSerial NoCountryDealerUser nameerror messagehibaüzenetHow should you support ?
{$kulcs['kulcs']}{$kulcs['serial']}{$kulcs['ctrName']}{$kulcs['dealer']}{$kulcs['user']}{$kulcs['hibaeng']}{$kulcs['hibahun']}{$kulcs['support']}
"; // $kulcslista = implode(", ",$kulcsok); $message = "Ez egy automatikusan generált CRM rendszer üzenet. Azokról a kulcsokról, melyeknél tegnap ({$tegnap}) olyan programindítás történt, amire hiba volt a válasz:

Dear Administrator,

According to our system report please find the errors from yesterday below." . $htmlkulcsok .= "

Best Regards,

Anikó Huszár"; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPAuth = true; $mail->CharSet = 'UTF-8'; $mail->Host = $mailconfig['Host']; $mail->Username = $mailconfig['Username']; $mail->Password = $mailconfig['Password']; $mail->SMTPSecure = $mailconfig['SMTPSecure']; $mail->Port = $mailconfig['Port']; $mail->isHTML(TRUE); $mail->setFrom(DEFAULT_EMAIL); // $mail->addAddress('webdeveloper@cadline.hu'); // $mail->addAddress('aniko.huszar@cadline.hu'); $mail->addAddress('office@cadline.hu'); $mail->Subject = 'Hibas programinditasok'; $mail->msgHTML($message); $mail->AltBody = strip_tags($message); $mail->send(); unset($mail); /* // 2017.06.07. F.Zs.: levélküldő objektum lecserélve, mert nem működött $conf = new JConfig(); $email = new CI_Email(); $email->initialize(); $email->setFrom('info@cadline.hu', 'CadLine'); $email->subject('Hibas programinditasok'); $email->message($message); $email->send('aniko.huszar@cadline.hu', 'smtp'); */