function func_rep_deps_tofiles($month, $year, $traffic_table) { $query = "\n SELECT *\n 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']; //print_r($dep); func_rep_dep_tofile($dep, $month, $year, $traffic_table); ob_flush(); flush(); // Необходимо для работы - ob_flush usleep(50000); //Время задержки вывода инфы - 0.5 секунды. Вывод по 1 строке - конец } }
// Вывод отчета за месяц по Управлению ////////////////////////////////////////// if (isset($_GET['submit_dep'])) { if (isset($dep) and $dep != '' and isset($month) and $month != '' and isset($year) and $year != '') { #echo '<pre>'; echo func_rep_dep($dep, $month, $year, $traffic_table); #echo '<pre>'; } } ////////////////////////////////////////// // Вывод отчета за месяц по Управлению в файл ////////////////////////////////////////// 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>'; } } ////////////////////////////////////////// // Вывод отчета за месяц по Номеру