function sentMailToUser($to, $body_mes, $topic = 0){ if(sentMail == "no") return true; $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 0; // enables SMTP debug information (for testing); 1 = errors and messages; 2 = messages only $mail->Timeout = 90; $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "mail.steam.edu.az"; // sets the SMTP server $mail->SMTPSecure = true; $mail->Port = 465; $mail->Username = "saf@steam.edu.az"; // SMTP account username $mail->Password = "safsteamazerbaijanfestival2021"; // SMTP account password $mail->setFrom('saf@steam.edu.az', 'steam.edu.az'); foreach ($to as $key => $value) { $mail->addAddress($value, $key); } $mail->addCC('hafiz.tofidi@steam.edu.az', 'Hafiz Tofifi'); $mail->addCC('saf@steam.edu.az', 'steam.edu.az'); #$mail->addReplyTo('order@osciencelab.com', 'osciencelab.com'); #$mail->addCC('order@osciencelab.com', 'osciencelab.com'); #$mail->addAddress($to, 'osciencelab.com'); $file_tmp = $_FILES['a3']['tmp_name']; $file_name = $_FILES['a3']['name']; App::getLogger()->write("tmp: ". $file_tmp); App::getLogger()->write("name: ". $file_name); $mail->AddAttachment($file_tmp, $file_name); $mail->CharSet = 'utf-8'; $mail->Subject = $topic. ": saf.steam.edu.az"; $mail->msgHTML($body_mes); if ($mail->send()) { App::getLogger()->write("mail Succes send "); return true; } else { App::getLogger()->write("mail Error: ".$mail->ErrorInfo); //echo "Mailer Error: ".$mail->ErrorInfo; //logError("Mailer Error: ".$mail->ErrorInfo); return false; } } function cryptALX($password, $salt) { $hash = sha1(md5(sha1(md5($password.$salt)))); for ($i=1; $i<=1000; $i++) { $hash = sha1($hash.$salt); } return $hash; } function buildSelect($rows, $id = 0, $probelCount = 0, $index = 0) { if($index == 0) $prefix = ""; else $prefix = $index."."; $probel = ''; for($i = 1; $i<= $probelCount; $i++) $probel .= " "; foreach($rows as $page) { if($id == $page['id']) $selected = " SELECTED "; else $selected = ''; ?> if($page['children']){ buildSelect($page['children'], $id, $probelCount+5, $prefix.$page['i']); } } } function buildTable($rows, $lang, $padding = 15, $index = 0) { if($index == 0) $prefix = ""; else $prefix = $index."."; foreach($rows as $row) { ?>
"; if($msg) echo $msg; print_r($var); echo ""; } else { echo "
"; var_dump($var); echo ""; } } function redirect($url) { ?> exit; } function alert($msg) { ?> } function content($id_page, $type, $lang2 = 0) { global $db,$lang; if($lang2) $lang = $lang2; $Sql = $db->query("Select $type From ".TABLE_PAGES." Where id='$id_page' AND lang_id='$lang'"); $Row = $db->fetchArray($Sql); //$data = iconv("windows-1251", "utf-8", $Row[$type]); $data = $Row[$type]; // echo $type, $Row[$type]; return $data; } function row_print($table, $row, $where, $clean = 0, $replaceImgPath = 0) { $db = App::getDb(); $Sql = $db->query("Select ".$row." From ".$table." Where ".$where." "); $Row = $db->fetchArray($Sql); $return = $Row[$row]; if(isset($clean)) $return = htmlspecialchars_decode($return); //if(isset($replaceImgPath)) $return = str_replace("../files/source/", "/files/source/", $return); if(isset($replaceImgPath)) $return = str_replace("../web", "", $return); return $return; } function cleanImg($img) { return str_replace("../web", "", $img); } function translate($id) { return App::getTranslate()->translate($id); } function isUnicEmail($email) { $db = App::getDb(); $check = $db->fetch(" select * from " . TABLE::get("teams") . " where email = '" . $email . "' "); if ($check) return false; //takoy polzovatel uje est else return true; //takogo polzovatela net } ?>