<!-- IF TPL_SEARCH_MAIN -->
<!--========================================================================-->

<a name="start"></a>
<div class="col-md-12">
<div class="page-header m-b-0">
    <h1><i class="page-header-icon ion-ios-search"></i>{PAGE_TITLE}</h1>
</div>
<br>
<div class="panel">
    <div class="panel-heading">
        <div class="panel-title">{L_SEARCH_OPTIONS}</div>
    </div>
    <div class="panel-body">
		<form action="{SEARCH_ACTION}" method="POST" name="post">
		{S_HIDDEN_FIELDS}

		<div class="row">
            <div class="col-sm-6 form-group">
                <label>{L_SEARCH_WORDS}<!-- IF $bb_cfg['search_help_url'] --> <a href="{$bb_cfg['search_help_url']}">[?]</a><!-- ENDIF --></label>
				<input id="text_match_input" type="text" style="width: 95%" class="form-control" name="{TEXT_MATCH_KEY}" size="30" />
				<div class="custom-control checkbox-inline p-x-0">{TITLE_ONLY_CHBOX}</div><div class="custom-control checkbox-inline p-x-0">{ALL_WORDS_CHBOX}</div>
            </div>
            <div class="col-sm-6 form-group">
                <label>{L_SEARCH_AUTHOR}</label>
				<div class="input-group">
				<input placeholder="{L_SEARCH_S}" id="author" type="text" class="form-control" name="{POSTER_NAME_KEY}" />
				<span class="input-group-btn">
					<input class="btn" type="button" value="{L_FIND_USERNAME}" onclick="window.open('{U_SEARCH_USER}', '_bbsearch', IWP_US); return false;" />
				</span>
				</div>

				<div class="custom-control checkbox-inline p-x-0">
				<label class="custom-control custom-checkbox">
					<input type="checkbox" class="custom-control-input"
						onclick="
							toggle_disabled('author', !this.checked);
							toggle_disabled('{MY_TOPICS_ID}', this.checked);
							if (this.checked) { $p('author').value = '{THIS_USER_NAME}'; }
							else { $p('author').value = ''; $p('{MY_TOPICS_ID}').checked = 0; };
						"
						name="{POSTER_ID_KEY}" value="{THIS_USER_ID}" />
					<span class="custom-control-indicator"></span>
					{L_IN_MY_POSTS}
				</label>
				</div>
				<div class="custom-control checkbox-inline p-x-0">{MY_TOPICS_CHBOX}</div>
			</div>
			<div class="col-sm-12 form-group">
			<hr class="page-wide-block m-a-1">
				<p class="med pad_2">{L_SEARCH_WORDS_EXPL}</p>
			<hr class="page-wide-block m-a-1">
            </div>
        </div>

		<div class="row">
			<div class="col-sm-6 form-group">
				<label>{L_FORUM}</label>
				<p class="select">{FORUM_SELECT}</p>
			</div>

			<div class="col-sm-6 form-group">
				<label>{L_MY_DOWNLOADS}</label>
				<div>
					<table class="borderless my_downloads" cellspacing="0">
					<tr>
						<td>{DL_COMPL_CHBOX}</td>
						<td>{DL_WILL_CHBOX}</td>
					</tr>
					<tr>
						<td>{DL_DOWN_CHBOX}</td>
						<td>{DL_CANCEL_CHBOX}</td>
					</tr>
					</table>
				</div>
				<hr class="page-wide-block m-a-1">

				<label>{L_SEARCH_PREVIOUS}</label>
				<p class="select">{TIME_SELECT}</p>
				<p class="chbox"><div class="custom-control checkbox-inline p-x-0">{ONLY_NEW_CHBOX}</div><div class="custom-control checkbox-inline p-x-0">{NEW_TOPICS_CHBOX}</div></p>
				<hr class="page-wide-block m-a-1">

				<label>{L_DISPLAY_RESULTS_AS}</label>
				<p class="select">{DISPLAY_AS_SELECT}&nbsp;{CHARS_SELECT}</p>
				<hr class="page-wide-block m-a-1">

				<label>{L_SORT_BY}</label>
				<p class="select">{ORDER_SELECT}&nbsp;{SORT_SELECT}</p>

			</div>
		</div>
		<hr class="page-wide-block m-t-0">
		<div class="row">
			<div class="col-sm-12 text-center">
				<input class="btn btn-success btn-3d" type="submit" name="submit" value="&nbsp;&nbsp;{L_SEARCH}&nbsp;&nbsp;" />
			</div>
		</div>
		</form>
    </div>
</div>

<!--========================================================================-->
<!-- ENDIF / TPL_SEARCH_MAIN -->
</div>

<!-- IF TPL_SEARCH_USERNAME -->
<!--========================================================================-->

<script type="text/javascript">
function refresh_username(selected_username)
{
    if (selected_username === '') {
        return;
    }
	opener.document.forms['post'].{INPUT_NAME}.value = selected_username;
	opener.focus();
	window.close();
}
</script>

<form method="post" name="search" action="{SEARCH_ACTION}">

<table class="bordered search_username">
<tr>
	<th class="thHead">{L_FIND_USERNAME}gdfgdfg</th>
</tr>
<tr>
	<td class="row1 pad_12">
		<p>
			<input placeholder="{L_SEARCH_S}" type="text" name="search_username" value="{USERNAME}" class="post" />&nbsp;
			<input type="submit" name="search" value="{L_SEARCH}" class="liteoption" />
		</p>
		<p class="small">{L_SEARCH_AUTHOR_EXPL}</p>
		<!-- IF USERNAME_OPTIONS -->
		<h5 style="margin: 1em 0 0.4em;">{L_SELECT_USERNAME}</h5>
		<p>
			<select name="username_list">{USERNAME_OPTIONS}</select>&nbsp;
			<input type="submit" class="main" onclick="refresh_username(this.form.username_list.options[this.form.username_list.selectedIndex].value);return false;" name="use" value="{L_SELECT}" />
		</p>
		<!-- ENDIF -->
		<br />
		<a href="javascript:window.close();" class="med">{L_CLOSE_WINDOW}</a>
	</td>
</tr>
</table>

</form>

<!--========================================================================-->
<!-- ENDIF / TPL_SEARCH_USERNAME -->
