function func_rep_deps_tomails($month, $year, $traffic_table) { $query = "\n SELECT * FROM `department` \n WHERE limit_all != '0,00' AND contract\n ORDER BY `contract` ASC LIMIT 1000"; $result = mysql_query($query); if (ob_get_level() == 0) { ob_start(); } while ($array = mysql_fetch_array($result)) { $dep = $array['contract']; $mail = $array['mail']; //print_r($mail); func_rep_dep_tomail($dep, $month, $year, $traffic_table, $mail); ob_flush(); flush(); // Необходимо для работы - ob_flush usleep(50000); //Время задержки вывода инфы - 0.5 секунды. Вывод по 1 строке - конец } }
// Вывод отчета за месяц по Управлению в файл ////////////////////////////////////////// if (isset($_GET['submit_dep_tofile'])) { if (isset($dep) and $dep != '' and isset($month) and $month != '' and isset($year) and $year != '') { #echo '<pre>'; echo func_rep_dep_tofile($dep, $month, $year, $traffic_table); #echo '<pre>'; } } ////////////////////////////////////////// // Отправляет отчет за месяц по Управлению согласно листа рассылки из БД ////////////////////////////////////////// if (isset($_GET['submit_dep_tomail'])) { if (isset($dep) and $dep != '' and isset($month) and $month != '' and isset($year) and $year != '') { #echo '<pre>'; echo func_rep_dep_tomail($dep, $month, $year, $traffic_table); #echo '<pre>'; } } ////////////////////////////////////////// // Вывод отчета за месяц по Номеру ////////////////////////////////////////// if (isset($_GET['submit_number'])) { if (isset($number) and $number != '' and isset($month) and $month != '' and isset($year) and $year != '') { #echo '<pre>'; echo func_rep_number($number, $month, $year, $traffic_table); #echo '<pre>'; } } ////////////////////////////////////////// // Вывод отчета за месяц по Номеру в файл