<?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a(Adm::t('app/contact_msg', 'Create Contact Msg'), ['create'], ['class' => 'btn btn-primary']); ?> </p> <?php echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'id', 'format' => 'text', 'width' => '70px'], ['attribute' => 'from_email', 'format' => 'email'], ['attribute' => 'subject', 'format' => 'raw', 'value' => function ($model) { return Html::a($model->subject, ['view', 'id' => $model->id]); }], ['attribute' => 'text', 'format' => 'raw'], ['attribute' => 'created_at', 'format' => 'text', 'width' => '150px', 'vAlign' => 'middle', 'hAlign' => 'center'], ['attribute' => 'viewed', 'width' => '50px', 'vAlign' => 'middle', 'hAlign' => 'center', 'format' => 'raw', 'value' => function ($model) { if ($model->viewed) { $label = Html::tag('span', '', ['class' => 'ic glyphicon glyphicon-ok text-success']); } else { $label = Html::tag('span', '', ['class' => 'ic glyphicon glyphicon-remove text-danger']); } return \pavlinter\buttons\AjaxButton::widget(['label' => $label, 'encodeLabel' => false, 'options' => ['class' => 'btn btn-primary'], 'ajaxOptions' => ['url' => Url::to('viewed'), 'data' => ['id' => $model->id], 'done' => 'function(data){ if(data.r){ var $icon = $("#" + abId).find(".ic"); $icon.removeAttr("class"); $icon.addClass(data.class); } }']]); }], ['class' => '\\kartik\\grid\\ActionColumn', 'template' => '{view} {update} {delete}']]]); ?> </div>
echo Html::submitButton($model->isNewRecord ? Adm::t('oplata', 'Create', ['dot' => false]) : Adm::t('oplata', 'Update', ['dot' => false]), ['class' => 'btn btn-primary btnAct btnSimple']); ?> <?php echo Html::submitButton($model->isNewRecord ? Adm::t('oplata', 'Create And Send', ['dot' => false]) : Adm::t('oplata', 'Update And Send', ['dot' => false]), ['class' => 'btn btn-primary btnAct btnSend']); ?> <?php if (!$model->isNewRecord && strtotime($model->date_end) <= time()) { ?> <div class="pull-right"> <?php echo \pavlinter\buttons\AjaxButton::widget(['label' => Adm::t('oplata', 'Send overdue payment', ['dot' => false]), 'options' => ['class' => 'btn btn-primary overdueBtn'], 'ajaxOptions' => ['url' => Url::to(['send-overdue']), 'data' => ['id' => $model->id], 'done' => 'function(d){ if(d.r){ var $alert = $("<div class=\\"alert alert-" + d.alertType + "\\"><button class=\\"close\\" data-dismiss=\\"alert\\">×</button>" + d.text + "</div>"); $(".wrapper h1").after($alert); $("html, body").animate({ scrollTop: 0 }, 1000); } }']]); ?> </div> <?php } ?> </div> <div class="col-xs-6"> <a class="btn btn-s-md btn-white cloneBtn" href="javascript:void(0);"> <i class="fa fa-plus text"></i>
}, 'filterWidgetOptions' => ['pluginOptions' => ['escapeMarkup' => new JsExpression('function (m) { return m; }'), 'allowClear' => true, 'minimumResultsForSearch' => -1]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'method', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::merge(['null' => Yii::t('yii', '(not set)')], Module::getInstance()->manager->createOplataTransactionQuery('method_list')), 'value' => function ($model) { if (!empty($model->response_status)) { $text = Module::getInstance()->manager->createOplataTransactionQuery('method_list', $model->method); return $text; } }, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'minimumResultsForSearch' => -1]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'created_at', 'width' => '160px', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']], 'vAlign' => 'middle', 'hAlign' => 'center'], ['attribute' => 'date_end', 'width' => '160px', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']], 'vAlign' => 'middle', 'hAlign' => 'center'], ['attribute' => 'sent_email', 'width' => '120px', 'vAlign' => 'middle', 'hAlign' => 'center', 'format' => 'raw', 'value' => function ($model) { $remind = ''; if ($model->remind_note) { $remind = ' ' . Html::tag('span', '', ['class' => 'fa fa-envelope-o text-success cursor-help', 'data-toggle' => 'tooltip', 'title' => Adm::t('admoplata', 'Remind note sent')]); } if ($model->sent_email || $model->response_status !== $model::STATUS_NOT_PAID) { return Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok text-success cursor-help', 'data-toggle' => 'tooltip', 'title' => Adm::t('admoplata', 'Email Sent')]) . $remind; } return \pavlinter\buttons\AjaxButton::widget(['label' => Adm::t('oplata', 'Send'), 'options' => ['class' => 'btn btn-primary'], 'ajaxOptions' => ['url' => Url::to('send-email'), 'data' => ['id' => $model->id], 'done' => 'function(data){ if(data.r){ $("#" + abId).next("span").removeClass("hide").end().remove(); } }']]) . Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok text-success hide cursor-help', 'data-toggle' => 'tooltip', 'title' => Adm::t('admoplata', 'Email Sent')]) . $remind; }], ['class' => '\\kartik\\grid\\ActionColumn', 'width' => '100px', 'template' => '{pay} {view} {update} {delete}', 'buttons' => ['view' => function ($url, $model) { if ($model->alias) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['default/invoice', 'alias' => $model->alias], ['title' => Yii::t('yii', 'View'), 'data-pjax' => '0', 'target' => '_blank']); } }, 'update' => function ($url, $model) { if (!Adm::getInstance()->user->can('Adm-OplataUpdate')) { return null; } return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']); }, 'delete' => function ($url, $model) { if (!Adm::getInstance()->user->can('Adm-OplataDelete')) { return null; }