Example #1
0
$this->title = 'Detalle de concepto';
$this->params['breadcrumbs'][] = ['label' => 'Conceptos de infracciones', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
// esto es para que las columnas del detailView no cambien de tamaño
$this->registerCss('table.detail-view th {width: 25%;} table.detail-view td {width: 75%;}');
?>
<div class="infrac-conceptos-view">

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

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

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'concepto', ['attribute' => 'es_multa', 'value' => InfracConceptos::getSiNo($model->es_multa)], 'dias_verif', 'multa_unidad', 'multa_precio:decimal', ['attribute' => 'multa_reincidencia', 'value' => InfracConceptos::getSiNo($model->multa_reincidencia)], 'multa_reinc_porc:decimal', 'multa_reinc_dias', ['attribute' => 'multa_personas', 'value' => InfracConceptos::getSiNo($model->multa_personas)], 'multa_personas_precio:decimal', 'userCreatedBy.username', 'created_at:datetime', 'userUpdatedBy.username', 'updated_at:datetime', ['attribute' => 'estado', 'value' => InfracConceptos::getEstados($model->estado)], 'motivo_baja']]);
?>

</div>
Example #2
0
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    
    <?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 = ['id', 'concepto', ['attribute' => 'es_multa', 'value' => function ($model) {
    return InfracConceptos::getSiNo($model->es_multa);
}, 'filter' => InfracConceptos::getSiNo()], ['attribute' => 'dias_verif', 'hAlign' => 'right'], ['attribute' => 'multa_unidad', 'value' => 'multaUnidad.unidad', 'filter' => InfracUnidades::getLista()], ['attribute' => 'multa_precio', 'format' => ['decimal', 2], 'hAlign' => 'right'], ['attribute' => 'multa_reincidencia', 'value' => function ($model) {
    return InfracConceptos::getSiNo($model->multa_reincidencia);
}, 'filter' => InfracConceptos::getSiNo()], ['attribute' => 'multa_reinc_porc', 'format' => ['decimal', 2], 'hAlign' => 'right'], ['attribute' => 'multa_reinc_dias', 'hAlign' => 'right'], ['attribute' => 'multa_personas', 'value' => function ($model) {
    return InfracConceptos::getSiNo($model->multa_personas);
}, 'filter' => InfracConceptos::getSiNo()], ['attribute' => 'multa_personas_precio', 'format' => ['decimal', 2], 'hAlign' => 'right'], ['attribute' => 'estado', 'value' => function ($model) {
    return InfracConceptos::getEstados($model->estado);
}, 'filter' => InfracConceptos::getEstados()], ['class' => 'kartik\\grid\\ActionColumn', 'header' => Html::a('<span class="glyphicon glyphicon-plus-sign"></span>', ['create'], ['class' => 'btn-sm btn-primary', 'title' => Yii::t('app', 'Nuevo concepto')]), 'template' => '{view} {comentario}', '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"),