Example #1
0
		<?php echo $form->error($model,'email'); ?>
	</div>
    <div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name'); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gender'); ?>
        <?php echo $form->DropDownList($model,'gender',Anketa::$getGenders,array('empty'=>'Надо выбрать')); ?>
		<?php echo $form->error($model,'gender'); ?>
	</div>

	<div class="row">
        <?php if (strpos($model->birthday,'-')) $model->birthday = anketa::dateconvert($model->birthday) ?>
		<?php echo $form->labelEx($model,'birthday'); ?>

        <?php
        if ($_SERVER['REMOTE_ADDR']=='89.169.186.44') {//83.149.9.137
            echo '<div id="anketa-register-birthday">';
            $months = array(1 => 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь');
            $days = range(1, 31);
            $days = array_combine($days, $days);
            $years = range(1950, 2000);
            $years = array_combine($years, $years);
            echo $form->dropDownList($model,'birthDay',$days,array('empty'=>'День'));
            echo $form->dropDownList($model,'birthMonth',$months,array('empty'=>'Месяц'));
            echo $form->dropDownList($model,'birthYear',$years,array('empty'=>'Год'));
            echo '<br clear="all"/></div>';
        } else {
Example #2
0
    <div class="row">
   		<?php 
echo $form->labelEx($model, 'gender');
?>
        <?php 
echo $form->DropDownList($model, 'gender', Anketa::$getGenders, array('empty' => 'Надо выбрать'));
?>
   		<?php 
echo $form->error($model, 'gender');
?>
   	</div>

    <div class="row">
        <?php 
if (strpos($model->birthday, '-')) {
    $model->birthday = anketa::dateconvert($model->birthday);
}
?>
   		<?php 
echo $form->labelEx($model, 'birthday');
?>
        <?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('attribute' => 'birthday', 'model' => $model, 'options' => array('showAnim' => 'fold', 'changeMonth' => 'true', 'changeYear' => 'true', 'stayOpen' => 'true', 'yearRange' => "1950:" . (date('Y') - 17), 'onSelect' => 'js:function(dateText, inst) {$(inst).attr("title",parseInt(dateText));$(this).datepicker("setDate",dateText);return fаlse;}', 'onChangeMonthYear' => 'js:function(year, month, inst) {$(this).datepicker("setDate",($(inst).attr("title")?$(inst).attr("title"):"01")+"."+month+"."+year);}', 'closeText' => 'Готово', 'showButtonPanel' => 'true', 'defaultDate' => '-18y'), 'language' => 'ru', 'htmlOptions' => array('id' => 'birthday')));
?>
   		<?php 
echo $form->error($model, 'birthday');
?>
   	</div>
<? /*
	<div class="row">
		<?php