<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \qcbase\models\Department */
?>

<div class="h_a">搜索</div>
<?php $searchForm = ActiveForm::begin([ 'id' => 'search-form', 'action' => [$this->context->id.'/index'], 'method' => 'get']); ?>
	<div class="search_type cc mb10">
		<span class="mr20">关键字：<input type="text" class="input length_2" value="<?= (isset($get['keywords']))?  Html::encode($get['keywords']):''; ?>" name="keywords"></span>
		<span class="mr20">搜索类型：
			<select class="select_2" name="search_field">
				<?php foreach ($model->search() as $field => $name) : ?>
				<option <?= (isset($get['search_field']) && ($get['search_field'] == $field))?'selected="selected"':''; ?> value="<?= $field ?>" ><?= $name ?></option>
				<?php endforeach; ?>
			</select>
		</span>
		<button class="btn">搜索</button>
	</div>
<?php ActiveForm::end(); ?>