Example #1
0
 public function actionDelete($id)
 {
     $genero = Genero::model()->findByPk($id);
     if ($genero->delete()) {
         $this->redirect(Yii::app()->request->urlReferrer);
     }
 }
Example #2
0
					</div>
					<?php 
echo $form->error($model, 'apellidos');
?>
				</div>
			</div>

			<div class="row">
				<div class="span4">
					<?php 
echo $form->labelEx($model, 'genero_id');
?>
					<div class="input-prepend">
      				<span class="add-on"><i class="icon-list-alt"></i></span>
						<?php 
echo $form->dropDownList($model, 'genero_id', CHtml::listData(Genero::model()->findAll(), 'id', 'genero'), array('class' => 'input-medium', 'empty' => ""));
?>
					</div>
					<?php 
echo $form->error($model, 'genero_id');
?>
				</div>

				<div class="span4">
					<?php 
echo $form->labelEx($model, 'estado_civil_id');
?>
					<div class="input-prepend">
      				<span class="add-on"><i class="icon-list-alt"></i></span>
						<?php 
echo $form->dropDownList($model, 'estado_civil_id', CHtml::listData(EstadoCivil::model()->findAll(), 'id', 'estado_civil'), array('class' => 'input-normal', 'empty' => ""));
Example #3
0
/* @var $this AlumnosController */
/* @var $model Alumnos */
$this->menu = array(array('label' => 'Crear Alumno', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#alumnos-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Buscar Alumnos</h1>

<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'alumnos-grid', 'dataProvider' => $model->search(), 'afterAjaxUpdate' => 'reinstallDatePickerNacimiento', 'filter' => $model, 'columns' => array(array('header' => 'ID.', 'name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('width' => '20')), 'nombres', 'apellidos', 'n_identificacion', array('name' => 'genero_id', 'filter' => CHtml::listData(Genero::model()->findAll(), 'id', 'genero'), 'value' => '$data[\'genero\'][\'genero\']', 'htmlOptions' => array('width' => '110')), array('name' => 'estado_civil_id', 'filter' => CHtml::listData(EstadoCivil::model()->findAll(), 'id', 'estado_civil'), 'value' => '$data[\'estadoCivil\'][\'estado_civil\']', 'htmlOptions' => array('width' => '150')), array('header' => 'Fecha de Nacimiento', 'name' => 'fecha_nacimiento', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha_nacimiento', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '1900:2000'), 'htmlOptions' => array('id' => 'datepicker_for_fecha_nacimiento', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha_nacimiento\']);', 'htmlOptions' => array('width' => '80')), array('name' => 'jornada_id', 'filter' => CHtml::listData(Jornada::model()->findAll(), 'id', 'jornada'), 'value' => '$data[\'jornada\'][\'jornada\']', 'htmlOptions' => array('width' => '150')), array('header' => 'Fecha de Ingreso', 'name' => 'fecha_ingreso', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha_ingreso', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '1900:2000'), 'htmlOptions' => array('id' => 'datepicker_for_fecha_ingreso', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha_ingreso\']);', 'htmlOptions' => array('width' => '80')), array('class' => 'CButtonColumn', 'template' => '{view}{update}'))));
Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePickerNacimiento(id, data) {\n    \$('#datepicker_for_fecha_nacimiento').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n    \$('#datepicker_for_fecha_ingreso').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n}\n");
?>


<script>
    $(document).ready(function()
    {
        $('body').on('dblclick', '#alumnos-grid tbody tr', function(event)
        {
            var
                rowNum = $(this).index(),
                keys = $('#alumnos-grid > div.keys > span'),
                rowId = keys.eq(rowNum).text();

            location.href = '<?php 
Example #4
0
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php 
echo $form->labelEx($model, 'GENERO');
?>
                        <?php 
if ($model->GENERO != "") {
    $valtemp = $model->GENERO;
} elseif ($modelold->GENERO != "") {
    $valtemp = $modelold->GENERO;
} else {
    $valtemp = "";
}
echo $form->dropDownList($model, 'GENERO', CHtml::listData(Genero::model()->findAll(), 'codigo', 'descripcion'), array('prompt' => 'Seleccione...', 'class' => 'Ccombo', 'options' => array($valtemp => array('selected' => true))));
?>
                        <?php 
echo $form->error($model, 'GENERO');
?>
                    </td>
                    <td>
                        <?php 
echo $form->labelEx($model, 'TIPO_DOCUMENTO');
?>
                        <?php 
if ($model->TIPO_DOCUMENTO != "") {
    $valtemp = $model->TIPO_DOCUMENTO;
} elseif ($modelold->TIPO_DOCUMENTO != "") {
    $valtemp = $modelold->TIPO_DOCUMENTO;
} else {
Example #5
0
<div class="row">
    <?php 
if (Yii::app()->user->checkAccess('asignar_generos')) {
    ?>
    <div class="col-sm-12">
        <?php 
    $form = $this->beginWidget('CActiveForm', array('id' => 'url-form', 'action' => $this->createUrl('genero/asignar'), 'enableAjaxValidation' => false, 'htmlOptions' => array('role' => 'form')));
    $mxg = new MicrositioXGenero();
    ?>
        <div class="nav navbar-right input-group col-sm-12">
            <?php 
    echo $form->hiddenField($mxg, 'micrositio_id', array('value' => $model->id));
    ?>
            <?php 
    echo $form->dropDownList($mxg, 'genero_id', CHtml::listData(Genero::model()->getGeneros($model->id), 'id', 'nombre'), array('class' => 'form-control'));
    ?>
            <span class="input-group-btn">
                <?php 
    echo CHtml::submitButton('Asignar +', array('class' => 'btn btn-primary btn-block'));
    ?>
            </span>
        </div>
        <?php 
    $this->endWidget();
    ?>
    </div>
    <?php 
}
?>
    <?php 
if ($generos->getData()) {