'а', ',' => 'б', 'd' => 'в', 'u' => 'г', 'l' => 'д', 't' => 'е', '`' => 'ё', ';' => 'ж', 'p' => 'з', 'b' => 'и', 'q' => 'й', 'r' => 'к', 'k' => 'л', 'v' => 'м', 'y' => 'н', 'j' => 'о', 'g' => 'п', 'h' => 'р', 'c' => 'с', 'n' => 'т', 'e' => 'у', 'a' => 'ф', '[' => 'х', 'w' => 'ц', 'x' => 'ч', 'i' => 'ш', 'o' => 'щ', 'm' => 'ь', 's' => 'ы', ']' => 'ъ', "'" => "э", '.' => 'ю', 'z' => 'я', 'F' => 'А', '<' => 'Б', 'D' => 'В', 'U' => 'Г', 'L' => 'Д', 'T' => 'Е', '~' => 'Ё', ':' => 'Ж', 'P' => 'З', 'B' => 'И', 'Q' => 'Й', 'R' => 'К', 'K' => 'Л', 'V' => 'М', 'Y' => 'Н', 'J' => 'О', 'G' => 'П', 'H' => 'Р', 'C' => 'С', 'N' => 'Т', 'E' => 'У', 'A' => 'Ф', '{' => 'Х', 'W' => 'Ц', 'X' => 'Ч', 'I' => 'Ш', 'O' => 'Щ', 'M' => 'Ь', 'S' => 'Ы', '}' => 'Ъ', '"' => 'Э', '>' => 'Ю', 'Z' => 'Я', '@' => '"', '#' => '№', '$' => ';', '^' => ':', '&' => '?', '/' => '.', '?' => ',', ); $value = strtr($value, $converter); return $value; } if( $search_query ){ $search_query = str_replace( array( "'", '%27', '&', '%5C', '%29', 'and' ), '', $search_query ); $search_query = nc_search_util::convert( $search_query, 1 ); $search_query = switcher_ru( $search_query ); } if( $search_query ){ $content = ''; $subs = "SELECT * FROM `Subdivision` WHERE `Checked` = 1 AND `Subdivision_Name` LIKE '%" . $search_query . "%'"; $subs .= " AND `Hidden_URL` NOT LIKE '/catalog/bio/%' AND ( `LabelColor` = '' OR `LabelColor` IS NULL ) AND `Subdivision_ID` NOT IN ( 1829, 1834 ) LIMIT 3"; $subs = ( array ) $nc_core->db->get_results( $subs, ARRAY_A ); foreach( $subs as $sid ){ $content .= '
  • ' . $sid['Subdivision_Name'] . '
  • '; } $limit = 10; $items = "SELECT * FROM `Message284` AS p WHERE p.`Checked` = 1 AND p.`Name` LIKE '%" . $search_query . "%'"; $items .= " AND p.`Subdivision_ID` NOT IN ( 1829, 1834 ) AND p.`Price` > 0 AND p.`Price` IS NOT NULL AND p.`NotShow` != 1"; $items .= " AND ( ( p.`stock` = 'krd' AND p.`StockUnits` > 0 ) OR p.`StockUnitsMsk` > 0 )"; $items .= " AND ( SELECT s.`Subdivision_ID` FROM `Subdivision` AS s WHERE p.`Subdivision_ID` = s.`Subdivision_ID`"; $items .= " AND s.`Hidden_URL` NOT LIKE '/catalog/bio/%' ) = p.`Subdivision_ID`"; $items .= " ORDER BY p.`Price` ASC LIMIT " . $limit; $items = ( array ) $nc_core->db->get_results( $items, ARRAY_A ); foreach( $items as $item ){ $path = nc_object_path(284, $item['Message_ID'], 'full'); $content .= '
  • ' . $item['Name'] . '
  • '; } $count_items = count( $items ); if( $count_items < $limit ){ $not_show = ""; if( $count_items > 0 ){ $not_show = []; foreach( $items as $item ){ $not_show[] = $item['Message_ID']; } $not_show = " AND `Message_ID` NOT IN ( " . implode( ',', $not_show ) . " )"; } $items_more_limit = $limit - $count_items; $items_more = "SELECT * FROM `Message284` WHERE `Checked` = 1 AND `Name` LIKE '%" . $search_query . "%'"; $items_more .= " AND `Subdivision_ID` NOT IN ( 1829, 1834 ) AND `Price` > 0 AND `Price` IS NOT NULL AND `NotShow` != 1"; $items_more .= $not_show . " ORDER BY `Price` ASC LIMIT " . $items_more_limit; $items_more = ( array ) $nc_core->db->get_results( $items_more, ARRAY_A ); foreach( $items_more as $item ){ $path = nc_object_path(284, $item['Message_ID'], 'full'); $content .= '
  • ' . $item['Name'] . '
  • '; } } } echo $content; ?>