From 33bf52df60696d972fa811e7a6f0b261d3573771 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Tue, 3 Nov 2015 09:50:54 +0100 Subject: [PATCH] add collection --- backend/components/AdminMenuStructure.php | 1 + backend/controllers/CollectionController.php | 110 +++++++++++++++ backend/models/CollectionSearch.php | 73 ++++++++++ backend/views/collection/_form.php | 39 ++++++ backend/views/collection/_search.php | 45 ++++++ backend/views/collection/create.php | 21 +++ backend/views/collection/index.php | 42 ++++++ backend/views/collection/update.php | 23 +++ backend/views/collection/view.php | 44 ++++++ common/models/Collection.php | 104 ++++++++++++++ common/models/CollectionCreate.php | 31 ++++ common/models/Transfer.php | 76 ++++++++++ ...51102_175009_create__table__collection.php | 37 +++++ frontend/components/FrontendMenuStructure.php | 1 + frontend/controllers/CollectionController.php | 132 ++++++++++++++++++ frontend/models/CollectionSearch.php | 72 ++++++++++ frontend/views/collection/_form.php | 31 ++++ frontend/views/collection/_search.php | 55 ++++++++ frontend/views/collection/create.php | 30 ++++ frontend/views/collection/index.php | 39 ++++++ frontend/views/collection/update.php | 23 +++ frontend/views/collection/view.php | 44 ++++++ 22 files changed, 1073 insertions(+) create mode 100644 backend/controllers/CollectionController.php create mode 100644 backend/models/CollectionSearch.php create mode 100644 backend/views/collection/_form.php create mode 100644 backend/views/collection/_search.php create mode 100644 backend/views/collection/create.php create mode 100644 backend/views/collection/index.php create mode 100644 backend/views/collection/update.php create mode 100644 backend/views/collection/view.php create mode 100644 common/models/Collection.php create mode 100644 common/models/CollectionCreate.php create mode 100644 console/migrations/m151102_175009_create__table__collection.php create mode 100644 frontend/controllers/CollectionController.php create mode 100644 frontend/models/CollectionSearch.php create mode 100644 frontend/views/collection/_form.php create mode 100644 frontend/views/collection/_search.php create mode 100644 frontend/views/collection/create.php create mode 100644 frontend/views/collection/index.php create mode 100644 frontend/views/collection/update.php create mode 100644 frontend/views/collection/view.php diff --git a/backend/components/AdminMenuStructure.php b/backend/components/AdminMenuStructure.php index d0bcf7f..06a0c75 100644 --- a/backend/components/AdminMenuStructure.php +++ b/backend/components/AdminMenuStructure.php @@ -53,6 +53,7 @@ class AdminMenuStructure{ $items[] = ['label' => 'Tranzakciók', 'url' => ['/transfer/index' , 'TransferSearch[start]' =>$today,'TransferSearch[end]' => $tomorrow ] ]; $items[] = ['label' => 'Kassza müveletek', 'url' => ['/account-state/index'] ]; + $items[] = ['label' => 'Zárások', 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$today,'CollectionSearch[end]' => $tomorrow ] ]; if ( count($items) > 0 ){ $userMainMenu = ['label' => 'Beállítások', 'url' => null, diff --git a/backend/controllers/CollectionController.php b/backend/controllers/CollectionController.php new file mode 100644 index 0000000..aed7761 --- /dev/null +++ b/backend/controllers/CollectionController.php @@ -0,0 +1,110 @@ +search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single Collection model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new Collection model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new Collection(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id_collection]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing Collection model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id_collection]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing Collection model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the Collection model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return Collection the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = Collection::findOne($id)) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } +} diff --git a/backend/models/CollectionSearch.php b/backend/models/CollectionSearch.php new file mode 100644 index 0000000..e185d52 --- /dev/null +++ b/backend/models/CollectionSearch.php @@ -0,0 +1,73 @@ + $query, + ]); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + $query->andFilterWhere([ + 'id_collection' => $this->id_collection, + 'id_user' => $this->id_user, + 'created_by' => $this->created_by, + 'id_account' => $this->id_account, + 'money' => $this->money, + 'start' => $this->start, + 'end' => $this->end, + 'type' => $this->type, + 'created_at' => $this->created_at, + 'updated_at' => $this->updated_at, + ]); + + return $dataProvider; + } +} diff --git a/backend/views/collection/_form.php b/backend/views/collection/_form.php new file mode 100644 index 0000000..ca618e7 --- /dev/null +++ b/backend/views/collection/_form.php @@ -0,0 +1,39 @@ + + +
+ + + + field($model, 'id_user')->textInput() ?> + + field($model, 'created_by')->textInput() ?> + + field($model, 'id_account')->textInput() ?> + + field($model, 'money')->textInput() ?> + + field($model, 'start')->textInput() ?> + + field($model, 'end')->textInput() ?> + + field($model, 'type')->textInput() ?> + + field($model, 'created_at')->textInput() ?> + + field($model, 'updated_at')->textInput() ?> + +
+ isNewRecord ? Yii::t('backend/collection', 'Create') : Yii::t('backend/collection', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
diff --git a/backend/views/collection/_search.php b/backend/views/collection/_search.php new file mode 100644 index 0000000..e2f80ec --- /dev/null +++ b/backend/views/collection/_search.php @@ -0,0 +1,45 @@ + + + diff --git a/backend/views/collection/create.php b/backend/views/collection/create.php new file mode 100644 index 0000000..fcef1e2 --- /dev/null +++ b/backend/views/collection/create.php @@ -0,0 +1,21 @@ +title = Yii::t('backend/collection', 'Create Collection'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/collection', 'Collections'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/collection/index.php b/backend/views/collection/index.php new file mode 100644 index 0000000..fabcd50 --- /dev/null +++ b/backend/views/collection/index.php @@ -0,0 +1,42 @@ +title = Yii::t('backend/collection', 'Collections'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ render('_search', ['model' => $searchModel]); ?> + +

+ 'btn btn-success']) ?> +

+ + $dataProvider, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'id_collection', + 'id_user', + 'created_by', + 'id_account', + 'money', + // 'start', + // 'end', + // 'type', + // 'created_at', + // 'updated_at', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> + +
diff --git a/backend/views/collection/update.php b/backend/views/collection/update.php new file mode 100644 index 0000000..eee672c --- /dev/null +++ b/backend/views/collection/update.php @@ -0,0 +1,23 @@ +title = Yii::t('backend/collection', 'Update {modelClass}: ', [ + 'modelClass' => 'Collection', +]) . ' ' . $model->id_collection; +$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/collection', 'Collections'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => $model->id_collection, 'url' => ['view', 'id' => $model->id_collection]]; +$this->params['breadcrumbs'][] = Yii::t('backend/collection', 'Update'); +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/collection/view.php b/backend/views/collection/view.php new file mode 100644 index 0000000..b8985f6 --- /dev/null +++ b/backend/views/collection/view.php @@ -0,0 +1,44 @@ +title = $model->id_collection; +$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/collection', 'Collections'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ +

+ $model->id_collection], ['class' => 'btn btn-primary']) ?> + $model->id_collection], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('backend/collection', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ]) ?> +

+ + $model, + 'attributes' => [ + 'id_collection', + 'id_user', + 'created_by', + 'id_account', + 'money', + 'start', + 'end', + 'type', + 'created_at', + 'updated_at', + ], + ]) ?> + +
diff --git a/common/models/Collection.php b/common/models/Collection.php new file mode 100644 index 0000000..5705a95 --- /dev/null +++ b/common/models/Collection.php @@ -0,0 +1,104 @@ + TimestampBehavior::className(), + 'value' => function(){ return date('Y-m-d H:i:s' ); } + ], + [ + 'class' => UserAwareBehavior::className(), + ], + [ + 'class' => AccountAwareBehavior::className(), + ], + ], parent::behaviors()); + } + + /** + * @inheritdoc + */ + public function rules() + { + return [ + [['id_user', 'created_by', 'id_account', 'money', 'type'], 'integer'], + [['money', 'type', 'created_at', 'updated_at'], 'required'], + [['start', 'end', 'created_at', 'updated_at'], 'safe'] + ]; + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'id_collection' => Yii::t('common/collection', 'Id Collection'), + 'id_user' => Yii::t('common/collection', 'Id User'), + 'created_by' => Yii::t('common/collection', 'Created By'), + 'id_account' => Yii::t('common/collection', 'Id Account'), + 'money' => Yii::t('common/collection', 'Money'), + 'start' => Yii::t('common/collection', 'Start'), + 'end' => Yii::t('common/collection', 'End'), + 'type' => Yii::t('common/collection', 'Type'), + 'created_at' => Yii::t('common/collection', 'Created At'), + 'updated_at' => Yii::t('common/collection', 'Updated At'), + ]; + } + + + /** + * @param \common\models\User $user the user + * */ + public static function readLast($user){ + $result = null; + $query = Collection::find(); + if ( isset($user)){ + $query->andWhere($user->id); + } + + $query->orderBy(['end' => SORT_DESC]); + + $query->limit(1); + + $result = $query->one(); + + return $result; + } +} diff --git a/common/models/CollectionCreate.php b/common/models/CollectionCreate.php new file mode 100644 index 0000000..5aaccad --- /dev/null +++ b/common/models/CollectionCreate.php @@ -0,0 +1,31 @@ + + *
  • + *

    created_at

    + *

    Load all transfer which were created

    + *
  • + *
  • + *

    paid_at

    + *

    Load all transfer which were paid

    + *
  • + *
  • + *

    created_at_paid

    + *

    Load all transfer which were created and paid

    + *
  • + *
  • + *

    created_at_not_paid

    + *

    Load all transfer which were created but not paid

    + *
  • + *
  • + *

    paid_at_not_created_at

    + *

    Load all transfer which were not created but paid . Works correctly only, + * when start and end date given + *

    + *
  • + * + * + * */ + public static function mkTotalQuery($mode,$start,$end,$idUser,$types,$idAccount){ + + $query = new Query(); + + $query->addSelect( [ + new Expression( 'transfer.id_account as account'), + new Expression( ' COALESCE(sum( ( case when direction = '.Transfer::DIRECTION_OUT.' then -1 else 1 end )* transfer.money ),0) as money' ) + + ]); + $query->from('transfer'); + + $query->andFilterWhere([ + 'id_account' => $idAccount, + ]); + + $query->andFilterWhere(['id_user' => $idUser]); + + $query->andFilterWhere(['in' ,'type', $types]); + + + if ( $mode == 'created_at'){ + $query->andFilterWhere([ '>=', 'transfer.created_at' , $start] ); + $query->andFilterWhere([ '<' , 'transfer.created_at' , $end ] ); + }else if ( $mode == 'paid_at'){ + $query->andFilterWhere([ '>=', 'transfer.paid_at' , $start ] ); + $query->andFilterWhere([ '<' , 'transfer.paid_at' , $end ] ); + }else if ( $mode == 'created_at_not_paid'){ + $query->andFilterWhere([ "transfer.status" => Transfer::STATUS_NOT_PAID ] ); + $query->andFilterWhere([ '>=', 'transfer.created_at' , $start ] ); + $query->andFilterWhere([ '<' , 'transfer.created_at' , $end ] ); + }else if ( $mode == 'created_at_paid'){ + $query->andFilterWhere([ "transfer.status" => Transfer::STATUS_PAID ] ); + $query->andFilterWhere([ '>=', 'transfer.created_at' , $start ] ); + $query->andFilterWhere([ '<' , 'transfer.created_at' , $end ] ); + }else if ( $mode == 'paid_at_not_created_at'){ + $query->andFilterWhere([ "transfer.status" => Transfer::STATUS_PAID ] ); + $query->andFilterWhere([ '>=', 'transfer.paid_at' , $start ] ); + $query->andFilterWhere([ '<' , 'transfer.paid_at' , $end ] ); + $query->andFilterWhere( ['or', [ '<', 'transfer.created_at' , $start ] ,[ '>=' , 'transfer.created_at' , $end ] ] ); + } + + $query->groupBy('transfer.id_account'); + + return $query; + + + } } diff --git a/console/migrations/m151102_175009_create__table__collection.php b/console/migrations/m151102_175009_create__table__collection.php new file mode 100644 index 0000000..b444244 --- /dev/null +++ b/console/migrations/m151102_175009_create__table__collection.php @@ -0,0 +1,37 @@ +db->driverName === 'mysql') { + // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; + } + + $this->createTable('{{%collection}}', [ + 'id_collection' => $this->primaryKey(), + 'id_user' => $this->integer() , + 'created_by' => $this->integer() , + 'id_account' => $this->integer() , + 'money' => $this->integer()->notNull() , + 'start' => $this->dateTime(), + 'end' => $this->dateTime(), + 'type' => $this->integer(11)->notNull(), + 'created_at' => $this->dateTime()->notNull(), + 'updated_at' => $this->dateTime()->notNull(), + ], $tableOptions); + } + + public function down() + { + echo "m151102_175009_create__table__collection cannot be reverted.\n"; + + return false; + } + +} diff --git a/frontend/components/FrontendMenuStructure.php b/frontend/components/FrontendMenuStructure.php index 85bbe5e..21a79d3 100644 --- a/frontend/components/FrontendMenuStructure.php +++ b/frontend/components/FrontendMenuStructure.php @@ -70,6 +70,7 @@ class FrontendMenuStructure{ ['label' => Yii::t('frontend/account-state','Close account state'), 'url' => ['/account-state/close'] ], ['label' => 'Pénzmozgások', 'url' => [ '/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow ] ], ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow ] ], + ['label' => 'Zárások', 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ] ] ]; diff --git a/frontend/controllers/CollectionController.php b/frontend/controllers/CollectionController.php new file mode 100644 index 0000000..c0b094c --- /dev/null +++ b/frontend/controllers/CollectionController.php @@ -0,0 +1,132 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => ['post'], + ], + ], + ]; + } + + /** + * Lists all Collection models. + * @return mixed + */ + public function actionIndex() + { + $searchModel = new CollectionSearch(); + + $searchModel->accounts = Account::read(); + + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single Collection model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new Collection model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new CollectionCreate(); + + $user = User::findOne(Yii::$app->user->id); + + $model->lastCollection = Collection::readLast($user); + $model->id_user = $user->id; + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id_collection]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing Collection model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->id_collection]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing Collection model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the Collection model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return Collection the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = Collection::findOne($id)) !== null) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } +} diff --git a/frontend/models/CollectionSearch.php b/frontend/models/CollectionSearch.php new file mode 100644 index 0000000..3bcf41d --- /dev/null +++ b/frontend/models/CollectionSearch.php @@ -0,0 +1,72 @@ +Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ], + [[ 'end' , ], 'date' ,'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ], + ]; + } + + /** + * @inheritdoc + */ + public function scenarios() + { + // bypass scenarios() implementation in the parent class + return Model::scenarios(); + } + + /** + * Creates data provider instance with search query applied + * + * @param array $params + * + * @return ActiveDataProvider + */ + public function search($params) + { + $query = Collection::find(); + + $dataProvider = new ActiveDataProvider([ + 'query' => $query, + ]); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + $query->andFilterWhere([ + 'id_account' => $this->id_account, + ]); + + $query->andFilterWhere([ '>=', 'collection.end', $this->timestampStart ] ); + $query->andFilterWhere([ '<', 'collection.end', $this->timestampEnd ] ); + + return $dataProvider; + } +} diff --git a/frontend/views/collection/_form.php b/frontend/views/collection/_form.php new file mode 100644 index 0000000..226cb0a --- /dev/null +++ b/frontend/views/collection/_form.php @@ -0,0 +1,31 @@ + + +
    + + + + + field($model, 'id_account')->textInput() ?> + + field($model, 'money')->textInput() ?> + + field($model, 'start')->textInput() ?> + + field($model, 'end')->textInput() ?> + + +
    + isNewRecord ? Yii::t('frontend/collection', 'Create') : Yii::t('frontend/collection', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
    + + + +
    diff --git a/frontend/views/collection/_search.php b/frontend/views/collection/_search.php new file mode 100644 index 0000000..ef8ea74 --- /dev/null +++ b/frontend/views/collection/_search.php @@ -0,0 +1,55 @@ + +Yii::t('frontend/collection','All')]+ HtmlHelper::mkAccountOptions($model->accounts); + +?> + + diff --git a/frontend/views/collection/create.php b/frontend/views/collection/create.php new file mode 100644 index 0000000..304f3d9 --- /dev/null +++ b/frontend/views/collection/create.php @@ -0,0 +1,30 @@ +title = Yii::t('frontend/collection', 'Create Collection'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
    + +

    title) ?>

    + +
    +
    Utolsó zárás
    +
    asdf
    +
    +
    +
    +
    +
    + + render('_form', [ + 'model' => $model, + ]) ?> + +
    diff --git a/frontend/views/collection/index.php b/frontend/views/collection/index.php new file mode 100644 index 0000000..c8dfd17 --- /dev/null +++ b/frontend/views/collection/index.php @@ -0,0 +1,39 @@ +title = Yii::t('frontend/collection', 'Collections'); +$this->params['breadcrumbs'][] = $this->title; +?> +
    + +

    title) ?>

    + render('_search', ['model' => $searchModel]); ?> + +

    + 'btn btn-success']) ?> +

    + + $dataProvider, + 'columns' => [ + 'id_collection', + 'id_user', + 'id_account', + 'money', + 'start:datetime', + 'end:datetime', + 'created_at:datetime', + + ['class' => 'yii\grid\ActionColumn', + 'template' => '{view}' + ], + ], + ]); ?> + +
    diff --git a/frontend/views/collection/update.php b/frontend/views/collection/update.php new file mode 100644 index 0000000..136c74e --- /dev/null +++ b/frontend/views/collection/update.php @@ -0,0 +1,23 @@ +title = Yii::t('frontend/collection', 'Update {modelClass}: ', [ + 'modelClass' => 'Collection', +]) . ' ' . $model->id_collection; +$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => $model->id_collection, 'url' => ['view', 'id' => $model->id_collection]]; +$this->params['breadcrumbs'][] = Yii::t('frontend/collection', 'Update'); +?> +
    + +

    title) ?>

    + + render('_form', [ + 'model' => $model, + ]) ?> + +
    diff --git a/frontend/views/collection/view.php b/frontend/views/collection/view.php new file mode 100644 index 0000000..5ce6db7 --- /dev/null +++ b/frontend/views/collection/view.php @@ -0,0 +1,44 @@ +title = $model->id_collection; +$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
    + +

    title) ?>

    + +

    + $model->id_collection], ['class' => 'btn btn-primary']) ?> + $model->id_collection], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('frontend/collection', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ]) ?> +

    + + $model, + 'attributes' => [ + 'id_collection', + 'id_user', + 'created_by', + 'id_account', + 'money', + 'start', + 'end', + 'type', + 'created_at', + 'updated_at', + ], + ]) ?> + +