예제 #1
0
파일: view.php 프로젝트: ibergonzi/country
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use frontend\models\AccesosAutmanual;
/* @var $this yii\web\View */
/* @var $model frontend\models\AccesosAutmanual */
$this->title = 'Detalle de autorización';
$this->params['breadcrumbs'][] = ['label' => 'Autorización de accesos manuales', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="accesos-autmanual-view">

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

    <p>

        <?php 
echo Html::a($model->estado == AccesosAutmanual::ESTADO_ABIERTO ? 'Cerrar periodo' : 'Abrir periodo', ['update', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Está seguro de cambiar el estado de la autorización?', 'method' => 'post']]);
?>
    </p>

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

</div>
예제 #2
0
파일: _form.php 프로젝트: ibergonzi/country
<div class="accesos-autmanual-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'hora_desde')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATETIME, 'displayFormat' => 'php:d/m/Y H:i']);
?>

    <?php 
echo $form->field($model, 'hora_hasta')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATETIME, 'displayFormat' => 'php:d/m/Y H:i']);
?>

    <?php 
echo $form->field($model, 'estado')->dropDownList(AccesosAutmanual::getEstados());
?>


    <div class="form-group">
        <?php 
echo Html::submitButton('Aceptar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
예제 #3
0
파일: index.php 프로젝트: ibergonzi/country
.kv-grid-loading {
    opacity: 0.5;
    background: #ffffff url("../images/loading.gif") top center no-repeat !important;
}
');
?>
<div class="accesos-autmanual-index">

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

    <?php 
$columns = ['id', ['attribute' => 'hora_desde', 'format' => 'datetime'], ['attribute' => 'hora_hasta', 'format' => 'datetime'], ['attribute' => 'estado', 'value' => function ($model) {
    return AccesosAutmanual::getEstados($model->estado);
}], ['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 autorización')]), '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) {