コード例 #1
0
ファイル: sms.php プロジェクト: djvolk/post
    ?>
            <div class="alert alert-success col-lg-12">
                <?php 
    echo Yii::$app->session->getFlash('success');
    ?>
            </div>
        <?php 
}
?>
        <div class="col-lg-12">
            <?php 
$gridColumns = [['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'order_id', 'format' => 'raw', 'value' => function ($model, $key, $index, $widget) {
    return Html::a($model->order_id, urldecode(str_replace('[orderID]', $model->order_id, Settings::findOne(['field' => 'app_order_path'])->value)));
}], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'spi'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'fio'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'phone'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'amount'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'delivery_status'], ['class' => 'kartik\\grid\\ExpandRowColumn', 'width' => '50px', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detailUrl' => Url::to(['site/smslog']), 'headerOptions' => ['class' => 'kartik-sheet-style'], 'expandOneOnly' => true, 'detailRowCssClass' => 'nohover'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'sms_status', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filter' => Orders::listSmsStatus(), 'filterInputOptions' => ['prompt' => 'Все'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true], 'hideSearch' => true], 'format' => 'raw'], ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'status', 'value' => function ($model, $key, $index, $widget) {
    if ($model->status == 'enabled') {
        return true;
    } else {
        return false;
    }
}, 'vAlign' => 'middle', 'trueLabel' => 'Отслеживается', 'falseLabel' => 'Не отслеживается', 'trueIcon' => '<span class="glyphicon glyphicon-eye-open"></span>', 'falseIcon' => '<span class="glyphicon glyphicon-eye-close"></span>'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{mail}{status}', 'buttons' => ['sms' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-envelope"></span>', $url, ['title' => 'Отправить следующую SMS', 'message' => 'Хотите отправить SMS?', 'class' => 'grid-action', 'style' => 'margin-right:10px;']);
}, 'status' => function ($url, $model) {
    if ($model->status == 'enabled') {
        return Html::a('<span class="glyphicon glyphicon-eye-close"></span>', $url, ['title' => 'Перестать отслеживать заказ', 'message' => 'Хотите перестать отслеживать заказ?', 'class' => 'grid-action']);
    } else {
        return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, ['title' => 'Начать отслеживать заказ', 'message' => 'Хотите начать отслеживать заказ?', 'class' => 'grid-action']);
    }
}], 'urlCreator' => function ($action, $model, $key, $index) {
    if ($action === 'sms') {