Since: 1.0
Author: Kartik Visweswaran (kartikv2@gmail.com)
Inheritance: extends kartik\grid\GridView, use trait kartik\base\TranslationTrait
Exemplo n.º 1
2
use yii\widgets\ActiveForm;
use kartik\export\ExportMenu;
use kartik\date\DatePicker;
$this->title = 'Content Types';
$this->params['breadcrumbs'][] = $this->title;
$gridColumns = ['tct_id', 'tcl_name', 'tcl_media_type', 'tcl_priority', 'tcl_support', ['class' => 'kartik\\grid\\ActionColumn']];
?>
    <div class="panel panel-default">
        <div class="panel-heading">
            <div class="row">
                <div class="col-sm-11">Filter</div>
                <div class="col-sm-1">
                    <?php 
if (isset($dataProvider)) {
    $columnExport = ['tct_id', 'tcl_name', 'tcl_media_type', 'tcl_priority', 'tcl_support'];
    echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $columnExport, 'showConfirmAlert' => false, 'showColumnSelector' => false, 'target' => ExportMenu::TARGET_SELF, 'exportConfig' => [ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_EXCEL_X => false, ExportMenu::FORMAT_PDF => false, ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_CSV => ['label' => 'Export CSV']], 'filename' => date('Y-m-d')]);
}
?>
                </div>
            </div>
        </div>
        <div class="panel-body">
            <div class="form">
                <?php 
if (isset($dataProvider)) {
    echo '<div id="filter_field" style="display:none;">';
} else {
    echo '<div id="filter_field" style="display:block;">';
}
?>
Exemplo n.º 2
0
 function run()
 {
     // We need this because this is a widget within a widget
     // Thus there has been an extra ob_start()
     $download = !empty($_POST) && !empty($_POST[$this->exportRequestParam]) && $_POST[$this->exportRequestParam];
     if ($download) {
         ob_end_clean();
     }
     return parent::run();
 }
Exemplo n.º 3
0
                    <?php 
ContainerLoader::end();
?>
                </ul>
            </div>
        </div>
    </div>

<?php 
echo Html::a("Назад", 'javascript:history.go(-1)', ['class' => "btn btn-primary"]);
?>

    <div>

        <p class="h3"><?php 
echo $model->header();
?>
</p>

        <?php 
echo ExportMenu::widget(['dataProvider' => $model->itemsDataProvider(), 'columns' => $model->itemsColumns(), 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'formatter' => ['class' => \yii\i18n\Formatter::className(), 'nullDisplay' => '', 'decimalSeparator' => ',', 'thousandSeparator' => ''], 'filename' => $model->header(), 'exportConfig' => [ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_PDF => false]]);
?>

        <?php 
echo GridView::widget(['dataProvider' => $model->itemsDataProvider(), 'columns' => $model->itemsColumns(), 'formatter' => ['class' => \yii\i18n\Formatter::className(), 'nullDisplay' => ''], 'tableOptions' => ['class' => 'table table-striped table table-hover']]);
?>

    </div>

<?php 
echo Html::a("Назад", 'javascript:history.go(-1)', ['class' => "btn btn-primary"]);
Exemplo n.º 4
0
/* @var $searchModel backend\models\search\ProveedoresContactoSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Proveedores Contactos';
$this->params['breadcrumbs'][] = $this->title;
?>

    <div class="contactos-iniciativa-privada contenedor_1400">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

<?php 
$gridColumns = [['width' => '25px', 'class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'nombre', 'value' => 'nombre'], ['attribute' => 'apellido', 'value' => 'apellido'], ['attribute' => 'telefono', 'value' => 'telefono'], ['attribute' => 'celular', 'value' => 'celular'], ['attribute' => 'email', 'value' => 'email'], ['attribute' => 'proveedor.empresa', 'value' => 'proveedor.empresa']];
echo export\ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'columnSelectorOptions' => ['label' => 'Columnas'], 'dropdownOptions' => ['label' => 'Exportar Todo', 'class' => 'btn btn-default'], 'hiddenColumns' => [0], 'noExportColumns' => [0], 'exportConfig' => [export\ExportMenu::FORMAT_HTML => false, export\ExportMenu::FORMAT_CSV => false, export\ExportMenu::FORMAT_TEXT => false, export\ExportMenu::FORMAT_PDF => false, export\ExportMenu::FORMAT_EXCEL => false]]);
?>




<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary' => true, 'columns' => $gridColumns, 'responsive' => true, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'hover' => true]);
?>


</div>
<?php 
/*
<div class="proveedores-contacto-index">
Exemplo n.º 5
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Usuarios';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Crear Usuario', ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
$gridColumns = [['class' => 'kartik\\grid\\SerialColumn'], 'username', 'nombre', 'apellido', ['label' => 'Organizacion', 'attribute' => 'organizacionNombre'], ['label' => 'Aplicacion', 'attribute' => 'aplicacionNombre'], ['label' => 'Division', 'attribute' => 'divisionNombre'], ['label' => 'Distrito', 'attribute' => 'distritoNombre'], ['label' => 'Empresa', 'attribute' => 'empresaNombre']];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'fontAwesome' => true]);
?>

    <?php 
Yii::$app->user->identity->rol_id == '2' ? $buttons = '{view}{delete}{update}' : ($buttons = '');
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'username', 'nombre', 'apellido', ['label' => 'Organizacion', 'attribute' => 'organizacionNombre'], ['label' => 'Aplicacion', 'attribute' => 'aplicacionNombre'], ['label' => 'Division', 'attribute' => 'divisionNombre'], ['label' => 'Distrito', 'attribute' => 'distritoNombre'], ['label' => 'Empresa', 'attribute' => 'empresaNombre'], ['class' => 'yii\\grid\\ActionColumn', 'visible' => Yii::$app->user->identity->rol_id == '2']]]);
?>

</div>
Exemplo n.º 6
0
<?php

use backend\assets\AppAsset;
use yii\widgets\ActiveForm;
use yii\widgets\LinkPager;
use yii\helpers\Html;
use yii\helpers\Url;
/* @var $this yii\web\View */
$this->registerMetaTag(['name' => 'keywords', 'content' => '商户管理']);
$this->registerMetaTag(['name' => 'description', 'content' => '商户管理'], 'description');
$this->title = '代理系统-商家管理';
$this->params['breadcrumbs'][] = '商家管理';
$this->params['breadcrumbs'][] = '商家中心';
$this->params['breadcrumbs'][] = '商户管理';
AppAsset::register($this);
AppAsset::addScript($this, '@web/js/plugins/validate/jquery.validate.min.js');
?>
<div class="wrapper wrapper-content">
<?php 
use kartik\export\ExportMenu;
//菜单展示
$gridColumns = ['id', 'username', 'email', 'legalname', 'phone', 'compname'];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'fontAwesome' => true, 'columnSelectorOptions' => ['class' => 'btn btn-sm btn-primary'], 'dropdownOptions' => ['icon' => '<i class="glyphicon glyphicon-export"></i>', 'label' => '导出', 'class' => 'btn btn-sm btn-primary'], 'exportConfig' => [ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_PDF => false]]);
?>

<?php 
//数据展示
use yii\grid\GridView;
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'username', 'email', 'legalname', 'phone', 'compname', ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'headerOptions' => ['width' => '80']]]]);
?>
</div>
Exemplo n.º 7
0
echo $this->render('_form', ['model' => $model]);
?>

</div>

<h1>Main Employee</h1>

<div class="form-group right">
    <?php 
$gridColumns = [['class' => 'yii\\grid\\SerialColumn'], 'fullname', 'gender', 'mobiletel', 'NRIC', 'email:email'];
$gridColumnsCSV = [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'fullname', 'value' => function ($model) {
    $suspended = $model->suspended ? '(Suspended) ' : '';
    return $suspended . $model->fullname;
}], 'gender', 'mobiletel', 'NRIC', 'email:email'];
// Renders a export dropdown menu
echo ExportMenu::widget(['dataProvider' => $employeeData, 'columns' => $gridColumnsCSV, 'target' => ExportMenu::TARGET_SELF, 'showColumnSelector' => false, 'showConfirmAlert' => false, 'dropdownOptions' => ['label' => 'Export to', ['class' => 'btn btn-primary']], 'exportConfig' => [ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_PDF => false, ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_EXCEL_X => false], 'filename' => 'company-employees' . time()]);
?>
</div>

<?php 
// You can choose to render your own GridView separately
echo GridView::widget(['dataProvider' => $employeeData, 'filterModel' => $employeeSearch, 'columns' => $gridColumns]);
?>



    <p>
<?php 
if (Yii::$app->user->identity->type == 'master') {
    ?>
        <?php 
Exemplo n.º 8
0
use yii\grid\GridView;
use kartik\export\ExportMenu;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\UsersSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Trainers Revenue';
$this->params['breadcrumbs'][] = $this->title;
$gridColumns = [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_email', 'format' => 'html'], ['attribute' => 'last_login_time', 'value' => function ($model) {
    return date('Y-m-d H:i', $model->user_login_time);
}]];
// Renders a export dropdown menu
echo ExportMenu::widget(['options' => $data, 'dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-bordered table-hover'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_email', 'format' => 'html'], ['label' => 'First Name', 'value' => function ($model) {
    return $model->payment->payment_first_name;
}], ['label' => 'Last Name', 'value' => function ($model) {
    return $model->payment->payment_last_name;
}], ['label' => 'Bussines Name', 'value' => function ($model) {
    return $model->payment->payment_bussines_name;
}], ['label' => 'Trainer Revenue', 'value' => function ($model, $key, $index, $grid) {
    return '$ ' . $grid->grid->options['gusers'][$key];
}]], 'exportConfig' => [ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_EXCEL_X => false, ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_TEXT => false]]);
?>
<div class="users-index">
    <div class="box">
        <div class="box-body">           
        <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        <div class="small-box bg-aqua">
          <div class="inner">
            <h3>$ <?php 
echo $data['gross'];
?>
Exemplo n.º 9
0
    <!-- Query Builder -->
    <?php 
QueryBuilderForm::begin(['rules' => $rules, 'builder' => ['id' => 'query-builder', 'filters' => [['id' => 'id', 'label' => 'Id', 'type' => 'integer'], ['id' => 'username', 'label' => 'Username', 'type' => 'string'], ['id' => 'first_name', 'label' => 'First Name', 'type' => 'string'], ['id' => 'last_name', 'label' => 'Last Name', 'type' => 'string'], ['id' => 'email', 'label' => 'Email', 'type' => 'string']]]]);
?>

        <?php 
echo Html::submitButton('Apply');
?>
        <?php 
echo Html::resetButton('Reset');
?>

    <?php 
QueryBuilderForm::end();
?>
    <!-- /Query Builder -->
    <br/>
    <div style="float: right;">
    <?php 
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'target' => ExportMenu::TARGET_SELF, 'exportConfig' => [ExportMenu::FORMAT_PDF => false], 'columns' => ['id', 'username', 'first_name', 'last_name', 'email'], 'fontAwesome' => true, 'options' => ['style' => 'float: right'], 'columnSelectorMenuOptions' => ['class' => 'dropdown-menu-right'], 'dropdownOptions' => ['menuOptions' => ['class' => 'dropdown-menu-right']]]);
?>
    </div>
    <div class="clearfix"></div>
    
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'username', 'first_name', 'last_name', 'email:email', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemplo n.º 10
0
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
?>

<h3 class="page-header">Report KPI</h3>

	<?php 
echo $this->render('_searchKPI', ['model' => $searchModel]);
?>

	<?php 
$gridColumns = [['class' => 'yii\\grid\\SerialColumn'], 'name', 'stockPicking0.date_done', 'partner.display_name', 'saleOrder.date_order', 'tanggal', 'selisih_hari', 'status'];
echo ExportMenu::widget(['dataProvider' => $dataProviderExport, 'asDropdown' => false, 'exportConfig' => [ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_CSV => false, ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_PDF => false, ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_EXCEL_X => ['label' => 'Export to Excel']], 'columns' => $gridColumns]);
echo GridView::widget(['dataProvider' => $dataProvider, 'toolbar' => ['{export}'], 'exportConfig' => [GridView::EXCEL => ['label' => 'Export to Excel']], 'export' => ['label' => 'Export', 'target' => GridView::TARGET_SELF], 'panel' => ['before' => 'Report KPI'], 'columns' => $gridColumns]);
Exemplo n.º 11
0
echo Html::button('Create Branches', ['value' => Url::to('index.php?r=branches/create'), 'class' => 'btn btn-success', 'id' => 'modalButton']);
?>
    </p>
    <?php 
Modal::begin(['options' => ['tabindex' => false], 'header' => '<h4> Branches </h4>', 'id' => 'modal', 'size' => 'modal-lg']);
echo "<div id='modalContent'></div>";
Modal::end();
?>
    
    
    <!-- 下载文件 -->
    <?php 
$gridColumns = ['companiesCompany.company_name', 'branch_name', ['attribute' => 'branch_name', 'label' => '自定义头标题(用branch_name的数据)', 'vAlign' => 'middle', 'width' => '500px', 'value' => function ($model, $key, $index, $widget) {
    return Html::a($model->branch_name, '#', []);
}, 'format' => 'raw'], 'branch_address', 'branch_create_data', 'branch_status'];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'fontAwesome' => true, 'dropdownOptions' => ['label' => 'Export All']]);
?>
    
    

    <?php 
//Pjax::begin(['id'=>'branchesGrid']);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'export' => false, 'pjax' => true, 'rowOptions' => function ($model) {
    if ($model->branch_status == 'inactive') {
        return ['class' => 'danger'];
    } else {
        if ($model->branch_status == 'active') {
            return ['class' => 'success'];
        }
Exemplo n.º 12
0
<?php

use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
/* @var $this yii\web\View */
/* @var $searchModel app\models\CountriesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Countries';
$this->params['breadcrumbs'][] = $this->title;
echo ExportMenu::widget(['dataProvider' => $dataProvider]);
?>

<div class="countries-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Countries', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
Exemplo n.º 13
0
	<?php 
ActiveForm::end();
?>

</div>

<div class="receipt-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['style' => 'width: 100px;']], ['label' => 'Cliente', 'value' => 'estimate.client.name', 'filter' => Html::activeDropDownList($searchModel, 'client_id', Client::getIdNameArray(), ['class' => 'form-control', 'prompt' => 'Nombre'])], ['label' => 'Presupuesto', 'value' => 'estimate.title'], 'number', ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'status', 'label' => 'Estado', 'value' => 'statusLabel', 'filter' => Html::activeDropDownList($searchModel, 'status', Receipt::statusLabels(), ['class' => 'form-control', 'prompt' => 'Estado']), 'editableOptions' => ['inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => Receipt::statusLabels()]], ['attribute' => 'created_date', 'format' => 'date', 'filter' => false], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

	<?php 
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'filename' => 'facturas', 'columns' => [['attribute' => 'created_date', 'format' => 'date', 'filter' => false], ['attribute' => 'type', 'value' => 'typeLabel'], ['attribute' => 'number', 'label' => 'Factura Nro'], ['label' => 'Cliente', 'value' => 'estimate.client.name'], ['label' => 'CUIT', 'value' => 'estimate.client.cuit'], ['label' => 'Facturación Neta', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->estimate->total_checked, Currency::CURRENCY_ARS);
}], ['label' => 'IVA', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->IVATotal, Currency::CURRENCY_ARS);
}], ['label' => 'Facturación Bruta', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->gross, Currency::CURRENCY_ARS);
}], ['label' => 'Utilidad', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->estimate->total_checked - $model->estimate->cost_checked, Currency::CURRENCY_ARS);
}], ['label' => 'Porcentaje', 'value' => null], ['label' => 'Productos', 'value' => 'products'], ['label' => 'Estado', 'value' => 'statusLabel'], ['label' => 'Recibo Nro', 'value' => null]]]);
?>

</div>
Exemplo n.º 14
0
?>

			<?php 
echo $form->field($attendanceLogForm, 'year');
?>
			<?php 
echo $form->field($attendanceLogForm, 'month');
?>
			<?php 
echo $form->field($attendanceLogForm, 'day');
?>
			
			<div class="form-group">
	        	<div class="col-lg-offset-3 col-lg-11">
					<?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
				</div>
			</div>
		<?php 
ActiveForm::end();
?>
	</div>-->
	<?php 
echo \kartik\export\ExportMenu::widget(['dataProvider' => $dataProvider]);
?>
	<?php 
echo \kartik\grid\GridView::widget(['dataProvider' => $dataProvider, 'emptyCell' => "&nbsp;", 'columns' => ['year', 'month', 'day', 'employee', 'hour_1', 'minute_1', 'hour_2', 'minute_2']]);
?>
</div>
Exemplo n.º 15
0
?>

    <p>
        <?php 
echo Html::button('Create Branches', ['value' => Url::to('index.php?r=branches/create'), 'class' => 'btn btn-success', 'id' => 'modalButtom']);
?>
    </p>

    <?php 
Modal::begin(['header' => '<h2>New Branch</h2>', 'id' => 'modal', 'size' => 'modal-lg']);
echo '<div id="modalContent"></div>';
Modal::end();
?>

    <?php 
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => ['branch_name', 'branch_address', 'branch_created_date', 'branch_status']]);
?>


    <?php 
echo GridView::widget(['rowOptions' => function ($model, $key, $index, $grid) {
    // ?? how $model gets its values ????????????
    // echo PHP_EOL;
    // echo PHP_EOL;
    // echo PHP_EOL;
    // echo PHP_EOL;
    // echo PHP_EOL;
    // echo 'model : ';
    // print_r($model);
    // echo PHP_EOL;
    // echo 'key : ';
Exemplo n.º 16
0
<?php

use yii\helpers\Url;
use kartik\export\ExportMenu;
use kartik\grid\GridView;
use kartik\date\DatePicker;
$gridColumns = [['attribute' => 'GAID', 'filter' => $gaids, 'width' => '120px', 'filterInputOptions' => ['disabled' => true, 'class' => 'form-control']], ['attribute' => 'FDATE', 'value' => 'FDATE', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['type' => DatePicker::TYPE_INPUT, 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'endDate' => "+0D"]], 'format' => 'html'], 'FTIME', 'CO', 'O2', 'NO', 'CO2', 'CH4'];
/* @var $this yii\web\View */
/* @var $searchModel app\models\search\GadataSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $gaids array */
?>
<div class="gadata-index grid-margin">

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'resizableColumns' => false, 'pjax' => true, 'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container']], 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => '<h3 class="panel-title"><i class="fa fa-table fa-fw"></i> Архив</h3>', 'footer' => false], 'export' => ['label' => 'Текущая страница', 'fontAwesome' => true], 'beforeHeader' => ['{pager}'], 'toolbar' => ['{export}', ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'target' => ExportMenu::TARGET_BLANK, 'fontAwesome' => true, 'pjaxContainerId' => 'kv-pjax-container', 'dropdownOptions' => ['label' => 'Полностью', 'class' => 'btn btn-default', 'itemsBefore' => ['<li class="dropdown-header">Экспорт все данные</li>']], 'onInitWriter' => function ($writer, $grid) {
    //Костыль, другим способом поменять разделить ячеек для CSV без правки исходников не получилось
    if (\Yii::$app->request->post(ExportMenu::PARAM_EXPORT_TYPE) == ExportMenu::FORMAT_CSV) {
        $writer->setExcelCompatibility(true);
    }
}])], 'panelBeforeTemplate' => '<div class="pull-left">{pager}</div><div class="pull-right">Экспорт: {toolbar}</div><div class="clear"></div>']);
?>

</div>
Exemplo n.º 17
0
    <div class="shop-menu">
        <?php 
echo $this->render('../parts/menu');
?>
    </div>
    
    <div class="row">
        <div class="col-md-2">
            <?php 
echo Html::a('Создать категорию', ['create'], ['class' => 'btn btn-success']);
?>
        </div>
        <div class="col-md-4">
            <?php 
$gridColumns = ['id', 'name'];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns]);
?>
        </div>
    </div>

    <br style="clear: both;"></div>
    
    <ul class="nav nav-pills">
        <li role="presentation" <?php 
if (yii::$app->request->get('view') == 'tree' | yii::$app->request->get('view') == '') {
    echo ' class="active"';
}
?>
><a href="<?php 
echo Url::toRoute(['category/index', 'view' => 'tree']);
?>
Exemplo n.º 18
0
/* @var $this yii\web\View */
/* @var $searchModel backend\models\VirtualSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Virtuals';
$this->params['breadcrumbs'][] = $this->title;
?>

<?php 
echo $this->render('_search', ['model' => $searchModel]);
?>
<div class="virtual-index">
    <!-- export file  -->
    <?php 
$gridColoumns = ['name', 'description', 'status'];
$columnExport = ['name', 'description', 'status'];
$exportMenu = ExportMenu::widget(['asDropdown' => false, 'dataProvider' => $dataProvider, 'columns' => $columnExport, 'showColumnSelector' => false, 'target' => ExportMenu::TARGET_SELF, 'pjaxContainerId' => 'kv-pjax-container', 'dropdownOptions' => ['label' => 'Export', 'class' => 'btn btn-default'], 'showConfirmAlert' => false, 'exportConfig' => [ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_PDF => false, ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_EXCEL_X => false], 'filename' => date('Y-m-d')]);
/*echo ExportMenu::widget([
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'pjax' => true,
            'rowOptions'=> function($model){

            }
        ]);*/
?>
    <?php 
Pjax::begin(['id' => 'virtual-grid-pjax']);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterSelector' => "input[name='" . $dataProvider->getPagination()->pageSizeParam . "'],input[name='" . $dataProvider->getPagination()->pageParam . "']", 'hover' => true, 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => Html::encode($this->title)], 'pjax' => true, 'rowOptions' => function ($model) {
    if ($model->status == 1) {
Exemplo n.º 19
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use kartik\export\ExportMenu;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\UsersSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Export Emails';
$this->params['breadcrumbs'][] = $this->title;
$gridColumns = [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_email', 'format' => 'html'], ['attribute' => 'last_login_time', 'value' => function ($model) {
    return date('Y-m-d H:i', $model->user_login_time);
}]];
// Renders a export dropdown menu
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'exportConfig' => [ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_EXCEL_X => false, ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_TEXT => false]]);
?>
<div class="users-index">
    <div class="box">
        <div class="box-body">
            <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-bordered table-hover'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_email', 'format' => 'html'], ['attribute' => 'last_login_time', 'value' => function ($model) {
    return date('Y-m-d H:i', $model->user_login_time);
}]]]);
?>
        </div>
    </div>
</div>
Exemplo n.º 20
0
}], ['attribute' => 'phone', 'filter' => MaskedInput::widget(['attribute' => 'phone', 'model' => $searchModel, 'name' => 'input-5', 'mask' => ['99-999-9999', '999-999-9999']]), 'value' => function ($data) {
    if ($data->phone) {
        return $data->phone;
    } else {
        return 'No phone';
    }
}], ['attribute' => 'adult_gender', 'format' => 'html', 'filter' => Html::activeDropDownList($searchModel, 'adult_gender', ['1' => 'Male', '0' => 'Female'], ['class' => 'form-control', 'prompt' => 'All']), 'value' => function ($data) {
    if ($data->adult_gender == 0) {
        return "Female";
    } elseif ($data->adult_gender == 1) {
        return "Male";
    } else {
        return "<span style='color: #ff0000;'>unknown</span>";
    }
}], ['attribute' => 'adult_dob', 'filter' => '', 'value' => function ($data) {
    return date('d-m-Y', $data->adult_dob);
}], ['attribute' => 'signature_img', 'format' => 'raw', 'contentOptions' => ['class' => 'signature_class'], 'filter' => '', 'value' => function ($data) {
    return Html::img(Url::toRoute($data->signature_img), ['alt' => 'yii2 - картинка в gridview', 'style' => 'width:100px; width: 100px;']);
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {delete} {print} {pdf} ', 'buttons' => ['print' => function ($url, $model, $key) {
    $url = Yii::$app->urlManager->createUrl(['adult/print', 'id' => $model->id]);
    $options = array_merge(['title' => Yii::t('app', 'print')]);
    return Html::a('<span class="glyphicon glyphicon-print"></span>', $url, $options);
}, 'pdf' => function ($url, $model, $key) {
    $url = Yii::$app->urlManager->createUrl(['adult/pdf', 'id' => $model->id]);
    $options = array_merge(['title' => Yii::t('app', 'Posted messages')]);
    return Html::a('<span class="glyphicon glyphicon-file"></span>', $url, $options);
}]]], 'toolbar' => [['content' => Html::a('Add', ['create'], ['data-pjax' => 'false', 'class' => 'btn btn-success']) . Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => false, 'class' => 'btn btn-default', 'title' => 'Reset Grid']) . ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns])], '{export}', '{toggleData}'], 'panel' => ['heading' => '<b>Minors</b>', 'before' => '']]);
?>

</div>
Exemplo n.º 21
0
    </div>

	<?php 
ActiveForm::end();
?>

</div>

<div class="receipt-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<?php 
$columns = [['attribute' => 'bukmark_code', 'label' => 'Código', 'value' => 'product.bukmark_code', 'options' => ['style' => 'width: 100px;']], ['attribute' => 'product_id', 'value' => 'product.title', 'filter' => Html::activeDropDownList($searchModel, 'product_id', Product::getDropdownData(), ['class' => 'form-control', 'prompt' => 'Elegir producto']), 'enableSorting' => false], ['label' => 'Cliente', 'value' => 'estimate.client.name', 'filter' => Html::activeDropDownList($searchModel, 'client_id', Client::getIdNameArray(), ['class' => 'form-control', 'prompt' => 'Nombre'])], ['attribute' => 'estimate.receipt.created_date', 'format' => 'date', 'filter' => false], ['attribute' => 'quantity'], ['label' => 'Total', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->quantitySubtotal, Currency::CURRENCY_ARS);
}, 'options' => ['style' => 'width: 150px;']]];
?>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns]);
?>

	<?php 
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'filename' => 'resumen', 'columns' => $columns]);
?>

</div>
Exemplo n.º 22
0
        </div>
    <?php 
}
?>
    
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-striped table-hover'], 'emptyText' => '</br><p class="text-danger">' . Yii::t('app', 'No entries found!') . '</p>', 'summary' => '', 'showFooter' => true, 'showOnEmpty' => false, 'footerRowOptions' => ['style' => 'font-weight:bold;'], 'rowOptions' => function ($model, $index, $widget, $grid) {
    return ['id' => $model['id'], 'onclick' => 'location.href="' . Yii::$app->urlManager->createUrl('cashbook/') . '/"+(this.id);', 'style' => "cursor: pointer"];
}, 'columns' => [['attribute' => 'date', 'enableSorting' => true, 'value' => function ($model) {
    return $model->date != '' ? Yii::$app->formatter->asDate($model->date, 'short') : Yii::$app->formatter->asDate($model->date, 'short');
}, 'contentOptions' => ['style' => 'width: 15%;text-align:left']], ['attribute' => 'category_id', 'format' => 'raw', 'enableSorting' => true, 'value' => function ($model) {
    return $model->description != '' ? '<span style="color:' . $model->category->hexcolor_category . '">' . $model->category->desc_category . '</span>' . ' <em class="text-muted">(' . $model->description . ')</em>' : '<span style="color:' . $model->category->hexcolor_category . '">' . $model->category->desc_category . '</span>';
}, 'contentOptions' => ['style' => 'width: 55%;text-align:left'], 'footer' => 'Total', 'footerOptions' => ['style' => 'text-align:letf']], ['label' => '', 'attribute' => 'value', 'format' => 'raw', 'value' => function ($model) {
    return $model->is_pending === 0 ? '<strong style="color:' . $model->type->hexcolor_type . '">' . ' ' . $model->value . '</strong>' : '<span class="glyphicon glyphicon-flag" style="color:orange" aria-hidden="true"></span> <strong style="color:' . $model->type->hexcolor_type . '">' . ' ' . $model->value . '</strong>';
}, 'enableSorting' => true, 'contentOptions' => ['style' => 'width: 30%;text-align:right'], 'footer' => Cashbook::pageTotal($dataProvider->models, 'value'), 'footerOptions' => ['style' => 'text-align:right']]]]);
?>
     <hr/>
     <div class="pull-left">
          <?php 
use kartik\export\ExportMenu;
$gridColumns = [['attribute' => 'date', 'format' => ['date'], 'hAlign' => 'right', 'width' => '110px'], ['attribute' => 'category_id', 'label' => Yii::t('app', 'Category'), 'vAlign' => 'middle', 'width' => '190px', 'value' => function ($model, $key, $index, $widget) {
    return Html::a($model->category->desc_category, '#', []);
}, 'format' => 'raw'], ['attribute' => 'value', 'format' => ['decimal', 2], 'hAlign' => 'right', 'width' => '110px']];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'fontAwesome' => true, 'emptyText' => Yii::t('app', 'No entries found!'), 'showColumnSelector' => true, 'asDropdown' => true, 'target' => ExportMenu::TARGET_BLANK, 'showConfirmAlert' => false, 'exportConfig' => [ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_PDF => false], 'columnSelectorOptions' => ['class' => 'btn btn-primary btn-sm'], 'dropdownOptions' => ['label' => Yii::t('app', 'Export Data'), 'class' => 'btn btn-primary btn-sm']]);
?>
    
     </div>
    </div>
    </div>
</div>
Exemplo n.º 23
0
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
use yii\helpers\ArrayHelper;
use common\models\Scholar;
use common\models\School;
use common\models\Subject;
$exportedValues = [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'scholar_scholar_id'], ['attribute' => 'firstName', 'value' => 'scholarScholar.scholar_first_name'], ['attribute' => 'middleName', 'value' => 'scholarScholar.scholar_middle_name'], ['attribute' => 'lastName', 'value' => 'scholarScholar.scholar_last_name'], ['attribute' => 'scholar_school_school_id', 'value' => 'schoolSchool.school_name'], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'subject_term'], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'subject_name', 'editableOptions' => ['inputType' => '\\kartik\\select2\\Select2', 'options' => ['data' => ArrayHelper::map(Subject::find()->all(), 'subject_id', 'subject_name')]]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'subject_units'], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'subject_taken_status', 'editableOptions' => ['inputType' => 'dropDownList', 'pluginOptions' => ['allowClear' => true], 'data' => ["Not Taken" => "Not Taken", "Taken" => "Taken", "Failed" => "Failed"], 'widgetClass' => 'kartik\\select2\\Select2']], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'subject_approval_status', 'editableOptions' => ['inputType' => 'dropDownList', 'pluginOptions' => ['allowClear' => true], 'data' => ["Not Approved" => "Not Approved", "Approved" => "Approved"], 'widgetClass' => 'kartik\\select2\\Select2']], 'subject_approved_by', ['class' => 'kartik\\grid\\ActionColumn']];
$export = ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $exportedValues, 'noExportColumns' => [12], 'exportConfig' => ['Excel5' => false, 'Excel2007' => false], 'target' => '_blank', 'columnSelectorOptions' => ['label' => 'Columns', 'class' => 'btn btn-danger'], 'fontAwesome' => true, 'dropdownOptions' => ['label' => 'Export All', 'class' => 'btn btn-success']]);
/* @var $this yii\web\View */
/* @var $searchModel common\models\SchoolSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Subject';
$this->params['breadcrumbs'][] = $this->title;
?>
<h1><?php 
echo Html::encode($this->title);
?>
</h1>
<?php 
echo Html::a('Group By School', ['index'], ['class' => 'btn btn-success']);
echo Html::a('Show Only Subject Records', ['index2'], ['class' => 'btn btn-success']);
?>
<div class="school-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'columns' => $exportedValues, 'toolbar' => [['content' => Html::a('Create Subject', ['create'], ['class' => 'btn btn-success'])], '{toggleData}', $export], 'export' => ['fontAwesome' => true, 'label' => 'Export All', 'target' => '_blank'], 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => 'Subject List']]);
?>
</div>
Exemplo n.º 24
0
$this->title = 'База номеров';
?>

    <div id="mobileNumberIndexView">

        <?php 
echo Html::pageHeader($this->title);
?>

        <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>

        <?php 
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'exportConfig' => [ExportMenu::FORMAT_PDF => false], 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'formatter' => ['class' => \yii\i18n\Formatter::className(), 'nullDisplay' => ''], 'columns' => ['number', ['label' => 'Сотрудник', 'content' => function ($model) {
    return $model->owner ? $model->owner->fullName : "";
}], 'comment'], 'filename' => 'База сотовых номеров']);
?>

        <?php 
Pjax::begin(['formSelector' => 'form#numberSearchForm', 'id' => 'pjaxContainerForGridView']);
?>

        <?php 
echo $this->render('_gridview', ['dataProvider' => $dataProvider]);
?>

        <?php 
Pjax::end();
?>
Exemplo n.º 25
0
    <div class="pull-right">
        <?php 
echo Html::a('<span class="glyphicon glyphicon-list"></span> List', ['index'], ['class' => 'btn btn-default btn-xs']);
?>
        <?php 
if ($model->status_id == $model::STATUS_CREATED) {
    ?>
            <?php 
    /*= Html::a('<span class="glyphicon glyphicon-file"></span> Generate PDF', ['generate', 'id' => $model->id], [
          'class' => 'btn btn-success btn-xs showModalButton',
      ])*/
    ?>
            <?php 
    echo ExportMenu::widget(['target' => ExportMenu::TARGET_BLANK, 'showConfirmAlert' => false, 'showColumnSelector' => false, 'dropdownOptions' => ['label' => 'Export', 'class' => 'btn btn-success btn-xs'], 'dataProvider' => $tickets, 'columns' => [['attribute' => 'id', 'value' => 'fullName'], ['attribute' => 'bill_type_id', 'value' => 'billType'], ['attribute' => 'totalHours', 'format' => 'decimal'], ['label' => 'Billable Labor', 'format' => 'currency', 'value' => function ($m) {
        return $m->bill_type_id == $m::BILL_HOURLY ? $m->totalHours * \common\models\Labor::RATE : 0;
    }], ['attribute' => 'totalPurchases', 'format' => 'currency']]]);
    ?>
            <?php 
    if (Yii::$app->user->can('edit-invoices')) {
        ?>
                <?php 
        echo Html::a('<span class="glyphicon glyphicon-pencil"></span> Edit', ['update', 'id' => $model->id], ['class' => 'btn btn-info btn-xs showModalButton']);
        ?>
                <?php 
        echo Html::a('<span class="glyphicon glyphicon-trash"></span> Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger btn-xs', 'data-confirm' => 'Are you sure you want to delete this invoice and move the attached items back to the queue?', 'data-method' => 'post']);
        ?>
            <?php 
    }
    ?>
        <?php 
Exemplo n.º 26
0
    <?php 
Modal::begin(['header' => '<h4>Virtual</h4>', 'id' => 'modal', 'size' => 'modal-lg']);
echo "<div id='modalContent'></div>";
Modal::end();
?>

    <?php 
Modal::begin(['header' => '<h4>View Virtual</h4>', 'id' => 'modalView', 'size' => 'modal-lg']);
echo "<div id='modalContentView'></div>";
Modal::end();
?>
    
    <!-- export file  -->
    <?php 
$gridColoumns = ['name', 'description'];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'rowOptions' => function ($model) {
}]);
?>
    <p>
        <?php 
echo Html::button('Create Virtual', ['value' => Url::to('index.php?r=virtual/create'), 'class' => 'btn btn-success', 'id' => 'modalButton']);
?>
    </p>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'rowOptions' => function ($model) {
    if ($model->status == 1) {
        return ['class' => 'success'];
    } else {
        return ['class' => 'danger'];
    }
}, 'columns' => ['name', 'description', ['attribute' => 'Status', 'value' => function ($model) {
    return $model->status == 1 ? 'Active' : 'Inactive';
Exemplo n.º 27
0
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Enhanced Gii', ['create'], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('Advance Search', '#', ['class' => 'btn btn-info search-button']);
?>
    </p>
    <div class="search-form" style="display:none">
        <?php 
echo $this->render('_search', ['model' => $searchModel]);
?>
    </div>

    <?php 
$gridColumn = [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'id', 'hidden' => true], 'thought', 'goodness', 'rank', 'censorship', 'occurred', 'email:email', 'url:url', 'filename', 'avatar', ['class' => 'yii\\grid\\ActionColumn']];
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumn, 'pjax' => true, 'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container']], 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i>  ' . Html::encode($this->title) . ' </h3>'], 'export' => ['label' => 'Page', 'fontAwesome' => true], 'toolbar' => ['{export}', ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumn, 'target' => ExportMenu::TARGET_BLANK, 'fontAwesome' => true, 'dropdownOptions' => ['label' => 'Full', 'class' => 'btn btn-default', 'itemsBefore' => ['<li class="dropdown-header">Export All Data</li>']]])]]);
?>

</div>
Exemplo n.º 28
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use kartik\export\ExportMenu;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\PegawaiSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Pegawais';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pegawai-index">
    <?php 
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'nip', 'nama', 'pangkatgol', 'jabatan', ['class' => 'yii\\grid\\ActionColumn']], 'fontAwesome' => true, 'dropdownOptions' => ['label' => 'Export All', 'class' => 'btn btn-default']]);
?>

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a('Create Pegawai', ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
Exemplo n.º 29
0
<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
/* @var $this yii\web\View */
/* @var $searchModel common\models\IncentiveSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Incentives';
$this->params['breadcrumbs'][] = $this->title;
// echo $this->render('_search', ['model' => $searchModel]);
$exportedValues = [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'deduction_date'], ['attribute' => 'deduction_amount'], ['attribute' => 'deduction_remark'], ['class' => 'kartik\\grid\\ActionColumn']];
$export = ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $exportedValues, 'noExportColumns' => [0, 3], 'columnSelectorOptions' => ['label' => 'Columns', 'class' => 'btn btn-danger'], 'target' => '_blank', 'fontAwesome' => true, 'dropdownOptions' => ['label' => 'Export', 'class' => 'btn btn-success']]);
?>
				
<div class="incentive-index">

	<?php 
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'columns' => $exportedValues]);
?>

</div>
Exemplo n.º 30
0
<?php

use kartik\export\ExportMenu;
use kartik\grid\GridView;
use app\models\Person;
$gridColumns = ['fname', 'lname', 'email', 'gender', 'age', ['label' => 'Availability', 'format' => 'raw', 'value' => function ($data) use($model) {
    return Person::checkAvailability($data->id, $model->id);
}, 'visible' => $list_type_id == 1 ? 1 : 0], ['label' => 'Confirmed', 'format' => 'raw', 'value' => function ($data) use($model) {
    return Person::checkConfirmed($data->id, $model->id);
}, 'visible' => $list_type_id == 2 ? 2 : 0]];
echo ExportMenu::widget(['dataProvider' => $dataProvider, 'columns' => $gridColumns, 'asDropdown' => false, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'clearBuffers' => true, 'exportConfig' => [ExportMenu::FORMAT_CSV => ['linkOptions' => ['class' => 'btn btn-default']], ExportMenu::FORMAT_EXCEL_X => ['linkOptions' => ['class' => 'btn btn-default']], ExportMenu::FORMAT_TEXT => false, ExportMenu::FORMAT_EXCEL => false, ExportMenu::FORMAT_HTML => false, ExportMenu::FORMAT_PDF => false]]);
?>

<a target="_blank" href="/project/render-pdf/<?php 
echo $model->id;
?>
/<?php 
echo $list_type_id;
?>
" class="btn btn-default"> <i class="text-danger glyphicon glyphicon-floppy-open"></i> PDF </a>