| Current Path : /var/www/html/digitalnahrimv2/backend/views/alert/ |
| Current File : /var/www/html/digitalnahrimv2/backend/views/alert/index.php |
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\models\AlertSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = yii::t('app', 'Makluman');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="alert-index">
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Senarai Makluman </h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#">Config option 1</a>
</li>
<li><a href="#">Config option 2</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?= Html::beginForm(['alert/deletecheck'], 'post'); ?>
<p align="left">
<?= Html::submitButton('<i class="fa fa-trash"></i> Hapus', ['name' => 'submitbutton', 'onClick' => 'return doDelete()', 'value' => 'deletebtn', 'class' => 'btn btn-danger']); ?>
<?= Html::submitButton('<i class="fa fa-check"></i> Selesai', ['name' => 'submitbutton', 'value' => 'readbtn', 'class' => 'btn btn-primary']); ?>
</p>
<?=
GridView::widget([
'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
'columns' => [
[
'class' => 'yii\grid\CheckboxColumn',
'contentOptions' => ['style' => 'width: 30px; text-align:center'],
'header' => Html::checkBox('selection_all', false, [
'class' => 'select-on-check-all',
]),
],
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'message',
'format' => 'raw',
'value' => function($model) {
return $model->message;
}
],
[
'attribute' => 'alert_from',
'format' => 'raw',
'value' => function($model) {
if (!empty($model->fromstaff->staff_name)) {
return $model->fromstaff->staff_name;
}
}
],
[ 'attribute' => 'alert_date', 'format' => 'raw', 'value' => function ($model) {
return date("d-m-Y H:m:s", strtotime($model->alert_date));
},],
['class' => 'yii\grid\ActionColumn',
'template' => '{new}{done}{delete}',
'header' => 'Action',
'buttons' => [
'new' => function ($url, $model) {
return $model->status == 'N' ? Html::a('<span class="fa fa-spinner fa-spin"></span>', "index.php?r=alert/updatestatus&id=" . $model->id, [
'title' => Yii::t('app', 'New'),]) : '';
},
'done' => function ($url, $model) {
return $model->status == 'O' ? Html::a('<span class="glyphicon glyphicon-check"></span>', "#", [
'title' => Yii::t('app', 'Done'),]) : '';
},
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [
'title' => Yii::t('app', 'Delete'), '<span class="glyphicon glyphicon-search"></span>',
'onClick' => 'return doDelete()',
'data-method' => 'post'
]);
},
]],
],
]);
?>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$("input[name='selection_all']").change(function () {
if ($(this).is(':checked')) {
$("input[type=checkbox]").each(function () {
//alert("set checked");
$(this).prop('checked', "checked");
});
} else {
$("input[type=checkbox]").each(function () {
$(this).prop('checked', false);
});
}
});
</script>