<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();?>
<h1>Поиск по сайту</h1>
<form action="" method="get">
<?if($arResult["REQUEST"]["HOW"]=="d"):?>
<input type="hidden" name="how" value="d" />
<?endif;?>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td><input type="text" class="text" style="width: 100%" name="q" value="<?=$arResult["REQUEST"]["QUERY"]?>"/></td><td style="padding-left: 4px;"><input class="submit" type="submit" value="Искать" /></td></tr>
</table>
<?if($arParams["SHOW_WHERE"]):?>
<select name="where">
<option value=""><?=GetMessage("SEARCH_ALL")?></option>
<?foreach($arResult["DROPDOWN"] as $key=>$value):?>
<option value="<?=$key?>"<?if($arResult["REQUEST"]["WHERE"]==$key) echo " selected"?>><?=$value?></option>
<?endforeach?>
</select>
<?endif;?>
</form><br />
<?if($arResult["REQUEST"]["QUERY"] === false && $arResult["REQUEST"]["TAGS"] === false):?>
<?elseif($arResult["ERROR_CODE"]!=0):?>
<p><?=GetMessage("SEARCH_ERROR")?></p>
<?ShowError($arResult["ERROR_TEXT"]);?>
<p><?=GetMessage("SEARCH_CORRECT_AND_CONTINUE")?></p>
<br /><br />
<p><?=GetMessage("SEARCH_SINTAX")?><br /><b><?=GetMessage("SEARCH_LOGIC")?></b></p>
<table border="0" cellpadding="5">
<tr>
<td align="center" valign="top"><?=GetMessage("SEARCH_OPERATOR")?></td><td valign="top"><?=GetMessage("SEARCH_SYNONIM")?></td>
<td><?=GetMessage("SEARCH_DESCRIPTION")?></td>
</tr>
<tr>
<td align="center" valign="top"><?=GetMessage("SEARCH_AND")?></td><td valign="top">and, &, +</td>
<td><?=GetMessage("SEARCH_AND_ALT")?></td>
</tr>
<tr>
<td align="center" valign="top"><?=GetMessage("SEARCH_OR")?></td><td valign="top">or, |</td>
<td><?=GetMessage("SEARCH_OR_ALT")?></td>
</tr>
<tr>
<td align="center" valign="top"><?=GetMessage("SEARCH_NOT")?></td><td valign="top">not, ~</td>
<td><?=GetMessage("SEARCH_NOT_ALT")?></td>
</tr>
<tr>
<td align="center" valign="top">( )</td>
<td valign="top"> </td>
<td><?=GetMessage("SEARCH_BRACKETS_ALT")?></td>
</tr>
</table>
<?elseif(count($arResult["SEARCH"])>0):?>
Искомая фраза: <b><?=$arResult["REQUEST"]["QUERY"]?></b><br/>Найдено <b><?=count($arResult["SEARCH"])?></b> совпадений.<br/>
<p>
<?=$arResult["NAV_STRING"]?>
</p>
<?foreach($arResult["SEARCH"] as $arItem):?>
<p>
<a href="<?echo $arItem["URL"]?>"><?echo $arItem["TITLE_FORMATED"]?></a><br/>
<?echo $arItem["BODY_FORMATED"]?>
<small><?=GetMessage("SEARCH_MODIFIED")?> <?=$arItem["DATE_CHANGE"]?></small><br /><?
if($arItem["CHAIN_PATH"]):?>
<small><?=GetMessage("SEARCH_PATH")?> <?=$arItem["CHAIN_PATH"]?></small><?
endif;
?>
</p>
<?endforeach;?>
<p>
<?=$arResult["NAV_STRING"]?>
</p>
<br />
<p>
<?if($arResult["REQUEST"]["HOW"]=="d"):?>
<a href="<?=$arResult["URL"]?>"><?=GetMessage("SEARCH_SORT_BY_RANK")?></a> | <b><?=GetMessage("SEARCH_SORTED_BY_DATE")?></b>
<?else:?>
<b><?=GetMessage("SEARCH_SORTED_BY_RANK")?></b> | <a href="<?=$arResult["URL"]?>&how=d"><?=GetMessage("SEARCH_SORT_ |