Esempio n. 1
0
/** @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>
Esempio n. 2
0
echo $form->textAreaGroup($model, 'direccion', array('rows' => 3, 'cols' => 50));
?>
            <?php 
if ($model->isNewRecord) {
    $data_sector = CHtml::listData(Sector::model()->activos()->findAll(), 'id', Sector::representingColumn());
    $data_subsector = null;
    $data_rama_actividad = null;
    $data_actividad = 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->subsector->sector->id))), 'id', Subsector::representingColumn());
    $model->sector_id = $model->subsector->sector->id;
    $data_actividad = null;
    $data_rama_actividad = CHtml::listData(RamaActividad::model()->activos()->findAll(array("condition" => "subsector_id =:subsector_id", "order" => "nombre", "params" => array(':subsector_id' => $model->sector_id))), 'id', RamaActividad::representingColumn());
    if ($model->rama_actividad_id) {
        $data_actividad = CHtml::listData(Actividad::model()->activos()->findAll(array("condition" => "rama_actividad_id =:rama_actividad_id", "order" => "nombre", "params" => array(':rama_actividad_id' => $model->rama_actividad_id))), 'id', Actividad::representingColumn());
    }
}
?>
            <?php 
$data_evento = CHtml::listData(Evento::model()->getEventos(), 'id', 'nombre');
if ($model->isNewRecord) {
    $eventos_id = null;
} else {
    $eventos_id = ParticipanteHasEvento::model()->getEventosParticipante($model->id);
}
echo $form->select2Group($model, 'evento_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-8'), 'widgetOptions' => array('data' => $data_evento ? $data_evento : null, 'val' => $eventos_id, 'htmlOptions' => array('multiple' => 'multiple'), 'options' => array('placeholder' => $data_evento ? ' -- Seleccione Evento -- ' : ' -- Ninguno -- ', 'width' => '568px'))));
?>
<!--            <p class="note">Seleccione su actividad económica</p>-->
            <?php 
echo $form->select2Group($model, 'sector_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-8'), 'widgetOptions' => array('data' => $data_sector ? array(null => ' -- Seleccione el sector de su actividad económica -- ') + $data_sector : array(null => ' -- Ninguno -- '), 'asDropDownList' => true, 'options' => array('tokenSeparators' => array(',', ' ')))));