/** * @return array keys: included, excluded */ public function get_area_description() { $area = new nc_search_area($this->get('area_string'), $this->get('site_id')); return array('included' => $area->get_description(false), 'excluded' => $area->get_description(true)); }
$res = $db->get_results($query, ARRAY_A); $found_rows = $db->get_var("SELECT FOUND_ROWS()"); $db->query("SET NAMES " . nc_core('MYSQL_CHARSET')); // this is actually incorrect: echo "<div class='query_details_header'>", "<b>", sprintf(NETCAT_MODULE_SEARCH_ADMIN_QUERY_ALL_QUERIES, nc_search_util::convert($query_string)), "</b> (", NETCAT_MODULE_SEARCH_ADMIN_QUERY_OPEN_RESULTS_HINT, "):", "</div>"; // таблица с результатами echo "<table class='nc-table nc--large nc--hovered nc--striped list'>\n", "<tr>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_TIME, "</th>", "<th class='nc-text-center' width='40%'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_AREA, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_RESULTS_COUNT, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_USER, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_IP, "</th>", "</tr>\n"; foreach ($res as $row) { $has_area = strlen($row['Area']) > 0; $site_area = new nc_search_area("site{$row['Catalogue_ID']}"); list($site_description) = $site_area->get_description(false); if (!$has_area) { $area_cell = "<td>" . NETCAT_MODULE_SEARCH_ADMIN_RULE_AREA_DESCRIPTION_ALLSITES . "</td>"; } else { $area = new nc_search_area($row['Area'], $row['Catalogue_ID']); $description = array("included" => $area->get_description(false), "excluded" => $area->get_description(true)); $hint = "<div class='header'><strong>{$site_description}</strong></div>"; if ($description["included"]) { $hint .= "<div class='header'><strong>" . NETCAT_MODULE_SEARCH_ADMIN_QUERY_AREA_INCLUDED . "</strong>:</div><div class='list'>"; foreach ($description["included"] as $item) { $hint .= "<div class='item'>" . NETCAT_MODULE_SEARCH_ADMIN_BULLET . " {$item}</div>\n"; } $hint .= "</div>"; } if ($description["excluded"]) { $hint .= "<div class='header'><strong>" . NETCAT_MODULE_SEARCH_ADMIN_QUERY_AREA_EXCLUDED . "</strong>:</div><div class='list'>"; foreach ($description["excluded"] as $item) { $hint .= "<div class='item'>" . NETCAT_MODULE_SEARCH_ADMIN_BULLET . " {$item}</div>\n"; } $hint .= "</div>"; }