예제 #1
0
파일: index.php 프로젝트: ibergonzi/country
?>
</h3>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
//echo Html::a(Yii::t('app', 'Create User'), ['create'], ['class' => 'btn btn-success'])
?>
    </p>

	<?php 
$columns = ['id', 'username', ['attribute' => 'descRolUsuario', 'value' => 'authAssignment.authItem.description'], ['attribute' => 'acceso_externo', 'value' => function ($model) {
    return User::getSiNo($model->acceso_externo);
}, 'filter' => User::getSiNo()], ['attribute' => 'email', 'format' => 'email'], ['class' => 'kartik\\grid\\ActionColumn', 'header' => '', 'template' => '{view} {update} {delete} {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);
예제 #2
0
파일: _form.php 프로젝트: ibergonzi/country
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
				
				<div class="form-group">
				<?php 
$rol = User::getRol($model->id);
echo Html::label('Rol', 'rol', ['class' => 'control-label']);
//Yii::trace(ArrayHelper::map(AuthAssignment::listaRoles(), 'name', 'description'));
echo Html::dropDownList('rol', $rol->name, ArrayHelper::map(AuthAssignment::listaRoles(), 'name', 'description'), ['id' => 'rol', 'class' => 'form-control']);
?>
				<?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>
				
				<?php 
echo $form->field($model, 'acceso_externo')->dropDownList(User::getSiNo());
?>
				<?php 
if ($model->isNewRecord) {
    echo $form->field($model, 'foto')->fileInput();
}
if (!$model->isNewRecord) {
    echo $form->field($model, 'foto')->hint($model->foto)->fileInput();
}
?>
				</div>



				<div class="form-group">
					<?php