Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = RequestType::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(['type_id' => $this->type_id]);
     $query->andFilterWhere(['like', 'request_name', $this->request_name])->andFilterWhere(['like', 'req_type', $this->req_type])->andFilterWhere(['like', 'date_in', $this->date_in]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
 /**
  * Finds the RequestType model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return RequestType the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = RequestType::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getReqType()
 {
     return $this->hasOne(RequestType::className(), ['type_id' => 'req_type_id']);
 }
Ejemplo n.º 4
0
<?php

use yii\helpers\Html;
//use yii\widgets\ActiveForm;
use kartik\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use app\models\RequestType;
use yii\helpers\ArrayHelper;
use app\models\Staff;
/* @var $this yii\web\View */
/* @var $model app\models\RequestDic */
/* @var $form yii\widgets\ActiveForm */
?>

<?php 
$RequestType = RequestType::find()->all();
$arraytype = ArrayHelper::map($RequestType, 'type_id', 'request_name');
$Staff = Staff::find()->all();
$arrayStaff = ArrayHelper::map($Staff, 'staff_id', 'name');
if (isset($erros)) {
    echo Alert::widget(['options' => ['class' => 'alert-info'], 'body' => $erros]);
}
?>

<div class="request-dic-form">

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

     <?php