/** @var Participante $model */ $this->menu = array(array('label' => Yii::t('AweCrud.app', 'Create'), 'icon' => 'plus', 'url' => array('create'))); Util::tsRegisterAssetJs('admin.js'); ?> <div id="flashMsg" class="flash-messages"> </div> <br/> <div class="panel panel-default"> <div class="panel-heading"><?php echo Yii::t('AweCrud.app', 'Manage'); ?> <?php echo Participante::label(2); ?> </div> <div class="panel-body"> <div style='overflow:auto'> <?php $this->widget('booster.widgets.TbGridView', array('id' => 'participante-grid', 'type' => 'striped hover advance', 'template' => "{items} {summary} {pager}", 'dataProvider' => $model->activos()->search(), 'filter' => $model, 'columns' => array('nombres', 'apellidos', 'cedula', array('name' => 'telefono', 'value' => '$data->telefono ? $data->telefono : "<span style=\\"color:#EBBBAA; font-style:italic\\" class=\\"vacios\\">--vacío--</span>"', 'type' => 'raw'), array('name' => 'celular', 'value' => '$data->celular ? $data->celular : "<span style=\\"color:#EBBBAA; font-style:italic\\" class=\\"vacios\\">--vacío--</span>"', 'type' => 'raw'), array('name' => 'sector_id', 'value' => 'isset($data->sector) ? $data->sector : null', 'filter' => CHtml::listData(Sector::model()->findAll(), 'id', Sector::representingColumn())), array('name' => 'subsector_id', 'value' => 'isset($data->subsector) ? $data->subsector : null', 'filter' => CHtml::listData(Subsector::model()->findAll(), 'id', Subsector::representingColumn())), array('name' => 'rama_actividad_id', 'value' => 'isset($data->ramaActividad) ? $data->ramaActividad : "<span style=\\"color:#EBBBAA; font-style:italic\\" class=\\"vacios\\">--vacío--</span>"', 'filter' => CHtml::listData(RamaActividad::model()->findAll(), 'id', RamaActividad::representingColumn()), 'type' => 'raw'), array('name' => 'actividad_id', 'value' => '$data->actividad ? $data->actividad : "<span style=\\"color:#EBBBAA; font-style:italic\\" class=\\"vacios\\">--vacío--</span>"', 'filter' => CHtml::listData(Actividad::model()->findAll(), 'id', Actividad::representingColumn()), 'type' => 'raw'), array('htmlOptions' => array('nowrap' => 'nowrap'), 'class' => 'booster.widgets.TbButtonColumn', 'template' => '{view} {update} {delete}', 'afterDelete' => 'function(link,success,data){ if(success) { $("#flashMsg").empty(); $("#flashMsg").css("display",""); $("#flashMsg").html(data).animate({opacity: 1.0}, 5500).fadeOut("slow"); } }', 'buttons' => array('view' => array('label' => '<button class="btn btn-primary"><i class="icon-pencil"></i></button>', 'options' => array('title' => 'Ver Info'), 'imageUrl' => false), 'update' => array('label' => '<button class="btn btn-primary"><i class="icon-pencil"></i></button>', 'options' => array('title' => 'Actualizar'), 'url' => 'Yii::app()->createUrl("/crm/participante/update/id/".$data->id."/r/0")', 'imageUrl' => false), 'delete' => array('label' => '<button class="btn btn-danger"><i class="icon-trash"></i></button>', 'options' => array('title' => 'Eliminar'), 'imageUrl' => false)), 'htmlOptions' => array('width' => '80px'))))); ?> </div> </div> </div>
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array('type' => 'horizontal', 'id' => 'actividad-form', 'enableAjaxValidation' => true, 'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false), 'enableClientValidation' => false)); ?> <?php echo $form->textFieldGroup($model, 'nombre', array('maxlength' => 45)); ?> <?php if ($model->isNewRecord) { $data_sector = CHtml::listData(Sector::model()->activos()->findAll(), 'id', Sector::representingColumn()); $data_subsector = null; $data_ramaActividad = null; } else { $data_sector = CHtml::listData(Sector::model()->activos()->findAll(), 'id', Sector::representingColumn()); $data_subsector = CHtml::listData(Subsector::model()->activos()->findAll(array("condition" => "sector_id =:sector_id", "order" => "nombre", "params" => array(':sector_id' => $model->ramaActividad->subsector->sector->id))), 'id', Subsector::representingColumn()); $data_ramaActividad = CHtml::listData(RamaActividad::model()->activos()->findAll(array("condition" => "subsector_id =:subsector_id", "order" => "nombre", "params" => array(':subsector_id' => $model->ramaActividad->subsector->id))), 'id', Subsector::representingColumn()); $model->sector_id = $model->ramaActividad->subsector->sector->id; $model->subsector_id = $model->ramaActividad->subsector->id; } ?> <?php echo $form->select2Group($model, 'sector_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-8'), 'widgetOptions' => array('data' => $data_sector ? array(null => ' -- Seleccione -- ') + $data_sector : array(null => ' -- Ninguno -- '), 'asDropDownList' => true, 'options' => array('tokenSeparators' => array(',', ' '))))); ?> <?php echo $form->select2Group($model, 'subsector_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-8'), 'widgetOptions' => array('data' => $data_subsector ? array(null => ' -- Seleccione -- ') + $data_subsector : array(null => ' -- Ninguno -- '), 'asDropDownList' => true, 'options' => array('tokenSeparators' => array(',', ' '))))); ?> <?php echo $form->select2Group($model, 'rama_actividad_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-8'), 'widgetOptions' => array('data' => $data_ramaActividad ? array(null => ' -- Seleccione -- ') + $data_ramaActividad : array(null => ' -- Ninguno -- '), 'asDropDownList' => true, 'options' => array('tokenSeparators' => array(',', ' ')))));