add card.flag implementation

This commit is contained in:
2016-03-09 20:16:19 +01:00
parent 1d3c476476
commit 42c326f407
25 changed files with 497 additions and 80 deletions

View File

@@ -13,6 +13,7 @@ use backend\models\CardImportRfidForm;
use yii\web\UploadedFile;
use common\components\Helper;
use backend\models\CardInsertForm;
use common\models\Ticket;
/**
* CardController implements the CRUD actions for Card model.
@@ -32,7 +33,8 @@ class CardController extends \backend\controllers\BackendController {
'update',
'list' ,
'import-rfid',
'insert'
'insert',
'recalculate',
],
'allow' => true,
'roles' => [
@@ -349,4 +351,21 @@ class CardController extends \backend\controllers\BackendController {
}
public function actionRecalculate(){
if (Yii::$app->request->isPost) {
$connection = \Yii::$app->db;
$command = $connection->createCommand( Ticket::$SQL_UPDATE );
$result = $command->execute();
\Yii::info("Tickets updated: " . $result );
\Yii::$app->session->setFlash('success', 'Módosított bérletek száma: ' . $result);
}
return $this->render("recalculate");
}
}