<?php use yii\helpers\Html; use yii\widgets\ActiveForm; use kartik\select2\Select2; use kartik\typeahead\TypeaheadBasic; //$form = ActiveForm::begin(); //Default Active Form begin $form = ActiveForm::begin(['id' => 'create-location', 'options' => ['class' => 'form', 'enctype' => 'multipart/form-data']]); /** * Select2 for County Selection Dropdown */ echo $form->field($model, 'country_id')->widget(Select2::classname(), ['data' => \humanized\location\components\GUIHelper::getCountryList(), 'options' => ['placeholder' => 'Select Country'], 'pluginOptions' => ['allowClear' => true]])->label(false); /* * Dependant City Typeahead */ echo $form->field($model, 'label')->widget(TypeaheadBasic::classname(), ['data' => ['' => ''], 'options' => ['placeholder' => 'Enter Location Name'], 'pluginOptions' => ['highlight' => true]])->label(false); /** * Dependant Postcode Typeahead */ echo $form->field($model, 'postcode')->widget(TypeaheadBasic::classname(), ['data' => ['' => ''], 'options' => ['placeholder' => 'Enter Postcode (Optional)'], 'pluginOptions' => ['highlight' => true]])->label(false); echo Html::submitButton('Submit', ['class' => 'btn btn-primary']); ActiveForm::end();
<div class="container"> <div class="row"> <div class="col-lg-12"> <h1>Find your dream college <br />and get accepted</h1> <p>Learn all about your dream university.</p> <div class="home-search"> <?php $data = array(); $model = new University(); $universityName = University::find()->select('name')->distinct()->all(); foreach ($universityName as $name) { array_push($data, $name->name); } //echo "<pre>"; print_r($data);die; $form = ActiveForm::begin(['id' => 'search-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'validateOnSubmit' => true, 'action' => Yii::$app->urlManager->createUrl('university/searchcollege')]); echo TypeaheadBasic::widget(['name' => 'name', 'id' => 'university-name', 'data' => $data, 'scrollable' => true, 'dataset' => ['limit' => 1000], 'options' => ['placeholder' => 'Search colleges by name'], 'pluginOptions' => ['highlight' => true]]); ?> <?php echo Html::submitButton('search', ['class' => 'btn']); ?> <?php ActiveForm::end(); ?> </div> </div> </div> </div> </div> <div class="livechatBand"> <div class="container">
$form = ActiveForm::begin(['action' => ['log'], 'method' => 'get']); ?> <?php if (Yii::$app->user->usermode != 'developer') { $dataSql = User::findBySql('SELECT DISTINCT username FROM user WHERE usermode !="developer"')->asArray()->all(); } else { $dataSql = User::findBySql('SELECT DISTINCT username FROM user')->asArray()->all(); } foreach ($dataSql as $row) { $CT_IDS[] = $row['username']; } ?> <?php echo $form->field($model, 'username')->widget(TypeaheadBasic::classname(), ['data' => $CT_IDS, 'pluginOptions' => ['highlight' => true], 'options' => ['placeholder' => 'All']]); ?> <?php echo $form->field($model, 'start_date', ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-calendar"></i>']], 'options' => ['class' => 'drp-container form-group', 'readonly' => 'readonly']])->widget(DateRangePicker::classname(), ['useWithAddon' => true, 'convertFormat' => true, 'pluginOptions' => ['locale' => ['format' => 'Y-m-d']]]); ?> <div class="form-group"> <?php echo Html::submitButton('Search', ['class' => 'btn btn-primary']); ?> <?php echo Html::resetButton('Reset', ['class' => 'btn btn-default']); ?> </div>