Esempio n. 1
0
function status($status)
{
    switch ($status) {
        case 1:
            return '<span class="label label-primary">' . SystemBackCall::getStatus($status) . '</span>';
            break;
        case 2:
            return '<span class="label label-success">' . SystemBackCall::getStatus($status) . '</span>';
            break;
    }
}
Esempio n. 2
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('system', 'System Back Calls');
$this->params['breadcrumbs'][] = $this->title;
$this->params['actions_buttons'] = [['tagName' => 'a', 'label' => Yii::t('system', 'Create'), 'options' => ['href' => Url::to(['create'])], 'icon' => 'fa fa-plus', 'iconPosition' => Button::ICON_POSITION_LEFT, 'size' => Button::SIZE_SMALL, 'disabled' => false, 'block' => false, 'type' => Button::TYPE_CIRCLE], ['label' => Yii::t('app', 'Control'), 'options' => ['class' => 'btn blue btn-outline btn-circle btn-sm', 'data-hover' => "dropdown", 'data-close-others' => "true"], 'dropdown' => ['options' => ['class' => 'pull-right'], 'encodeLabels' => false, 'items' => [['label' => '<span class="font-red"><i class="fa fa-trash-o"></i> ' . Yii::t('app', 'Delete') . '</span>', 'url' => 'javascript:void(0)', 'linkOptions' => ['onclick' => 'deleteA()']], ['label' => '<span class="font-green-turquoise"><i class="fa fa-toggle-on"></i> ' . Yii::t('app', 'Status Processed') . '</span>', 'url' => 'javascript:void(0)', 'linkOptions' => ['onclick' => 'publishedA()']], ['label' => '<span class="font-blue-chambray"><i class="fa fa-toggle-off"></i> ' . Yii::t('app', 'Status New') . '</span>', 'url' => 'javascript:void(0)', 'linkOptions' => ['onclick' => 'unpublishedA()']]]]], ['tagName' => 'a', 'options' => ['href' => Url::to(['/admin/modules/setting', 'name' => 'system'])], 'icon' => 'fa fa-cog', 'label' => '', 'type' => Button::TYPE_CIRCLE]];
?>
<div class="system-back-call-index">

    <div class="table-responsive">
        <?php 
echo GridView::widget(['id' => 'grid', 'tableOptions' => ['class' => 'table table-striped table-bordered table-advance table-hover'], 'dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'options' => ['style' => 'width:36px']], ['attribute' => 'id', 'options' => ['style' => 'width:100px']], 'name', 'email:email', 'phone', 'created_at:datetime', ['attribute' => 'status', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
    switch ($model->status) {
        case 1:
            return '<span class="label label-primary">' . SystemBackCall::getStatus($model->status) . '</span>';
            break;
        case 2:
            return '<span class="label label-success">' . SystemBackCall::getStatus($model->status) . '</span>';
            break;
    }
}], ['class' => 'app\\modules\\admin\\components\\grid\\ActionColumn']]]);
?>
    </div>
</div>
<script>
    function deleteA() {
        var keys = $('#grid').yiiGridView('getSelectedRows');
        window.location.href = '<?php 
echo Url::to(['/admin/system/back-call/delete-ids']);
?>
' + '?id=' + keys.join();
    }
    function publishedA() {