Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
users fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jambtc committed Apr 7, 2020
1 parent 4b2d54d commit f50cfa3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions protected/controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ public function actionView($id)
));
}

public function actionDisable($id)
{
$user = $this->loadModel(crypt::Decrypt($id));
$user->status_activation_code = 0;
$user->update();
$this->redirect(array('index'));
}

/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
Expand Down
20 changes: 10 additions & 10 deletions protected/views/users/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ function type($type){
<div class="table-responsive table--no-card m-t-40">
<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'soci-grid',
'htmlOptions' => array('class' => 'table table-wallet '),
'dataProvider'=>$dataProvider,
'id'=>'users-grid',
'enablePagination' => true,
'id'=>'soci-grid',
'htmlOptions' => array('class' => 'table table-wallet '),
'dataProvider'=>$dataProvider,
'id'=>'users-grid',
'enablePagination' => true,
'columns' => array(

array(
'type'=> 'raw',
'name'=>'name',
'header'=>'Nome',
'value' => 'CHtml::link(CHtml::encode(strtoupper(Users::model()->findByPk($data->id_user)->surname).chr(32).Users::model()->findByPk($data->id_user)->name), Yii::app()->createUrl("users/view")."&id=".CHtml::encode(crypt::Encrypt($data->id_user)))',
'filter' => CHtml::listData(Users::model()->findAll(array('order'=>'surname ASC, name ASC')), 'surname', function($items) {
return $items->surname.' '.$items->name;
})
'value' => '($data->status_activation_code == 0) ? strtoupper(Users::model()->findByPk($data->id_user)->surname).chr(32).Users::model()->findByPk($data->id_user)->name : CHtml::link(CHtml::encode(strtoupper(Users::model()->findByPk($data->id_user)->surname).chr(32).Users::model()->findByPk($data->id_user)->name), Yii::app()->createUrl("users/view")."&id=".CHtml::encode(crypt::Encrypt($data->id_user)))',
'filter' => CHtml::listData(Users::model()->findAll(array('order'=>'surname ASC, name ASC')), 'surname', function($items) {
return $items->surname.' '.$items->name;
})
),
array(
'name'=>'email',
'type'=>'raw',
'value' => 'CHtml::link(CHtml::encode($data->email), Yii::app()->createUrl("users/view")."&id=".CHtml::encode(crypt::Encrypt($data->id_user)))',
'value' => '($data->status_activation_code == 0) ? CHtml::encode($data->email) : CHtml::link(CHtml::encode($data->email), Yii::app()->createUrl("users/view")."&id=".CHtml::encode(crypt::Encrypt($data->id_user)))',
),


Expand Down

0 comments on commit f50cfa3

Please sign in to comment.