add company

This commit is contained in:
king199025
2018-10-11 17:24:47 +03:00
parent 3e10a51c3a
commit 5e2bc02bb5
21 changed files with 720 additions and 10 deletions

View File

@ -68,7 +68,9 @@ class StatusController extends Controller
$model = new Status();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
Yii::$app->session->addFlash('success', 'Статус добавлен');
return $this->redirect(['index']);
}
return $this->render('create', [
@ -88,7 +90,8 @@ class StatusController extends Controller
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
Yii::$app->session->addFlash('success', 'Статус обновлен');
return $this->redirect(['index']);
}
$model->use = ArrayHelper::getColumn(
\common\models\UseStatus::find()->where(['status_id' => $model->id])->asArray()->all(),

View File

@ -12,11 +12,9 @@ $this->params['breadcrumbs'][] = $this->title;
?>
<div class="status-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->id], [
<?= Html::a('Редактировать', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Удалить', ['delete', 'id' => $model->id], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',