public function actionGetRank() { $rankLista = array(); $rankUser = array(); $Criteria = new CDbCriteria(); $Criteria->order = "id"; $modelAposta = User::model()->findAll($Criteria); $total = 0; $id_user = 0; foreach ($modelAposta as $item) { $rankUser = array("acertos" => RankController::GetAcertos($item->id), "nome" => $item->username, "pontos" => RankController::actionGetTotal($item->id), "resultados" => RankController::GetResultados($item->id)); array_push($rankLista, $rankUser); } $rankLista = RankController::ordenarRank($rankLista, 'pontos', 'acertos'); $this->render('GetRank', array('dataProvider' => $rankLista)); }
$id_user = Yii::app()->user->getId(); $model2 = User::model()->findByPk($id_user); echo $model2->username; ?> <i class="fa fa-circle text-white pull-right text-xs m-t-sm"></i></div> <small class="text-muted"></small> </div> </div> </header> <div class="list-group no-radius alt"> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view')); ?> </div> <div class="list-group no-radius alt"><a class="list-group-item" href="#"> <span class="badge bg-success"><?php echo RankController::actionGetTotal($id_user); ?> </span> <i class="fa fa-tachometer"></i> Total </a> </div> </section> </div> <div class="col-sm-6"> <section class="panel panel-default"> <div class="text-center wrapper bg-light lt"> <div class="sparkline inline" data-type="pie" data-height="165" data-slice-colors="['#77c587','#41586e','#f2f2f2']"><?php echo RankController::GetAcertos($id_user);