function str_has($str, $needle, $ignore_case = false) { if (is_array($needle)) { foreach ($needle as $n) { if (!str_has($str, $n, $ignore_case)) { return false; } } return true; } if ($ignore_case) { $str = str_lower($str); $needle = str_lower($needle); } return strpos($str, $needle) !== false; }
$db->insert('log_report', $data); $tem = template_clean_up_tags($tem, "##IF_SAVE##", 1); //pošiljanje pošte na računovodstvo ob zaključku //pridobi ime prijavljenega uporabnika in spremeni sumnike v brez sumnikov $sql_temp = "SELECT first FROM persons where username='******'"; $user_first = $db->fetchOne($sql_temp); $user_first_sumniki = $user_first; $user_first = str_sumniki($user_first); $user_first_low = str_lower($user_first); /////// //pridobi priimek prijavljenega uporabnika in spremeni sumnike v brez sumnikov $sql_temp = "SELECT last FROM persons where username='******'"; $user_last = $db->fetchOne($sql_temp); $user_last_sumniki = $user_last; $user_last = str_sumniki($user_last); $user_last_low = str_lower($user_last); /////////// //pridobi ime enote in spremeni sumnike v brez sumnikov $sql_temp = "SELECT name FROM unit, persons where unit.persons_unit=persons.unit and persons.username='******'"; $user_unit = $db->fetchOne($sql_temp); $user_unit = str_sumniki($user_unit); /////////// $message_sumnik = 'Mesečno poročilo evidence prisotnosti zaposlenih na: "' . $user_unit . '" je zaključeno http://192.168.50.2/intranet/view_user_month.php'; $message = str_sumniki(message_sumnik); // $to = '*****@*****.**'; $to = '*****@*****.**'; //'*****@*****.**'; //tega pa ne rabim vec-- . ', '; $subject = 'Porocilo ' . $mon . '/' . $year . " " . $user_unit; // message $message = ' <html> <p>Poročilo <b> </html>