예제 #1
0
 public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
 {
     if ($hasError) {
         $fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
     }
     $htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
     $htmlOptions['type'] = 'number';
     if (!isset($htmlOptions['name'])) {
         $htmlOptions['name'] = $name;
     }
     if (!isset($htmlOptions['value'])) {
         $htmlOptions['value'] = $value;
     }
     $htmlOptions['type'] = 'number';
     if (ClonnableFields::isModel($model)) {
         return CHtml::activeNumberField($model, $attribute, $htmlOptions);
     } else {
         return CHtml::tag('input', $htmlOptions);
     }
 }
예제 #2
0
echo CHtml::error($form, 'altitude');
?>
			</td>
		</tr>

        <tr>
            <th><?php 
echo CHtml::activeLabel($form, 'station_gravity');
?>
</th>
            <td colspan="3">
                <?php 
echo CHtml::activeHiddenField($form, 'station_gravity');
?>
                <?php 
echo CHtml::activeNumberField($form, 'station_gravity', array('style' => 'width: 100px;', 'step' => '0.00001'));
?>
                <?php 
echo CHtml::dropDownList('station_gravity_list', array_key_exists($form->station_gravity, Yii::app()->params['station_gravity']) ? $form->station_gravity : 0, Yii::app()->params['station_gravity'], array('style' => 'width: 170px;'));
?>
                <?php 
echo CHtml::error($form, 'station_gravity');
?>
            </td>
        </tr>

		<tr>
			<th><?php 
echo CHtml::activeLabel($form, 'wmo_originating_centre');
?>
</th>
예제 #3
0
 /**
  * Renders a number field for a model attribute.
  * This method is a wrapper of {@link CHtml::activeNumberField}.
  * Please check {@link CHtml::activeNumberField} for detailed information
  * about the parameters for this method.
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated input field
  * @since 1.1.11
  */
 public function numberField($model, $attribute, $htmlOptions = array())
 {
     return CHtml::activeNumberField($model, $attribute, $htmlOptions);
 }
?>
	<td>	
		<br>
		<?php 
$this->widget('ext.YiiDateTimePicker.jqueryDateTime', array('model' => $model, 'attribute' => '[' . $index . ']order_start_time', 'options' => array('format' => 'Y-m-d H:i:00', 'timepicker' => true, 'minDate' => $today), 'htmlOptions' => array('autocomplete' => "off", 'required' => 1)));
$this->widget('ext.YiiDateTimePicker.jqueryDateTime', array('model' => $model, 'attribute' => '[' . $index . ']order_end_time', 'options' => array('format' => 'Y-m-d H:i:00', 'timepicker' => true, 'minDate' => $today), 'htmlOptions' => array('autocomplete' => "off", 'required' => 1)));
$this->widget('ext.YiiDateTimePicker.jqueryDateTime', array('model' => $model, 'attribute' => '[' . $index . ']order_delivery_time', 'options' => array('format' => 'Y-m-d H:i:00', 'timepicker' => true, 'minDate' => $today), 'htmlOptions' => array('autocomplete' => "off", 'required' => 1)));
?>
	</td>

	<td>
		<?php 
echo CHtml::activeNumberField($model, '[' . $index . ']price_after_discount', array('min' => 0, 'required' => 1));
echo CHtml::activeNumberField($model, '[' . $index . ']discount', array('min' => 0, 'max' => 100, 'required' => 1));
?>
	</td>

	<td>
		<?php 
echo CHtml::activeNumberField($model, '[' . $index . ']initial_quantity', array('min' => 1, 'required' => 1));
?>
	</td>

	<td>
		<?php 
echo CHtml::activeTextField($model, '[' . $index . ']verified_by', array('size' => 10, 'maxlength' => 10, 'readonly' => 1));
echo CHtml::htmlButton('Delete', $htmlOptions = array('class' => 'deletebutton', 'data-rowid' => 'pricetimerow' . $index));
?>
	</td>
</tr>
예제 #5
0
function getMentorColumns($model)
{
    //get or initialize the current column order
    $columnArrayOrder = getColumnArrayOrder();
    //only if make a cache of the columns if needed
    if (isset($_GET['sourceColumn']) && isset($_GET['destinationColumn'])) {
        $source = $_GET['sourceColumn'];
        $destination = $_GET['destinationColumn'];
        $sourceIndex = $source[0];
        $destIndex = $destination[0];
        ReportUtils::moveColumnsByIndex($sourceIndex, $destIndex, $columnArrayOrder);
        Yii::app()->session['MentorColumnOrder'] = $columnArrayOrder;
    }
    $columns = array();
    for ($i = 0; $i < count($columnArrayOrder); $i++) {
        switch ($columnArrayOrder[$i]) {
            case MentorColumns::userID:
                $columns[] = array('name' => 'userID', 'header' => 'Mentor User ID', 'filter' => CHtml::activeNumberField($model, 'userID'), 'headerHtmlOptions' => array('width' => '75'));
                break;
            case MentorColumns::name:
                $columns[] = array('name' => 'name', 'header' => 'Mentor Name', 'filter' => CHtml::activeTextField($model, 'name'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case MentorColumns::email:
                $columns[] = array('name' => 'email', 'header' => 'Mentor Email', 'filter' => CHtml::activeEmailField($model, 'email'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case MentorColumns::userName:
                $columns[] = array('name' => 'userName', 'header' => 'Mentor User Name', 'filter' => CHtml::activeTextField($model, 'userName'), 'headerHtmlOptions' => array('width' => '120'));
                break;
            case MentorColumns::disabled:
                $columns[] = array('name' => 'disabled', 'header' => 'Mentor Disabled', 'value' => 'ReportUtils::getZeroOneToYesNo($data->disabled)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::isProjectMentor:
                $columns[] = array('name' => 'isProjectMentor', 'header' => 'Project Mentor', 'value' => 'ReportUtils::getZeroOneToYesNo($data->isProjectMentor)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::isPersonalMentor:
                $columns[] = array('name' => 'isPersonalMentor', 'header' => 'Personal Mentor', 'value' => 'ReportUtils::getZeroOneToYesNo($data->isPersonalMentor)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::isDomainMentor:
                $columns[] = array('name' => 'isDomainMentor', 'header' => 'Domain Mentor', 'value' => 'ReportUtils::getZeroOneToYesNo($data->isDomainMentor)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::isJudge:
                $columns[] = array('name' => 'isJudge', 'header' => 'Judge', 'value' => 'ReportUtils::getZeroOneToYesNo($data->isJudge)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::isNew:
                $columns[] = array('name' => 'isNew', 'header' => 'Is New', 'value' => 'ReportUtils::getZeroOneToYesNo($data->isNew)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::isEmployer:
                $columns[] = array('name' => 'isEmployer', 'header' => 'Is Employer', 'value' => 'ReportUtils::getZeroOneToYesNo($data->isEmployer)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case MentorColumns::employer:
                $columns[] = array('name' => 'employer', 'header' => 'Mentor Employer', 'filter' => CHtml::activeTextField($model, 'employer'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case MentorColumns::position:
                $columns[] = array('name' => 'position', 'header' => 'Mentor Position', 'filter' => CHtml::activeTextField($model, 'position'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case MentorColumns::fieldOfStudy:
                $columns[] = array('name' => 'fieldOfStudy', 'header' => 'Mentor Field Of Study', 'filter' => CHtml::activeTextField($model, 'fieldOfStudy'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case MentorColumns::degree:
                $columns[] = array('name' => 'degree', 'header' => 'Mentor Degree', 'filter' => CHtml::activeTextField($model, 'degree'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case MentorColumns::gradYear:
                $columns[] = array('name' => 'gradYear', 'header' => 'Mentor Graduation Year', 'filter' => CHtml::activeNumberField($model, 'gradYear'), 'headerHtmlOptions' => array('width' => '200'));
                break;
        }
    }
    return $columns;
}
예제 #6
0
 public function renderInput($attr)
 {
     switch ($attr) {
         case 'senderName':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'email':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'server':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'imapServer':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'port':
             echo CHtml::activeNumberField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'imapPort':
             echo CHtml::activeNumberField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'security':
             echo CHtml::activeDropDownList($this, $attr, array('' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'), $this->htmlOptions($attr));
             break;
         case 'imapSecurity':
             echo CHtml::activeDropDownList($this, $attr, array('' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'), $this->htmlOptions($attr));
             break;
         case 'imapNoValidate':
             echo CHtml::activeCheckBox($this, $attr, $this->htmlOptions($attr));
             break;
         case 'user':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'password':
             echo CHtml::activePasswordField($this, $attr, $this->htmlOptions($attr));
             echo CHtml::label(Yii::t('app', 'Visible?'), 'visible', array('style' => 'display: inline'));
             echo CHtml::checkBox('visible', false, array('id' => 'password-visible', 'onchange' => 'js: x2.credManager.swapPasswordVisibility("#Credentials_auth_password")'));
             break;
     }
 }
예제 #7
0
 public function renderInput($attr)
 {
     switch ($attr) {
         case 'senderName':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'email':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'server':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'imapServer':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'port':
             echo CHtml::activeNumberField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'imapPort':
             echo CHtml::activeNumberField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'security':
             echo CHtml::activeDropDownList($this, $attr, array('' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'), $this->htmlOptions($attr));
             break;
         case 'imapSecurity':
             echo CHtml::activeDropDownList($this, $attr, array('' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'), $this->htmlOptions($attr));
             break;
         case 'imapNoValidate':
             echo CHtml::activeCheckBox($this, $attr, $this->htmlOptions($attr));
             break;
         case 'user':
             echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
             break;
         case 'password':
             echo X2Html::x2ActivePasswordField($this, $attr, $this->htmlOptions($attr), true);
             break;
     }
 }
예제 #8
0
	<?php 
echo CHtml::beginForm();
?>
	<?php 
$updateForm = $this->beginWidget('CActiveForm');
?>
		<div class="row">
			<?php 
echo CHtml::activeLabel($model, 'Type');
?>
			<?php 
echo CHtml::activeDropDownList($model, 'type', array('0' => 'Indoor', '1' => 'Outdoor', '2' => 'Business'));
?>
		</div>
		<div class="row">
			<?php 
echo CHtml::activeLabel($model, 'Number of seats');
?>
			<?php 
echo CHtml::activeNumberField($model, 'number_of_seats');
?>
		</div>
		<div class="row">
			<?php 
echo CHtml::submitButton('Update');
?>
		</div>
	<?php 
$this->endWidget();
?>
</div>
예제 #9
0
    public function run()
    {
        $htmlOptions = $this->htmlOptions;
        $tableOptions = $this->tableOptions;
        $model = $this->model;
        $name = $this->name;
        if (!isset($htmlOptions['class'])) {
            $htmlOptions['class'] = 'table-responsive';
        } else {
            $htmlOptions['class'] .= ' table-responsive';
        }
        $htmlOptions['id'] = 'schedules';
        if (!isset($tableOptions['class'])) {
            $tableOptions['class'] = 'table table-condensed';
        } else {
            $tableOptions['class'] .= ' table table-condensed';
        }
        echo CHtml::openTag('div', $htmlOptions);
        echo CHtml::openTag('table', $tableOptions);
        echo CHtml::openTag('thead');
        echo CHtml::openTag('tr');
        echo CHtml::tag('th', array(), '第几天');
        echo CHtml::tag('th', array(), '赛区');
        echo CHtml::tag('th', array(), '开始时间');
        echo CHtml::tag('th', array(), '结束时间');
        echo CHtml::tag('th', array(), '项目');
        echo CHtml::tag('th', array(), '分组');
        echo CHtml::tag('th', array(), '轮次');
        echo CHtml::tag('th', array(), '赛制');
        echo CHtml::tag('th', array(), '及格线(秒)');
        echo CHtml::tag('th', array(), '还原时限(秒)');
        echo CHtml::tag('th', array(), '人数');
        echo CHtml::closeTag('tr');
        echo CHtml::closeTag('thead');
        $schedules = $model->{$name};
        $schedules[] = Schedule::model()->attributes;
        $events = Events::getScheduleEvents();
        foreach ($events as $key => $value) {
            $events[$key] = Yii::t('event', $value);
        }
        $formats = Formats::getAllFormats();
        foreach ($formats as $key => $value) {
            $formats[$key] = Yii::t('common', $value);
        }
        $rounds = Rounds::getAllRounds();
        foreach ($rounds as $key => $value) {
            $rounds[$key] = Yii::t('Rounds', $value);
        }
        $stages = Schedule::getStages();
        echo CHtml::openTag('tbody');
        foreach ($schedules as $key => $value) {
            extract($value);
            echo CHtml::openTag('tr');
            echo CHtml::tag('td', array(), CHtml::activeNumberField($model, "{$name}[day][]", array('value' => $day ?: 1, 'min' => 1, 'max' => 4)));
            echo CHtml::tag('td', array(), CHtml::dropDownList(CHtml::activeName($model, "{$name}[stage][]"), $stage, $stages));
            echo CHtml::tag('td', array(), CHtml::activeTextField($model, "{$name}[start_time][]", array('value' => $start_time ? date('H:i', $start_time) : '', 'class' => 'datetime-picker', 'data-date-format' => 'hh:ii', 'data-max-view' => '1', 'data-start-view' => '1')));
            echo CHtml::tag('td', array(), CHtml::activeTextField($model, "{$name}[end_time][]", array('value' => $end_time ? date('H:i', $end_time) : '', 'class' => 'datetime-picker', 'data-date-format' => 'hh:ii', 'data-max-view' => '1', 'data-start-view' => '1')));
            echo CHtml::tag('td', array(), CHtml::dropDownList(CHtml::activeName($model, "{$name}[event][]"), $event, $events, array('prompt' => '')));
            echo CHtml::tag('td', array(), CHtml::activeTextField($model, "{$name}[group][]", array('value' => $group)));
            echo CHtml::tag('td', array(), CHtml::dropDownList(CHtml::activeName($model, "{$name}[round][]"), $round, $rounds, array('prompt' => '')));
            echo CHtml::tag('td', array(), CHtml::dropDownList(CHtml::activeName($model, "{$name}[format][]"), $format, $formats, array('prompt' => '')));
            echo CHtml::tag('td', array(), CHtml::activeNumberField($model, "{$name}[cut_off][]", array('value' => $cut_off, 'max' => 3600)));
            echo CHtml::tag('td', array(), CHtml::activeNumberField($model, "{$name}[time_limit][]", array('value' => $time_limit, 'max' => 3600)));
            echo CHtml::tag('td', array(), CHtml::activeNumberField($model, "{$name}[number][]", array('value' => $number)));
            echo CHtml::closeTag('tr');
        }
        echo CHtml::closeTag('tbody');
        echo CHtml::closeTag('table');
        echo CHtml::closeTag('div');
        Yii::app()->clientScript->registerScript('SchedulesForm', <<<EOT
  \$(document).on('focus', '#schedules table tbody tr:last-child', function() {
    \$(this).clone().insertAfter(this);
    \$('.datetime-picker').datetimepicker({
      autoclose: true
    });
  });
EOT
);
    }
예제 #10
0
function getMenteColumns($model)
{
    //get or initialize the current column order
    $columnArrayOrder = getColumnArrayOrder();
    //only if make a cache of the columns if needed
    if (isset($_GET['sourceColumn']) && isset($_GET['destinationColumn'])) {
        $source = $_GET['sourceColumn'];
        $destination = $_GET['destinationColumn'];
        $sourceIndex = $source[0];
        $destIndex = $destination[0];
        ReportUtils::moveColumnsByIndex($sourceIndex, $destIndex, $columnArrayOrder);
        Yii::app()->session['MenteeColumnOrder'] = $columnArrayOrder;
    }
    //Now render the columns
    $columns = array();
    for ($i = 0; $i < count($columnArrayOrder); $i++) {
        switch ($columnArrayOrder[$i]) {
            case MenteeColumns::userId:
                $menteeUserID = array('name' => 'UserID', 'header' => 'Mentee User ID', 'filter' => CHtml::activeNumberField($model, 'UserID'), 'headerHtmlOptions' => array('width' => '75'));
                $columns[] = $menteeUserID;
                break;
            case MenteeColumns::menteeName:
                $menteeName = array('name' => 'Name', 'header' => 'Mentee Name', 'filter' => CHtml::activeTextField($model, 'Name'), 'headerHtmlOptions' => array('width' => '200'));
                $columns[] = $menteeName;
                break;
            case MenteeColumns::menteeEmail:
                $menteeEmail = array('name' => 'Email', 'header' => 'Mentee Email', 'filter' => CHtml::activeEmailField($model, 'Email'), 'headerHtmlOptions' => array('width' => '150'));
                $columns[] = $menteeEmail;
                break;
            case MenteeColumns::menteeUserName:
                $menteeUserName = array('name' => 'UserName', 'header' => 'Mentee User Name', 'filter' => CHtml::activeTextField($model, 'UserName'), 'headerHtmlOptions' => array('width' => '100'));
                $columns[] = $menteeUserName;
                break;
            case MenteeColumns::menteeDisabled:
                $menteeDisabled = array('name' => 'Disabled', 'header' => 'Mentee Disabled', 'value' => 'ReportUtils::getZeroOneToYesNo($data->Disabled)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '100'));
                $columns[] = $menteeDisabled;
                break;
            case MenteeColumns::menteeUniversityName:
                $universityName = array('name' => 'UniversityName', 'header' => 'Mentee University', 'filter' => CHtml::activeDropDownList($model, 'UniversityID', CHtml::listData(University::model()->findAll(), 'id', 'name'), array('empty' => ' ')), 'headerHtmlOptions' => array('width' => '220'));
                $columns[] = $universityName;
                break;
            case MenteeColumns::menteePersonalMentorID:
                $PersonalMentorID = array('name' => 'PersonalMentorID', 'header' => 'Personal Mentor (ID)', 'filter' => CHtml::activeNumberField($model, 'PersonalMentorID'), 'headerHtmlOptions' => array('width' => '100'));
                $columns[] = $PersonalMentorID;
                break;
            case MenteeColumns::menteePersonalMentorName:
                $PersonalMentorName = array('name' => 'PersonalMentorName', 'header' => 'Personal Mentor (Name)', 'filter' => CHtml::activeTextField($model, 'PersonalMentorName'), 'headerHtmlOptions' => array('width' => '150'));
                $columns[] = $PersonalMentorName;
                break;
            case MenteeColumns::menteePersonalMentorEmail:
                $PersonalMentorEmail = array('name' => 'PersonalMentorEmail', 'header' => 'Personal Mentor (Email)', 'filter' => CHtml::activeEmailField($model, 'PersonalMentorEmail'), 'headerHtmlOptions' => array('width' => '150'));
                $columns[] = $PersonalMentorEmail;
                break;
            case MenteeColumns::menteePersonalMentorDisabled:
                $PersonalMentorDisabled = array('name' => 'PersonalMentorDisabled', 'header' => 'Personal Mentor (Disabled)', 'value' => 'ReportUtils::getZeroOneToYesNo($data->PersonalMentorDisabled)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '150'));
                $columns[] = $PersonalMentorDisabled;
                break;
            case MenteeColumns::menteeProjectTitle:
                $menteeProjectTitle = array('name' => 'menteeProjectTitle', 'header' => 'Project Title', 'filter' => CHtml::activeDropDownList($model, 'menteeProjectID', CHtml::listData(Project::model()->findAll(), 'id', 'title'), array('empty' => ' ')), 'headerHtmlOptions' => array('width' => '300'));
                $columns[] = $menteeProjectTitle;
                break;
            case MenteeColumns::menteeProjectStartDate:
                $menteeProjectTitle = array('name' => 'menteeProjectStartDate', 'header' => 'Project Start Date', 'value' => 'ReportUtils::dateformat($data->menteeProjectStartDate)', 'filter' => CHtml::activeDateField($model, 'menteeProjectStartDate'), 'headerHtmlOptions' => array('width' => '160'));
                $columns[] = $menteeProjectTitle;
                break;
            case MenteeColumns::menteeProjectDueDate:
                $menteeProjectDueDate = array('name' => 'menteeProjectDueDate', 'header' => 'Project Due Date', 'value' => 'ReportUtils::dateformat($data->menteeProjectDueDate)', 'filter' => CHtml::activeDateField($model, 'menteeProjectDueDate'), 'headerHtmlOptions' => array('width' => '160'));
                $columns[] = $menteeProjectDueDate;
                break;
            case MenteeColumns::menteeProjectCustomerName:
                $menteeProjectCustomerName = array('name' => 'menteeProjectCustomerName', 'header' => 'Project Customer', 'filter' => CHtml::activeTextField($model, 'menteeProjectCustomerName'), 'headerHtmlOptions' => array('width' => '150'));
                $columns[] = $menteeProjectCustomerName;
                break;
        }
    }
    return $columns;
}
예제 #11
0
 public function run()
 {
     $events = $this->events;
     foreach ($events as $key => $value) {
         $events[$key] = Yii::t('event', $value);
     }
     $model = $this->model;
     $name = $this->name;
     $type = $this->type;
     $competition = $this->competition;
     $htmlOptions = $this->htmlOptions;
     $labelOptions = $this->labelOptions;
     $numberOptions = $this->numberOptions;
     $feeOptions = $this->feeOptions;
     if ($this->type == 'checkbox') {
         echo CHtml::openTag('div', $htmlOptions);
         foreach ($events as $event => $value) {
             echo CHtml::openTag('div', array('class' => 'checkbox checkbox-inline'));
             echo CHtml::openTag('label', array('class' => 'event-icon event-icon-' . $event));
             $text = $value;
             $fee = 0;
             $originFee = $competition->events[$event]['fee'];
             if ($competition instanceof Competition && isset($competition->events[$event]) && $originFee > 0) {
                 $fee = $competition->secondStageFee($originFee, $competition->second_stage_date <= time() && $competition->second_stage_all);
                 $text .= Html::fontAwesome('rmb', 'b') . $fee;
             }
             echo CHtml::checkBox(CHtml::activeName($model, $name . '[]'), in_array("{$event}", $model->{$name}), array('id' => 'Registration_events_' . $event, 'class' => 'registration-events', 'value' => $event, 'data-fee' => $fee, 'data-origin-fee' => $originFee));
             echo $text;
             echo CHtml::closeTag('label');
             echo CHtml::closeTag('div');
             echo '<br>';
         }
         echo CHtml::closeTag('div');
         if ($model->competition->isMultiLocation()) {
             echo CHtml::closeTag('div');
             $locations = array();
             foreach ($model->competition->location as $location) {
                 $locations[$location->location_id] = $location->getFullAddress(false);
             }
             echo CHtml::activeLabelEx($model, 'location_id');
             echo CHtml::activeDropDownList($model, 'location_id', $locations, array('class' => 'form-control', 'prompt' => ''));
             echo CHtml::error($model, 'location_id', array('class' => 'text-danger'));
             echo CHtml::openTag('div', array('class' => 'form-group'));
         }
     } else {
         if (!isset($htmlOptions['class'])) {
             $htmlOptions['class'] = 'row';
         } else {
             $htmlOptions['class'] .= ' row';
         }
         if (!isset($numberOptions['class'])) {
             $numberOptions['class'] = 'form-control';
         } else {
             $numberOptions['class'] .= ' form-control';
         }
         if (!isset($feeOptions['class'])) {
             $feeOptions['class'] = 'form-control';
         } else {
             $feeOptions['class'] .= ' form-control';
         }
         if (!isset($labelOptions['class'])) {
             $labelOptions['class'] = 'text-right col-lg-2 col-xs-3';
         } else {
             $labelOptions['class'] .= ' text-right col-lg-2 col-xs-3';
         }
         echo CHtml::openTag('div', $htmlOptions);
         foreach ($events as $key => $value) {
             echo CHtml::openTag('div', array('class' => 'col-lg-6'));
             echo CHtml::openTag('div', array('class' => 'row'));
             //label
             $labelOptions['label'] = $value . ': ';
             echo CHtml::activeLabelEx($model, "{$name}[{$key}][round]", $labelOptions);
             //round
             echo CHtml::openTag('div', array('class' => 'col-lg-5 col-xs-4'));
             echo CHtml::openTag('div', array('class' => 'input-group'));
             echo CHtml::activeNumberField($model, "{$name}[{$key}][round]", $numberOptions);
             echo CHtml::tag('span', array('class' => 'input-group-addon'), Yii::t('common', 'Rounds'));
             echo CHtml::closeTag('div');
             echo CHtml::closeTag('div');
             //fee
             if ($this->fee === true) {
                 echo CHtml::openTag('div', array('class' => 'col-lg-5 col-xs-4'));
                 echo CHtml::openTag('div', array('class' => 'input-group'));
                 echo CHtml::activeNumberField($model, "{$name}[{$key}][fee]", $feeOptions);
                 echo CHtml::tag('span', array('class' => 'input-group-addon'), Yii::t('common', 'CNY'));
                 echo CHtml::closeTag('div');
                 echo CHtml::closeTag('div');
             }
             echo CHtml::closeTag('div');
             echo CHtml::closeTag('div');
         }
         echo CHtml::closeTag('div');
     }
 }
예제 #12
0
파일: create.php 프로젝트: Allgood07/diplom
<?php 
echo CHtml::beginForm('', 'post', array('style' => 'width: 560px;margin: 0 auto;'));
echo CHtml::errorSummary($model);
?>

    <div class="form-group">
        <label for="exampleInputEmail1">Тип</label>
        <?php 
echo CHtml::activeDropDownList($model, 'type', FinanceCommit::getTypes(), array('class' => 'form-control'));
?>
    </div>
    <div class="form-group">
        <label for="exampleInputEmail1">Сумма</label>
        <?php 
echo CHtml::activeNumberField($model, 'value', array('class' => 'form-control'));
?>
    </div>
    <div class="form-group">
        <label for="exampleInputEmail1">Описание</label>
        <?php 
echo CHtml::activeTextArea($model, 'description', array('class' => 'form-control'));
?>
    </div>

<?php 
echo CHtml::submitButton('Сохранить', array('class' => 'btn btn-default'));
?>

<?php 
echo CHtml::endForm();
예제 #13
0
?>
            </br> <h3>Категория товара</h3></br>
            <?php 
echo CHtml::activeDropDownList($form, 'kindparent', $kindparent);
?>
            </br></br><h3>Вид</h3>
            <?php 
echo CHtml::activeDropDownList($form, 'inkind', $inkind);
?>
            </br></br><h3>Цена (у.е.)</h3>
            <p>min:<?php 
echo CHtml::activeNumberField($form, 'min');
?>
</p>
            <p>max:<?php 
echo CHtml::activeNumberField($form, 'max');
?>
</p>
            </br><h3>Производитель</h3>
          <?php 
echo CHtml::activeCheckBoxList($form, 'producer', $producer);
?>
</p>

            <?php 
echo CHtml::SubmitButton('Поиск');
?>

        </div>
        <?php 
echo CHtml::endForm();
예제 #14
0
    </tr>
    <?php 
echo Helper::printEachMachine($a_outPut, $session->machines);
?>
</table>

<table class='simulation_form'>
    <tr>
        <td>
            <?php 
echo Yii::t('model', 'experiments');
?>
        </td>
        <td>
            <?php 
echo CHtml::activeNumberField($model, 'experiments');
?>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <?php 
echo CHtml::submitButton(Yii::t('ingeneral', 'simulate'), array('class' => 'btn'));
?>
        </td>
    </tr>
</table>
<?php 
if ($result == null) {
    ?>
    <h2><?php 
예제 #15
0
function getTicketColumns($model)
{
    //get or initialize the current column order
    $columnArrayOrder = getColumnArrayOrder();
    //only if make a cache of the columns if needed
    if (isset($_GET['sourceColumn']) && isset($_GET['destinationColumn'])) {
        $source = $_GET['sourceColumn'];
        $destination = $_GET['destinationColumn'];
        $sourceIndex = $source[0];
        $destIndex = $destination[0];
        ReportUtils::moveColumnsByIndex($sourceIndex, $destIndex, $columnArrayOrder);
        Yii::app()->session['TicketColumnOrder'] = $columnArrayOrder;
    }
    $columns = array();
    for ($i = 0; $i < count($columnArrayOrder); $i++) {
        switch ($columnArrayOrder[$i]) {
            case TicketReportColumns::ticketID:
                $columns[] = array('name' => 'ticketID', 'header' => 'Ticket #', 'filter' => CHtml::activeNumberField($model, 'ticketID'), 'headerHtmlOptions' => array('width' => '75'));
                break;
            case TicketReportColumns::creatorName:
                $columns[] = array('name' => 'creatorName', 'header' => 'Creator Name', 'filter' => CHtml::activeTextField($model, 'creatorName'), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case TicketReportColumns::creatorID:
                $columns[] = array('name' => 'creatorID', 'header' => 'Creator ID', 'filter' => CHtml::activeNumberField($model, 'creatorID'), 'headerHtmlOptions' => array('width' => '75'));
                break;
            case TicketReportColumns::creatorDisabled:
                $columns[] = array('name' => 'creatorDisabled', 'header' => 'Creator Disabled', 'value' => 'ReportUtils::getZeroOneToYesNo($data->creatorDisabled)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case TicketReportColumns::creatorEmail:
                $columns[] = array('name' => 'creatorEmail', 'header' => 'Creator Email', 'filter' => CHtml::activeEmailField($model, 'creatorEmail'), 'headerHtmlOptions' => array('width' => '150'));
                break;
            case TicketReportColumns::ticketStatus:
                $columns[] = array('name' => 'ticketStatus', 'header' => 'Ticket Status', 'filter' => array('Close' => 'Close', 'Pending' => 'Pending'), 'headerHtmlOptions' => array('width' => '105'));
                break;
            case TicketReportColumns::ticketCreatedDate:
                $columns[] = array('name' => 'ticketCreatedDate', 'header' => 'Created Date', 'value' => 'ReportUtils::dateformat($data->ticketCreatedDate)', 'filter' => CHtml::activeDateField($model, 'ticketCreatedDate'), 'headerHtmlOptions' => array('width' => '160'));
                break;
            case TicketReportColumns::assignedUserName:
                $columns[] = array('name' => 'assignedUserName', 'header' => 'Assigned To (Name)', 'filter' => CHtml::activeTextField($model, 'assignedUserName'), 'headerHtmlOptions' => array('width' => '150'));
                break;
            case TicketReportColumns::ticketAssignUserID:
                $columns[] = array('name' => 'ticketAssignUserID', 'header' => 'Assigned To (Id)', 'filter' => CHtml::activeNumberField($model, 'ticketAssignUserID'), 'headerHtmlOptions' => array('width' => '100'));
                break;
            case TicketReportColumns::assignedUserDisabled:
                $columns[] = array('name' => 'assignedUserDisabled', 'header' => 'Assigned To (Disabled)', 'value' => 'ReportUtils::getZeroOneToYesNo($data->assignedUserDisabled)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '100'));
                break;
            case TicketReportColumns::assignedUserEmail:
                $columns[] = array('name' => 'assignedUserEmail', 'header' => 'Assigned To (Email)', 'filter' => CHtml::activeEmailField($model, 'assignedUserEmail'), 'headerHtmlOptions' => array('width' => '150'));
                break;
            case TicketReportColumns::ticketDomainName:
                $columns[] = array('name' => 'ticketDomainName', 'header' => 'Ticket Domain', 'filter' => CHtml::activeDropDownList($model, 'ticketDomainID', CHtml::listData(Domain::model()->findAll(), 'id', 'name'), array('empty' => ' ')), 'headerHtmlOptions' => array('width' => '200'));
                break;
            case TicketReportColumns::ticketSubDomainName:
                $columns[] = array('name' => 'ticketSubDomainName', 'header' => 'Ticket Sub Domain', 'filter' => CHtml::activeDropDownList($model, 'ticketSubDomainID', CHtml::listData(Subdomain::model()->findAll(), 'id', 'name'), array('empty' => ' ')), 'headerHtmlOptions' => array('width' => '170'));
                break;
            case TicketReportColumns::ticketPriorityDescription:
                $columns[] = array('name' => 'ticketPriorityDescription', 'header' => 'Ticket Priority', 'filter' => CHtml::activeDropDownList($model, 'ticketPriorityID', CHtml::listData(Priority::model()->findAll(), 'id', 'description'), array('empty' => ' ')), 'headerHtmlOptions' => array('width' => '110'));
                break;
            case TicketReportColumns::ticketAssignedDate:
                $columns[] = array('name' => 'ticketAssignedDate', 'header' => 'Ticket Assigned Date', 'value' => 'ReportUtils::dateformat($data->ticketAssignedDate)', 'filter' => CHtml::activeDateField($model, 'ticketAssignedDate'), 'headerHtmlOptions' => array('width' => '160'));
                break;
            case TicketReportColumns::ticketClosedDate:
                $columns[] = array('name' => 'ticketClosedDate', 'header' => 'Ticket Closed Date', 'value' => 'ReportUtils::dateformat($data->ticketClosedDate)', 'filter' => CHtml::activeDateField($model, 'ticketClosedDate'), 'headerHtmlOptions' => array('width' => '160'));
                break;
            case TicketReportColumns::ticketIsEscalated:
                $columns[] = array('name' => 'ticketIsEscalated', 'header' => 'Escalated', 'value' => 'ReportUtils::getZeroOneToYesNo($data->ticketIsEscalated)', 'filter' => array('1' => 'Yes', '0' => 'No'), 'headerHtmlOptions' => array('width' => '80'));
                break;
            case TicketReportColumns::ticketSubject:
                $columns[] = array('name' => 'ticketSubject', 'header' => 'Subject', 'filter' => CHtml::activeTextField($model, 'ticketSubject'), 'headerHtmlOptions' => array('width' => '300'));
                break;
            case TicketReportColumns::ticketDescription:
                $columns[] = array('name' => 'ticketDescription', 'header' => 'Description', 'filter' => CHtml::activeTextField($model, 'ticketDescription'), 'headerHtmlOptions' => array('width' => '400'));
                break;
        }
    }
    return $columns;
}