Exemple #1
0
<div class="wide form">

<?php 
$form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'get'));
?>
    
    <?php 
$superuser = User::model()->find('id=:id', array(':id' => Yii::app()->user->id))->superuser;
?>
    
	<div class="row">
		<?php 
echo $form->labelEx($model, 'active');
?>
		<?php 
echo CustomCHtml::radioButtonSwitch('CompetitionCategory[active]', $model->active, array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes')));
?>
		<?php 
echo $form->error($model, 'active');
?>
	</div>

	<div class="row">
		<?php 
echo $form->label($model, 'name');
?>
		<?php 
echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255));
?>
	</div>
Exemple #2
0
echo $form->labelEx($model, 'type');
?>
        <?php 
echo CHtml::dropDownList('Competition[type]', $model->type, $model->GetTypeOfCompetition(), array('empty' => Yii::t('app', 'choose')));
?>
        <?php 
echo $form->error($model, 'type');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'public_access');
?>
        <?php 
echo CustomCHtml::radioButtonSwitch('Competition[public_access]', $model->public_access, array(2 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes')));
?>
        <?php 
echo $form->error($model, 'public_access');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'duration');
?>
        <?php 
echo $form->textField($model, 'duration');
?>
        <?php 
echo $form->error($model, 'duration');
Exemple #3
0
echo $form->labelEx($model, 'activated_timestamp');
?>
        <?php 
echo $form->textField($model, 'activated_timestamp');
?>
        <?php 
echo $form->error($model, 'activated_timestamp');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'coordinator');
?>
        <?php 
echo CustomCHtml::radioButtonSwitch('SchoolMentor[coordinator]', $model->active, array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes')));
?>
        <?php 
echo $form->error($model, 'coordinator');
?>
    </div>


    <div class="row buttons">
        <br /><?php 
$this->widget('zii.widgets.jui.CJuiButton', array('name' => 'button', 'caption' => $model->isNewRecord ? Yii::t('app', 'create') : Yii::t('app', 'save'), 'value' => $model->isNewRecord ? Yii::t('app', 'create') : Yii::t('app', 'save')));
?>
	</div>

    <?php 
$this->endWidget();
Exemple #4
0
?>
            <?php 
echo $form->error($school_mentor, 'school_id');
?>
 
        </div>
    </div>

    <div class="row">
        <div id="coordinator_id">
            <?php 
echo $form->labelEx($school_mentor, 'Do you want to be coordinator?');
?>
<br>
            <?php 
echo CustomCHtml::radioButtonSwitch('SchoolMentor[coordinator]', $school_mentor->coordinator, array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes')));
echo $form->error($school_mentor, 'coordinator');
?>
        </div>
    </div>


    <div class="buttons">
        <br /><?php 
$this->widget('zii.widgets.jui.CJuiButton', array('name' => 'button', 'caption' => $model->isNewRecord = Yii::t('app', 'Register'), 'value' => $model->isNewRecord = Yii::t('app', 'Register'), 'htmlOptions' => array('style' => 'height: 35px; font-size: 12px; width: 200px')));
?>
    </div>

        <?php 
$this->endWidget();
?>
Exemple #5
0
            <?php 
echo $form->textField($model, 'class', array('size' => 20, 'maxlength' => 20, 'autocomplete' => 'off', 'style' => 'width: 115px; padding-left: 5px;'));
?>
        </div>
        <div style="clear: both;"></div>
        <?php 
echo $form->error($model, 'class');
?>
    </div>

    <div class="row" style="width: 420px; height: 19px;">
        <?php 
echo $form->labelEx($model, 'gender', array('id' => 'GenderLabel'));
?>
        <?php 
echo CustomCHtml::radioButtonSwitch('CompetitionUser[gender]', $model->gender, array(0 => Yii::t('app', 'Male'), 1 => Yii::t('app', 'Female')), array('labelOptions' => array("style" => "width:50px;")));
?>
        <?php 
echo $form->error($model, 'gender');
?>
    </div>

    <div class="row">
        <?php 
echo $form->labelEx($model, 'access_code');
?>
        <?php 
echo $form->textField($model, 'access_code', array('autocomplete' => 'off'));
?>
        <?php 
echo $form->error($model, 'access_code');
Exemple #6
0
 /**
  * Generates a drop down list for a model attribute.
  * 
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $data data for generating the list options (value=>display)
  * @param type $dropdownOptions additional HTML attributes for the dropdown part of the list.
  * Besides the general HTML attributes, which are already suported by {@link activeDropdownList}, 
  * the following additional options (HTML and non-HTML are supported):
  * <ul>
  * <li><b>loadingImage</b>: array of options for displaying the image for loading indicator, 
  * used to indicate "busy" state (i.e. when ajax request is being processed in background).
  * Valid options are:
  * <ul>
  * <li><b>image</b>, string, sets the image for loading indicator; if not set, the image is
  * automatically determined as Yii::app()->theme->baseUrl.'/img/icons/loading.gif'.</li>
  * <li><b>htmlOptions</b>, array (attribute => value) of HTML attributes for the IMG tag</li>
  * </ul>
  * </li>
  * </ul>
  * @param type $optionsAdd additional options for the ADD button:
  * <ul>
  * <li><b></b>
  * </li>
  * </ul>
  * @param type $optionsEdit additional options for the EDIT button:
  * <ul>
  * <li><b></b>
  * </li>
  * </ul>
  * @return string the generated drop down list
  */
 public static function advancedDropDownList($model, $attribute, $data, $dropdownOptions = array(), $optionsAdd = array(), $optionsEdit = array())
 {
     $loadingImage = "";
     if (!array_key_exists('image', $optionsAdd)) {
         $optionsAdd['image'] = Yii::app()->theme->baseUrl . '/img/add.png';
     }
     if (!array_key_exists('image', $optionsEdit)) {
         $optionsEdit['image'] = Yii::app()->theme->baseUrl . '/img/edit.png';
     }
     $addButton = self::createButtonLink($optionsAdd);
     $editButton = self::createButtonLink($optionsEdit);
     if (array_key_exists('loadingImage', $dropdownOptions)) {
         $loadingImage = CustomCHtml::createLoadingImage($dropdownOptions['loadingImage'], $addButton != "" && $editButton != "");
         unset($dropdownOptions['loadingImage']);
     }
     $dropdownList = CHtml::activeDropDownList($model, $attribute, $data, $dropdownOptions);
     return $dropdownList . $addButton . $editButton . $loadingImage;
 }
Exemple #7
0
    echo $form->error($model, 'award');
    ?>
        </div>
        <?php 
}
?>

    <?php 
if (CompetitionUser::canShowAdvancingToNextLevel($model->competition_id)) {
    ?>
        <div class="row">
            <?php 
    echo $form->labelEx($model, 'advancing_to_next_level');
    ?>
            <?php 
    echo CustomCHtml::radioButtonSwitch('CompetitionUser[advancing_to_next_level]', $model->advancing_to_next_level, array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes')), array('disabled' => $edit_all ? '' : 'disabled'));
    ?>
            <?php 
    echo $form->error($model, 'advancing_to_next_level');
    ?>
        </div>
        <?php 
}
?>

    <?php 
/*
 <div class="row">
 <?php echo $form->labelEx($model, 'total_points_via_answers'); ?>
 <?php echo $form->textField($model, 'total_points_via_answers', array('size' => 10, 'maxlength' => 10)); ?>
 <?php echo $form->error($model, 'total_points_via_answers'); ?>
Exemple #8
0
            }
        }
    }
    echo CHtml::activeDropDownList($model, 'user_id', $user_list, array('empty' => Yii::t('app', 'choose')));
    ?>
            <?php 
    echo $form->error($model, 'user_id');
    ?>
        </div>

        <div class="row">
            <?php 
    echo $form->labelEx($model, 'disqualified');
    ?>
            <?php 
    echo CustomCHtml::radioButtonSwitch('CompetitionCategorySchoolMentor[disqualified]', $model->disqualified, array(0 => Yii::t('app', 'no'), 1 => Yii::t('app', 'yes')), array('disabled' => $edit_all ? '' : 'disabled'));
    ?>
            <?php 
    echo $form->error($model, 'disqualified');
    ?>
        </div>

        <div class="row">
            <?php 
    echo $form->labelEx($model, 'disqualified_by');
    ?>
            <?php 
    $data = User::model()->with('profile')->findAll(array('condition' => 'profile.user_role>=:user_role', 'params' => array(':user_role' => 10), 'order' => 'profile.last_name ASC, profile.first_name ASC'));
    $user_list = array();
    foreach ($data as $dataUser) {
        $user_list[$dataUser->id] = $dataUser->profile->last_name . ' ' . $dataUser->profile->first_name;