예제 #1
0
파일: view.php 프로젝트: ibergonzi/country
	<div class='container'>
		
		<div class='row'>

			<div class="col-md-6">

				<?php 
$imgClass = $pdf ? 'pull-right' : 'img-thumbnail pull-right';
$sinImg = Yii::$app->urlManager->createUrl('images/sinmulta.jpg');
if (!empty($model->foto)) {
    $imgFile = Yii::$app->urlManager->createUrl('images/multas/' . $model->foto);
    $imgFoto = Html::img($imgFile, ['class' => $imgClass, 'onerror' => "this.src='{$sinImg}'"]);
} else {
    $imgFoto = Html::img($sinImg, ['class' => $imgClass]);
}
echo DetailView::widget(['model' => $model, 'options' => ['class' => 'table table-striped table-bordered table-condensed detail-view'], 'attributes' => ['id', 'nro_acta', 'fecha:date', 'hora:time', 'id_uf', 'concepto.concepto', 'id_vehiculo', 'vehiculo.patente', 'vehiculo.marca', 'vehiculo.modelo', 'vehiculo.color', 'id_persona', 'persona.apellido', 'persona.nombre', 'persona.nro_doc', 'lugar', 'id_informante', 'informante.apellido', 'informante.nombre', 'descripcion', ['attribute' => 'notificado', 'value' => Infracciones::getSiNo($model->notificado)], 'fecha_verif', ['attribute' => 'verificado', 'value' => Infracciones::getSiNo($model->verificado)], 'multaUnidad.unidad', 'multa_fec_reinc:date', 'multa_monto', 'multa_pers_cant', 'multa_pers_monto', 'multa_pers_total', 'multa_total', 'userCreatedBy.username', 'created_at:datetime', 'userUpdatedBy.username', 'updated_at:datetime', ['label' => 'Estado', 'value' => Infracciones::getEstados($model->estado), 'visible' => $pdf ? false : true], ['attribute' => 'motivo_baja', 'visible' => $pdf ? false : true], ['label' => 'Foto', 'value' => $imgFoto, 'format' => 'raw', 'visible' => $pdf]]]);
?>
				
			</div>
			<div class="col-md-6">
				<?php 
if (!$pdf) {
    echo $imgFoto;
}
?>

			</div>	
		</div>
	</div>

</div>
예제 #2
0
파일: index.php 프로젝트: ibergonzi/country
if (\Yii::$app->session->get('infracFecDesde')) {
    $lbl2 = ' (' . Yii::$app->formatter->asDate(\Yii::$app->session->get('infracFecDesde')) . '-' . Yii::$app->formatter->asDate(\Yii::$app->session->get('infracFecHasta')) . ')';
} else {
    $lbl2 = '';
}
$pdfHeader = ['L' => ['content' => Html::img(Yii::$app->homeUrl . 'images/logoreportes.png')], 'C' => ['content' => $this->title . $lbl2, 'font-style' => 'B'], 'R' => ['content' => \Yii::$app->params['lblName']]];
$pdfFooter = ['L' => ['content' => \Yii::$app->params['lblName2']], 'C' => ['content' => 'página {PAGENO} de {nb}'], 'R' => ['content' => 'Fecha:{DATE d/m/Y}']];
$columns = ['id', ['attribute' => 'id_uf', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
    return Html::a($model->id_uf, Yii::$app->urlManager->createUrl(['uf/view', 'id' => $model->id_uf]), ['title' => 'Ver detalle de la unidad funcional', 'target' => '_blank', 'data-pjax' => '0']);
}], ['attribute' => 'fecha', 'format' => 'date'], ['attribute' => 'hora', 'format' => 'time'], 'nro_acta', 'lugar', ['attribute' => 'rConcepto', 'value' => 'concepto.concepto', 'filter' => InfracConceptos::getLista()], 'descripcion', ['attribute' => 'notificado', 'value' => function ($model) {
    return Infracciones::getSiNo($model->notificado);
}, 'filter' => Infracciones::getSiNo()], ['attribute' => 'fecha_verif', 'format' => 'date'], ['attribute' => 'verificado', 'value' => function ($model) {
    return Infracciones::getSiNo($model->verificado);
}, 'filter' => Infracciones::getSiNo()], ['attribute' => 'rUnidad', 'value' => 'multaUnidad.unidad', 'filter' => InfracUnidades::getLista()], 'multa_total', ['attribute' => 'estado', 'value' => function ($model) {
    return Infracciones::getEstados($model->estado);
}, 'filter' => Infracciones::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', 'Alta de infracción/multa')]), '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"),
							success  : function(response) {
										$("#divcomentarionuevo").html(response);