/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Atendimento::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idpreatendimento' => $this->idpreatendimento, 'date' => $this->date, 'status' => $this->status, 'dataFim' => $this->dataFim, 'classes_idclasses' => $this->classes_idclasses, 'triagem_id' => $this->triagem_id, 'interessado01' => $this->interessado01, 'interessado02' => $this->interessado02, 'user_id' => $this->user_id]);
     $query->andFilterWhere(['like', 'numeroprocesso', $this->numeroprocesso])->andFilterWhere(['like', 'tipo', $this->tipo])->andFilterWhere(['like', 'descricao', $this->descricao])->andFilterWhere(['like', 'situacao', $this->situacao]);
     return $dataProvider;
 }
Example #2
0
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model frontend\models\Audiencia */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="audiencia-form">

    <?php 
$form = ActiveForm::begin();
?>

    <div class="row">
  <div class="col-md-2"> 
  	<?php 
echo $form->field($model, 'preatendimento_idpreatendimento')->dropDownList(ArrayHelper::map(\frontend\models\Atendimento::find()->all(), 'idpreatendimento', 'numeroprocesso'), ['prompt' => 'Selecione']);
?>
  </div>
  <div class="col-md-3"> 
  	    <?php 
echo $form->field($model, 'data')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'ajaxConversion' => false, 'value' => time(), 'options' => ['pluginOptions' => ['autoclose' => true]]]);
?>
  	</div>

  	<div class="col-md-1"> 
  		<?php 
echo $form->field($model, 'hora')->widget(MaskedInput::className(), ['mask' => '99:99']);
?>
  	</div>
  </div>
	<div class="row">