コード例 #1
0
 public function actionIndex()
 {
     $aliados = Aliados::find()->count();
     $reportados = Conductor::find()->count();
     $reportes = Reporte::find()->count();
     return $this->render('index', array('aliados' => $aliados, 'reportados' => $reportados, 'reportes' => $reportes));
 }
コード例 #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Reporte::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(['id' => $this->id, 'tipo_reporte_id' => $this->tipo_reporte_id, 'conductor_id' => $this->conductor_id, 'fecha_reporte' => $this->fecha_reporte, 'aliado_id' => $this->aliado_id]);
     $query->andFilterWhere(['like', 'descripcion', $this->descripcion]);
     return $dataProvider;
 }
コード例 #3
0
ファイル: view.php プロジェクト: josterricardo/ProyectoMilan
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\helpers\Url;
use app\models\Reporte;
use app\models\ArchivoConductor;
/* @var $this yii\web\View */
/* @var $model app\models\Conductor */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Conductor', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
//Reportes Generados
$losRespores = Reporte::find()->where(['conductor_id' => $model->id])->all();
$losAdjuntos = ArchivoConductor::find()->where(['conductor_id' => $model->id])->all();
?>
<div class="conductor-view">

    <h1>Reportado # <?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('Actualizar', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('Nuevo', ['create'], ['class' => 'btn btn-info']);
?>
        <?php 
コード例 #4
0
 /**
  * Finds the Reporte model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Reporte the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Reporte::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #5
0
ファイル: User.php プロジェクト: josterricardo/ProyectoMilan
 public function getReporte()
 {
     return $this->hasMany(Reporte::className(), ['usuario_id' => 'id']);
 }
コード例 #6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getReporte()
 {
     return $this->hasOne(Reporte::className(), ['id' => 'reporte_id']);
 }
コード例 #7
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getReportes()
 {
     return $this->hasMany(Reporte::className(), ['aliado_id' => 'id']);
 }