?> <?php echo Html::label("Fecha"); ?> <?php echo Html::input("text", "fecha", date("d/m/Y"), ['class' => 'form-control', 'readonly' => 'readonly']); ?> </div> <div> <?php echo Html::label("Partidas Presupuestarias"); ?> <?php $searchModel = new CuentaPresupuestariaSearch(); $dataProvider = $searchModel->search(''); // $dataProvider = new act CActiveDataProvider('C001tProyecto', array( // 'criteria' => array( // 'condition' => 'in_cargado = 1 AND in_activo = 0', // ), // )); echo yii\grid\GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => 'PARTIDA PRESUPUESTARIA', 'format' => 'raw', 'value' => function ($data) { return Html::label(trim($data->categoria) . trim($data->puc)); }], ['label' => 'DESCRIPCION DE PARTIDA', 'format' => 'raw', 'value' => function ($data) { if (trim($data->descripcionaux) != "") { return Html::label(trim($data->descripcionaux)); } else { $cuenta = Cuenta::find()->where("puc like '%" . trim($data->puc) . "%'")->andWhere("categoria like '%" . trim($data->categoria) . "%'")->one(); if ($cuenta) { return Html::label(trim($cuenta->descripcion));
/** * Lists all CuentaPresupuestaria models. * @return mixed */ public function actionIndex() { $searchModel = new CuentaPresupuestariaSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }