Ejemplo n.º 1
0
 public function init()
 {
     //$accHist = new AccHist('search');
     //$accHist->dt=today 00:00:00 > now > today 23:59:59
     $this->content = \app\widgets\GridView::widget(array('id' => 'acchist-grid', 'dataProvider' => $this->search(), 'layout' => '{items}{pager}', 'panel' => false, 'columns' => array(array('attribute' => 'account_id', 'value' => function ($data) {
         return \yii\helpers\Html::a(\yii\helpers\Html::encode(isset($data->account) ? $data->account->name : $data->account_id), \yii\helpers\BaseUrl::base() . ("/accounts/view/" . $data->account_id));
     }, 'format' => 'raw'), 'dt', array('attribute' => 'details', 'format' => 'raw', 'value' => function ($data) {
         return $data->brief();
     }))), true);
     //parent::init();
 }
Ejemplo n.º 2
0
 public function init()
 {
     //$docs->=status=?? open??
     $this->content = \app\widgets\GridView::widget(array('id' => 'docs-grid', 'dataProvider' => $this->search(), 'layout' => '{items}{pager}', 'panel' => false, 'columns' => array(array('attribute' => 'doctype', 'value' => function ($data) {
         return \yii\helpers\html::a(\yii\helpers\html::encode((isset($data->docType) ? Yii::t("app", $data->docType->name) : "") . " #" . $data->docnum), \yii\helpers\BaseUrl::base() . ("/docs/view/" . $data->id));
     }, 'format' => 'raw'), array('attribute' => 'account_id', 'value' => function ($data) {
         return \yii\helpers\html::a(yii\helpers\html::encode($data->company), \yii\helpers\BaseUrl::base() . ("/accounts/transaction/" . $data->account_id));
     }, 'format' => 'raw'), 'total', array('attribute' => 'status', 'value' => function ($data) {
         return isset($data->docStatus) ? $data->docStatus->name : "";
     }))), true);
     //parent::init();
 }
Ejemplo n.º 3
0
 public function init()
 {
     //$docs = new Docs('search');
     $this->content = \app\widgets\GridView::widget(array('id' => 'sales-grid', 'dataProvider' => $this->search(), 'layout' => '{items}{pager}', 'panel' => false, 'columns' => array(array('attribute' => 'account_id', 'value' => function ($data) {
         return \yii\helpers\html::a(\yii\helpers\html::encode($data->company), \yii\helpers\BaseUrl::base() . ("/accounts/view/" . $data->account_id));
     }, 'format' => 'raw'), array('attribute' => 'docnum', 'value' => function ($data) {
         return \yii\helpers\html::a(\yii\helpers\html::encode($data->total), \yii\helpers\BaseUrl::base() . ("/docs/view/" . $data->id));
     }, 'format' => 'raw'), array('attribute' => 'due_date', 'value' => function ($data) {
         return $data->due_date;
     }))), true);
     //parent::init();
 }
Ejemplo n.º 4
0
<?php

use app\widgets\app\widgets\MiniForm;
use app\widgets\GridView;
$this->params["breadcrumbs"] = array(['label' => Yii::t('app', 'Item Categories'), array('index')], ['label' => Yii::t('app', 'Manage')]);
$this->params["menu"] = array(array('label' => Yii::t('app', 'List Item Category'), 'url' => array('index')), array('label' => Yii::t('app', 'Create Item Category'), 'url' => array('create')));
app\widgets\MiniForm::begin(array('header' => Yii::t('app', "Manage Item Categories")));
?>


<?php 
echo app\widgets\GridView::widget(array('id' => 'itemcategory-grid', 'dataProvider' => $model->dp(), 'columns' => array('id', 'name', 'profit', array('class' => 'yii\\grid\\ActionColumn'))));
app\widgets\MiniForm::end();
Ejemplo n.º 5
0
 * The contents of this file are subject to the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
 * ("License"); You may not use this file except in compliance with the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
 * The Original Code is:  Linet 3.0 Open Source
 * The Initial Developer of the Original Code is Adam Ben Hur.
 * All portions are Copyright (C) Adam Ben Hur.
 * All Rights Reserved.
 * ********************************************************************************** */
yii\widgets\Pjax::begin(['id' => 'docs-grid-pjax']);
$model = new \app\models\Docs();
$model->scenario = 'search';
//$model->unsetAttributes();
//$var=\yii\helpers\Html::link(\yii\helpers\Html::encode($data->docnum),"#", array("onclick"=>'refNum('.\yii\helpers\Json::encode($data).')'));
echo \app\widgets\GridView::widget(['id' => 'docs-grid', 'dataProvider' => $model->search(Yii::$app->request->get()), 'layout' => '{items}{pager}', 'panel' => false, 'filterModel' => $model, 'columns' => array(['attribute' => 'doctype', 'filter' => \yii\helpers\ArrayHelper::map(\app\models\Doctype::find()->All(), 'id', 'name'), 'value' => function ($data) {
    return $data->TypeName();
}, 'options' => ['style' => 'width:35%;']], ['attribute' => 'docnum', 'value' => function ($data) {
    return \yii\helpers\Html::a(\yii\helpers\Html::encode($data->docnum), "#", array("onclick" => 'refNum(' . \yii\helpers\Json::encode($data) . ')'));
}, 'format' => 'raw', 'options' => ['style' => 'width:5%;']], 'company', ['attribute' => 'status', 'value' => function ($data) {
    return $data->docStatus->name;
}, 'options' => ['style' => 'width:8%;']], array('attribute' => 'total', 'options' => ['style' => 'width:8%;']))]);
?>
<script type="text/javascript">
    
    jQuery("#docs-grid-pjax").on('pjax:timeout', function(e){
        e.preventDefault();
    }).on('pjax:send', function(){
        jQuery("#docs-grid-container").addClass('kv-grid-loading');
    }).on('pjax:complete', function(){
            //setTimeout(kvGridInit_34655f25(), 2500);
            jQuery("#docs-grid-container").removeClass('kv-grid-loading');
        });