/**
  * 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;
 }
 /**
  * Finds the Atendimento model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Atendimento the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Atendimento::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPreatendimentoIdpreatendimento()
 {
     return $this->hasOne(Atendimento::className(), ['idpreatendimento' => 'preatendimento_idpreatendimento']);
 }
示例#4
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">