Esempio n. 1
0
/* @var $model frontend\models\CortesEnergia */
$this->title = 'Corte de energía';
$this->params['breadcrumbs'][] = ['label' => 'Cortes de energía', 'url' => ['cortes-energia/index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="cortes-energia-view">

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

	<?php 
if ($model->estado == CortesEnergia::ESTADO_ACTIVO) {
    echo '<p>';
    if (\Yii::$app->user->can('modificarCorte')) {
        echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
    }
    if (\Yii::$app->user->can('borrarCorte')) {
        echo ' ' . Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger']);
    }
    echo '</p>';
}
?>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['hora_desde:datetime', 'hora_hasta:datetime', 'userCreatedBy.username', 'created_at:datetime', 'userUpdatedBy.username', 'updated_at:datetime', ['label' => 'Estado', 'value' => CortesEnergia::getEstados($model->estado)], 'motivo_baja']]);
?>

</div>
Esempio n. 2
0
    background: #ffffff url("../images/loading.gif") top center no-repeat !important;
}
');
?>
<div class="cortes-energia-index">

    <h3><?php 
echo Html::encode($this->title);
?>
</h3>
    <?php 
$lbl2 = '';
$pdfHeader = ['L' => ['content' => \Yii::$app->params['lblName']], 'C' => ['content' => $this->title . $lbl2, 'font-style' => 'B'], 'R' => ['content' => '']];
$pdfFooter = ['L' => ['content' => \Yii::$app->params['lblName2']], 'C' => ['content' => 'página {PAGENO} de {nb}'], 'R' => ['content' => 'Fecha:{DATE d/m/Y}']];
$columns = [['attribute' => 'hora_desde', 'format' => ['datetime'], 'filter' => MaskedInput::widget(['model' => $searchModel, 'attribute' => 'hora_desde', 'mask' => '99/99/9999'])], ['attribute' => 'hora_hasta', 'format' => ['datetime'], 'filter' => MaskedInput::widget(['model' => $searchModel, 'attribute' => 'hora_hasta', 'mask' => '99/99/9999'])], ['attribute' => 'estado', 'value' => function ($data) {
    return CortesEnergia::getEstados($data->estado);
}, 'filter' => $searchModel->estados], 'motivo_baja', ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{view} {comentario} {generadores}', 'buttons' => ['comentario' => function ($url, $model) {
    $c = Comentarios::getComentariosByModelId($model->className(), $model->id);
    $text = '<span class="glyphicon glyphicon-copyright-mark"';
    if (!empty($c)) {
        $text .= ' style="color:#FF8000"></span>';
        $titl = 'Ingresar nuevo/Ver comentarios';
    } else {
        $text .= '></span>';
        $titl = 'Ingresar nuevo comentario';
    }
    return Html::a($text, $url, ['title' => $titl, 'onclick' => '$.ajax({
								type     :"POST",
								cache    : false,
								url  : $(this).attr("href"),
								success  : function(response) {