{**
* XS2:
*
* This file is developed by Solutecs, LLC for the purpose of the company
* and is provided together with XS2 Framework as and inherent part of the
* system. This file can be used on the terms of License Agreement.
*
* +7 (495) 585-0833 / 13 Rusakovskaya street, Moscow 107140 Russia
*
* @link http://www.solutecs.com
* @copyright ©1998-2007 Solutecs, LLC
* @version 1.XX
*}
{* Форма поиска *}
{* Опция $findAgeBegin: минимальный возраст в анкете *}
{assign var="findAgeBegin" value=16}
{* Опция $findAgeEnd: максимальный возраст в анкете *}
{assign var="findAgeEnd" value=91}
<form action="{xs2Href mod=$_THE.QUE.MOD obj=$_THE.QUE.OBJ met=$_THE.QUE.MET}"
method="POST" name="findForm">
<input type="hidden" name="action" value="findForm"/>
М <input name="subjSexMale" type="checkbox" {if $_THE.PARAMS[1]}checked{/if}/>
Ж <input name="subjSexFemale" type="checkbox" {if $_THE.PARAMS[2]}checked{/if}/>
От
<select name="subjAgeBegin">
{section start=$findAgeBegin loop=$findAgeEnd+1 name="ageLoop"}
<option value="{$smarty.section.ageLoop.index}"
{if $_THE.PARAMS[3] eq $smarty.section.ageLoop.index} selected{/if}>
{$smarty.section.ageLoop.index}
</option>
{/section}
</select>
До
<select name="subjAgeEnd">
{section start=$findAgeBegin loop=$findAgeEnd+1 name="ageLoop"}
<option value="{$smarty.section.ageLoop.index}"
{if $_THE.PARAMS[4] eq $smarty.section.ageLoop.index} selected{/if}>
{$smarty.section.ageLoop.index}
</option>
{/section}
</select>
Знак зодиака
<select name="subjZodiac">
{foreach from=$zodiac item="sign" name="zodiacLoop"}
<option value="{$smarty.foreach.zodiacLoop.index}"
{if $_THE.PARAMS[5] eq $smarty.foreach.zodiacLoop.index} selected{/if}>
{$sign}
</option>
{/foreach}
</select>
<input type="submit" value="Найти"/>
</form>
{* /Форма поиска *}
{* Список найденных анкет *}
{* Опция $formColumns: число столбцов в таблице *}
{assign var="formColumns" value=2}
{* Опция $formRows: максимальное количество строк в колонке *}
{assign var="formRows" value=2}
{assign var="currentPage" value=$_THE.PARAMS[0]}
{if not $currentPage}{assign var="currentPage" value=1}{/if}
{xs2GetPage nodes=$allForms nodesOnPage=$formColumns*$formRows page=$currentPage var="forms"}
{if not $forms}
Анекты не найдены
{else}
{if $forms|@count}
{math assign="formsInCell" equation="ceil(b/r)" r=$formColumns b=$forms|@count}
{else}
{assign var="formsInCell" value=1}
{/if}
{assign var="formCounter" value=0}
<table>
<tr>
{section loop=$formColumns name="formColumnLoop"}
{* Открывает и закрывает столбцы *}
<td>
{section loop=$formRows name="formRowLoop"}
{* Пишет внутри колонки *}
{assign var="form" value=$forms[$formCounter]}
{if $form}
<p>
{if $form.User[0].Avatar}
<img src="{$form.User[0].Avatar.path}"
width="{$form.User[0].Avatar.width}"
height="{$form.User[0].Avatar.height}">
{/if}
<a href="{xs2Href mod=$_THE.QUE.MOD obj=$_THE.QUE.OBJ
met="show" atr=$form.NodId}">{$form.NName}</a>
<br>
{date2age date=$form.User[0].Birthday} {* Возраст *}
{date2zodiac date=$form.User[0].Birthday var="sign"}
{$zodiac[$sign]} {* Знак зодиака *}
</p>
{/if}
{assign var="formCounter" value=$formCounter+1}
{/section}
</td>
{/section}
</tr>
</table>
<p>Найдено анект: {$allForms|@count}</p>
{/if}
{* /Список найденных анкет *}
{* Вывод перелистовалки страниц *}
{* Опция nodesOnPage: сколько узлов выводить на странице *}
{assign var="nodesOnPage" value=$formColumns*$formRows}
{* Опция pagerNodes: массив с узлами *}
{assign var="pagerNodes" value=$allForms}
{* Опция currentPage: текущая страница *}
{assign var="currentPage" value=$_THE.PARAMS[0]}
{* Опция pagerParam: номер параметра в адресе, через который передается номер страницы *}
{assign var="pagerParam" value=0}
{xs2Fetch mod=$_THE.QUE.MOD met="pager"}
{* /Вывод перелистовалки страниц *}
|
|