<a href="<?php echo Url::toRoute("alumnos/search"); ?> ">Enviar mail masivo</a> <div class="alumnos-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a('Create Alumnos', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'p_nombre', 's_nombre', 'p_apellido', 's_apellido', ['attribute' => 'mail', 'format' => 'raw', 'value' => function ($data) { return Html::a($data->mail, ['/site/contact', 'id' => $data->mail, 'usr' => $data->p_nombre . ' ' . $data->p_apellido]); }], 'servicio', ['attribute' => 'horario', 'value' => function ($model) { $horarios = Horarios::findOne($model->horario); return $horarios->dia . ': ' . $horarios->hora_inicio . '-' . $horarios->hora_fin; }, 'filter' => ArrayHelper::map(Horarios::find()->all(), 'id_horario', 'dia')], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
/** * Finds the Horarios model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Horarios the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Horarios::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
use yii\helpers\Html; use yii\widgets\DetailView; use app\models\Horarios; /* @var $this yii\web\View */ /* @var $model app\models\Alumnos */ $this->title = $model->id; $this->params['breadcrumbs'][] = ['label' => 'Alumnos', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="alumnos-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a('Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'p_nombre', 's_nombre', 'p_apellido', 's_apellido', 'nacimiento', 'rut', ['attribute' => 'mail', 'format' => 'raw', 'value' => Html::a($model->mail, ['update', 'id' => $model->id])], 't_fijo', 't_celular', 'direccion', 'comuna', 'servicio', 'funcion', ['attribute' => 'horario', 'value' => Horarios::findOne($model->horario)->dia . ': ' . Horarios::findOne($model->horario)->hora_inicio . ' - ' . Horarios::findOne($model->horario)->hora_fin]]]); ?> </div>