add card.flag implementation
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user