<div class="row"> <div class="col-lg-12"> <div class="portlet portlet-default"> <div class="portlet-heading"> <div class="portlet-title"> <h4>比赛列表</h4> </div> <div class="clearfix"></div> </div> <div class="panel-collapse collapse in"> <div class="portlet-body"> <?php $this->widget('GridView', array('dataProvider' => $model->search(true), 'filter' => $model, 'columns' => array(array('header' => '操作', 'type' => 'raw', 'value' => '$data->operationButton'), array('name' => 'date', 'type' => 'raw', 'value' => '$data->getDisplayDate()', 'filter' => false), array('name' => 'type', 'type' => 'raw', 'value' => '$data->getTypeText()', 'filter' => Competition::getTypes()), 'name_zh', array('header' => '运营费', 'type' => 'raw', 'value' => '$data->operationFeeButton', 'sortable' => false, 'filter' => false), array('name' => 'province_id', 'type' => 'raw', 'value' => '$data->getLocationInfo("province")', 'sortable' => false, 'filter' => false), array('name' => 'city_id', 'type' => 'raw', 'value' => '$data->getLocationInfo("city")', 'sortable' => false, 'filter' => false), array('name' => 'venue', 'type' => 'raw', 'value' => '$data->getLocationInfo("venue")', 'sortable' => false, 'filter' => false), array('name' => 'status', 'type' => 'raw', 'value' => '$data->getStatusText()', 'filter' => Competition::getAllStatus())))); ?> </div> </div> </div> </div> </div>
<div class="col-lg-12"> <?php $form = $this->beginWidget('ActiveForm', array('htmlOptions' => array('role' => 'form', 'class' => 'form-inline'), 'method' => 'get', 'action' => array('/competition/index'))); ?> <?php echo Html::formGroup($model, 'year', array(), $form->labelEx($model, 'year'), CHtml::dropDownList('year', $model->year, Competition::getYears(), array('class' => 'form-control', 'prompt' => Yii::t('common', 'All')))); ?> <?php echo Html::formGroup($model, 'type', array(), $form->labelEx($model, 'type'), CHtml::dropDownList('type', $model->type, Competition::getTypes(), array('class' => 'form-control', 'prompt' => Yii::t('common', 'All')))); ?> <?php echo Html::formGroup($model, 'province', array(), $form->labelEx($model, 'province'), CHtml::dropDownList('province', $model->province, Region::getProvinces(false), array('class' => 'form-control', 'prompt' => Yii::t('common', 'All')))); ?> <?php echo Html::formGroup($model, 'event', array(), $form->labelEx($model, 'event'), CHtml::dropDownList('event', $model->event, Events::getNormalTranslatedEvents(), array('class' => 'form-control', 'prompt' => Yii::t('common', 'All')))); ?> <button type="submit" class="btn btn-theme"><?php echo Yii::t('common', 'Submit'); ?> </button> <?php $this->endWidget(); ?> <?php $this->widget('GridView', array('dataProvider' => $model->search(), 'template' => '{summary}{items}{pager}', 'enableSorting' => false, 'front' => true, 'emptyText' => Yii::t('Competition', 'No competitions now.'), 'rowCssClassExpression' => '$data->isInProgress() ? "success" : ($data->isEnded() ? "active" : "info")', 'columns' => array(array('name' => 'date', 'type' => 'raw', 'value' => '$data->getDisplayDate()'), array('name' => 'name', 'type' => 'raw', 'value' => '$data->getCompetitionLink()'), array('name' => 'province_id', 'type' => 'raw', 'value' => '$data->getLocationInfo("province")'), array('name' => 'city_id', 'type' => 'raw', 'value' => '$data->getLocationInfo("city")'), array('name' => 'venue', 'type' => 'raw', 'value' => '$data->getLocationInfo("venue")')))); ?> </div>
private function getCompetitionData($model) { $wcaDelegates = array(); foreach (User::getDelegates(User::IDENTITY_WCA_DELEGATE) as $delegate) { $wcaDelegates[$delegate->id] = $delegate->name_zh ?: $delegate->name; } $ccaDelegates = array(); foreach (User::getDelegates(User::IDENTITY_CCA_DELEGATE) as $delegate) { $ccaDelegates[$delegate->id] = $delegate->name_zh ?: $delegate->name; } $organizers = User::getOrganizers(); $types = Competition::getTypes(); $checkPersons = Competition::getCheckPersons(); $normalEvents = Events::getNormalEvents(); $otherEvents = Events::getOtherEvents(); $cities = Region::getAllCities(); return array('model' => $model, 'normalEvents' => $normalEvents, 'otherEvents' => $otherEvents, 'cities' => $cities, 'wcaDelegates' => $wcaDelegates, 'ccaDelegates' => $ccaDelegates, 'organizers' => $organizers, 'types' => $types, 'checkPersons' => $checkPersons); }