public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Notice::find()]); $noticeDataProviders = array(); $category = ConfigParam::getConfig('category', 'title'); foreach ($category as $key => $value) { $data = new ActiveDataProvider(['totalCount' => 10, 'pagination' => ['pageSize' => 10], 'query' => Notice::find()->where(['category' => $key])->orderBy('publishdate desc')]); $noticeDataProviders[$key] = ['title' => $value, 'dataProvider' => $data]; } return $this->render('index', ['dataProvider' => $dataProvider, 'notice' => $noticeDataProviders]); }
<h1><?php echo Html::encode($this->title); ?> </h1> </div> <ul class="list-inline"> <li>发布者:<?php echo $model->publisher; ?> </li> <li>发布于:<?php echo $model->publishdate; ?> </li> <li>重要级别:<?php echo ConfigParam::getConfig('importance', 'title', $model->importance); ?> </li> <li>结束时间:<?php echo $model->enddate; ?> </li> </ul> <p> <?php echo Html::a('Return', ['index'], ['class' => 'btn btn-success']); ?> <?php echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?>
?> <?php echo $form->field($model, 'idcard')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'level')->dropDownList(ConfigParam::getConfig('level', 'title'), ['class' => 'input-sm col-2']); ?> <?php echo $form->field($model, 'graduation')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'degree')->dropDownList(ConfigParam::getConfig('degree', 'title'), ['class' => 'input-sm']); ?> <?php echo $form->field($model, 'intro')->textarea(['rows' => 6]); ?> <?php //$form->field($model, 'status')->textInput() ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div>
<?php use yii\helpers\Html; use common\config\ConfigParam; echo $this->render('req/purchaseDisplay', ['model' => $model, 'subModel' => $subModel]); ?> <hr> <?php echo Html::beginForm(); ?> <div id="form-group"> <label for="" id="control-label">意见</label> <?php echo Html::textInput('name', null, ['class' => 'input-large']); ?> </div> <div id="form-group"> <label for="" id="control-label">指定办理人</label> <form method="post" name="setHandle"> <?php echo Html::checkBoxList('list', null, ConfigParam::getConfig('duty', 'title')); ?> <?php echo Html::submitButton('submit', ['class' => 'btn btn-primary']); echo Html::a('否决', ['audit', 'id' => $model->id, 'value' => 'undo'], ['class' => 'btn btn-primary']); ?> <form> </div>
$this->title = 'Notices'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="notice-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php //var_export(ConfigParam::getConfig('importance','title')) ?> <p> <?php echo Html::a('Create Notice', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'title', 'publisher', ['attribute' => 'importance', 'value' => function ($model) { return ConfigParam::getConfig('importance', 'title', $model['importance']); }], 'begindate', 'enddate', 'publishdate', ['attribute' => 'category', 'value' => function ($model) { return ConfigParam::getConfig('category', 'title', $model['category']); }], ['class' => 'yii\\grid\\ActionColumn']], 'pager' => ['options' => ['class' => 'pagination center-block']]]); ?> </div>
<?php use yii\helpers\Html; use common\config\ConfigParam; echo $this->render('req/purchaseDisplay', ['model' => $model, 'subModel' => $subModel]); ?> <hr> <?php echo Html::beginForm(); ?> <div id="form-group"> <label for="" id="control-label">意见</label> <?php echo Html::textInput('msg', null, ['class' => 'input-large']); ?> </div> <div id="form-group"> <label for="" id="control-label">指定办理人</label> <?php echo Html::dropdownlist('handle', null, ConfigParam::getConfig('duty', 'title')); ?> <?php echo Html::submitButton('submit', ['class' => 'btn btn-primary']); echo Html::a('否决', ['audit', 'id' => $model->id, 'value' => 'undo'], ['class' => 'btn btn-primary']); ?> </div> <?php echo Html::endForm();
<?php echo $form->field($model, 'category')->dropDownList(ConfigParam::getConfig('category', 'title'), ['class' => 'input-sm']); ?> <?php echo $form->field($model, 'title')->textInput(['maxlength' => true]); ?> <!-- <?php echo $form->field($model, 'publisher')->textInput(['maxlength' => true]); ?> --> <?php echo $form->field($model, 'importance')->dropDownList(ConfigParam::getConfig('importance', 'title'), ['class' => 'input-sm col-2']); ?> <?php echo $form->field($model, 'begindate')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['dafaultDate' => date('yyyy-mm-dd')]]); ?> <?php echo $form->field($model, 'enddate')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd']); ?> <?php echo $form->field($model, 'content')->widget('pjkui\\kindeditor\\KindEditor', ['clientOptions' => ['allowFileManager' => 'true', 'allowUpload' => 'true']]); ?> <!--<?php
/** * [获取下一步可进行的操作,并且验证是否有权限执行该操作] * @return [Array] [返回可进行的操作以及URL] */ public function getHandleOption() { $opr_array = array(); $opr_array[] = ConfigParam::getConfig('operations', null, 'delete'); $opr_array[] = ConfigParam::getConfig('operations', null, 'update'); $opr = $this->processType[$this->mainData->state]; $opr_array[] = ConfigParam::getConfig('operations', null, $opr); return $opr_array; }