add log table

This commit is contained in:
2016-03-17 07:34:11 +01:00
parent 3aa90ec98e
commit 16d25abd7c
9 changed files with 236 additions and 11 deletions

View File

@@ -16,6 +16,7 @@ use frontend\models\CustomerCreate;
use common\models\Image;
use frontend\models\ContractForm;
use yii\base\Exception;
use common\models\Log;
/**
* CustomerController implements the CRUD actions for Customer model.
@@ -127,6 +128,13 @@ class CustomerController extends Controller
if ($model->load(Yii::$app->request->post()) && $model->save()) {
$this->saveBinaryImage($model);
\Yii::$app->session->setFlash( 'success','Vendég létrehozva!' );
Log::log([
'type' =>Log::$TYPE_CREATE_CUSTOMER,
'message' => 'Új vendég:' .$model->name,
'id_customer' => $model->id_customer
]);
return $this->redirect(['update', 'number' => $model->cardNumber]);
} else {
return $this->render('create', [