function HandleDefault() { require_once "Http_Cache.php"; Http_Cache::setExpires(4 * 60 * 60); require_once "FileUtils.php"; require_once "TreeUtils.php"; require_once "RubricsData.php"; require_once "Cache/Lite/Function.php"; print " "; $options = array("cacheDir" => "../tmpcache/", "lifeTime" => 4 * 60 * 60); $cache = new Cache_Lite_Function($options); $rubrics = new RubricsData(); $res = $cache->call(array(&$rubrics, "getRootRubrics")); // $res = $rubrics->getRootRubrics(); $treeBuilder = new TreeBuilder(true, true, "TreeSrcData"); ob_start(); $treeBuilder->show($res); $_GLOBAL["Tree"] = ob_get_contents(); ob_end_clean(); $_GLOBAL["RegionsList"] = ""; $res = $rubrics->getRegions(); $_GLOBAL["RegionsList"] .= "<option value=\"0\" selected>Все</option>\n"; foreach ($res as $r) { $_GLOBAL["RegionsList"] .= "<option value=\"" . $r["id"] . "\">" . trim($r["region"]) . "</option>\n"; } $_GLOBAL["UsualStr"] = getUsual("Обычная очередь"); $_GLOBAL["TestStr"] = getTest("Тестовая очередь"); $_GLOBAL["SpecStr"] = getSpec("Специальная очередь"); include "templates/index.html"; }
function HandleDownloadStat() { require_once "Http_Cache.php"; Http_Cache::setExpires(4 * 60 * 60); require_once "Cache/Lite.php"; print " "; $options = array("cacheDir" => "../tmpcache/", "lifeTime" => 4 * 60 * 60); $cacheLite = new Cache_Lite($options); if ($data = $cacheLite->get("downloadStat")) { print $data; } else { require_once "TreeUtils.php"; require_once "RubricsData.php"; $rubrics = new RubricsData(); ob_start(); list($days1, $days2) = $rubrics->getDayNums(true); print ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <html><head><title>Статистика скачиваний</title> <meta http-equiv="content-type" content="text/html; charset=windows-1251"> <meta name="description" content=""> <meta name="keywords" content=""> <link type="text/css" rel="stylesheet" href="styles/style.css"> </head> <body><div id="container" class="stats"><div id="page"> <div id="content"> <div id="header"> <a href="./categs.html">Категории</a> | <a href="./tasks.html">Журнал обновлений</a> | <a href="./stat.html"><b>Статистика скачиваний</b></a></div> <div id="main_content"> <h1>Статистика скачиваний</h1> <strong style="font-size: 11px;">Обновление статистики производится ежедневно после 06.00, 12.00, 16.00, 20.00, 00.00 часов.</strong> <br><br><br> <p>Количество скаченных компаний, вчера - ' . $days1 . '</p> <p>Количество скаченных компаний, сегодня - ' . $days2 . '</p> <br><br> <table> <thead> <thead> <tr><th>Номер</th><th>Название</th><th>Количество<br>скачанных</th><th>Количество в источнике</th><td>Осталось,<br>%</td><td>Email</td><td>Email,<br>%</td><td>Разница</td><td>Последнее обновление</td></tr> </thead> <tbody> '; processRubrics($rubrics); print ' </tbody> </table> </div> </div></div></div><div id="footer"></div> </body></html> '; $data = ob_get_contents(); ob_end_clean(); $cacheLite->save($data); } }
function HandleExpandNode() { require_once "Http_Cache.php"; Http_Cache::setExpires(4 * 60 * 60); if (!isset($_REQUEST["nodeId"])) { return; } header("Content-type: text/html; charset=windows-1251"); print " "; require_once "TreeUtils.php"; require_once "RubricsData.php"; require_once "Cache/Lite/Function.php"; $options = array("cacheDir" => "../tmpcache/", "lifeTime" => 4 * 60 * 60); $cache = new Cache_Lite_Function($options); $rubrics = new RubricsData(); // $res = $cache->call(array(&$rubrics, "getChildrenRubrics"), // (int)$_REQUEST["nodeId"]); $res = $rubrics->getChildrenRubrics((int) $_REQUEST["nodeId"]); $treeBuilder = new TreeBuilder(false, false); $treeBuilder->show($res); }