toRoute() public static méthode

This method will use UrlManager to create a URL. You may specify the route as a string, e.g., site/index. You may also use an array if you want to specify additional query parameters for the URL being created. The array format must be: php generates: /index.php?r=site/index¶m1=value1¶m2=value2 ['site/index', 'param1' => 'value1', 'param2' => 'value2'] If you want to create a URL with an anchor, you can use the array format with a # parameter. For example, php generates: /index.php?r=site/index¶m1=value1#name ['site/index', 'param1' => 'value1', '#' => 'name'] A route may be either absolute or relative. An absolute route has a leading slash (e.g. /site/index), while a relative route has none (e.g. site/index or index). A relative route will be converted into an absolute one by the following rules: - If the route is an empty string, the current [[\yii\web\Controller::route|route]] will be used; - If the route contains no slashes at all (e.g. index), it is considered to be an action ID of the current controller and will be prepended with [[\yii\web\Controller::uniqueId]]; - If the route has no leading slash (e.g. site/index), it is considered to be a route relative to the current module and will be prepended with the module's [[\yii\base\Module::uniqueId|uniqueId]]. Starting from version 2.0.2, a route can also be specified as an alias. In this case, the alias will be converted into the actual route first before conducting the above transformation steps. Below are some examples of using this method: php /index.php?r=site%2Findex echo Url::toRoute('site/index'); /index.php?r=site%2Findex&src=ref1#name echo Url::toRoute(['site/index', 'src' => 'ref1', '#' => 'name']); http://www.example.com/index.php?r=site%2Findex echo Url::toRoute('site/index', true); https://www.example.com/index.php?r=site%2Findex echo Url::toRoute('site/index', 'https'); /index.php?r=post%2Findex assume the alias "@posts" is defined as "post/index" echo Url::toRoute('@posts');
public static toRoute ( string | array $route, boolean | string $scheme = false ) : string
$route string | array use a string to represent a route (e.g. `index`, `site/index`), or an array to represent a route with query parameters (e.g. `['site/index', 'param1' => 'value1']`).
$scheme boolean | string the URI scheme to use in the generated URL: - `false` (default): generating a relative URL. - `true`: returning an absolute base URL whose scheme is the same as that in [[\yii\web\UrlManager::$hostInfo]]. - string: generating an absolute URL with the specified scheme (either `http`, `https` or empty string for protocol-relative URL).
Résultat string the generated URL
 public static function toRoute($route, $scheme = false)
 {
     $route[0] = ltrim($route[0], '/');
     if (substr_count($route[0], '/') == 2) {
         $route[0] = '/' . $route[0];
     }
     return "/" . I("__orgcode") . parent::toRoute($route, $scheme);
 }
Exemple #2
0
Pjax::begin();
echo GridView::widget(['layout' => '{summary}<div class="table-responsive">{items}</div>{pager}', 'options' => ['class' => 'grid-view col-xs-12'], 'tableOptions' => ['class' => 'table table-bordered'], 'showFooter' => true, 'pager' => ['options' => ['class' => 'pagination pagination-bottom'], 'maxButtonCount' => 6], 'dataProvider' => new ActiveDataProvider(['query' => $dataQuery, 'pagination' => ['pagesize' => 10]]), 'columns' => [['label' => Yii::t('fin.grid', 'Ref'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    $pagination = $column->grid->dataProvider->pagination;
    $html = $pagination->page * $pagination->pageSize + $index + 1;
    $html .= '<br/>' . str_pad($model->id, 6, '0', STR_PAD_LEFT);
    return $html;
}], ['label' => Yii::t('fin.grid', 'Status'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) use($arrCustomerStatus) {
    $status = isset($arrCustomerStatus[$model->status]) ? $arrCustomerStatus[$model->status] : '';
    $html = '<span>' . $status . '</span>';
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $arrBtns = [];
    $entryId = $model->id;
    $urlEdit = BaseUrl::toRoute(['customer/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['customer/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html .= '<br/><div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
    $html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}], ['label' => Yii::t('fin.grid', 'Balance'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'format' => 'raw', 'value' => function ($model) {
    $labelClass = $model->balance < 0 ? 'label-danger' : 'label-info';
    $labelValue = NumberUtils::format(abs($model->balance));
    return StringUtils::format('{2}<br/><span class="label {0} pull-right">{1}</span>', [$labelClass, $labelValue, $model->name]);
}, 'footer' => NumberUtils::getIncDecNumber($sumCustomerValue['balance'], ['template' => '<span class="label pull-right {color}">{number}</span>', 'incColor' => 'label-info', 'decColor' => 'label-danger'])]]]);
 /**
  * @param string $id The id of the widget
  * @param \yii\data\BaseDataProvider $dataProvider The dataprovider for the widget
  * @param \Closure $filter The filter to manipulate the data.
  * @return array The data required to create the list and pagination.
  */
 protected static function getData($id, $dataProvider, $filter)
 {
     $data = ['id' => $id];
     $data['count'] = $dataProvider->getCount();
     if (($pagination = $dataProvider->getPagination()) !== false) {
         $data['totalCount'] = $dataProvider->getTotalCount();
         $data['begin'] = $pagination->getPage() * $pagination->pageSize + 1;
         $data['end'] = $data['begin'] + $data['count'] - 1;
         if ($data['begin'] > $data['end']) {
             $data['begin'] = $data['end'];
         }
         $data['page'] = $pagination->getPage() + 1;
         $data['pageCount'] = $pagination->pageCount;
     } else {
         $data['totalCount'] = $dataProvider->getTotalCount();
         $data['pageCount'] = 1;
         $data['page'] = 1;
         $data['begin'] = $data['page'] = $data['pageCount'] = 1;
         $data['end'] = $data['totalCount'] = $data['count'];
     }
     $pagination = $dataProvider->getPagination();
     if ($pagination !== false) {
         $data['pageParam'] = $pagination->pageParam;
         $data['pageSizeParam'] = $pagination->pageSizeParam;
         $data['pageSizeLimit'] = $pagination->pageSizeLimit;
         $data['pageLinks'] = $pagination->getLinks();
         $currentPage = $pagination->getPage();
         $pageCount = $pagination->getPageCount();
         $maxButtonCount = 10;
         $beginPage = max(0, $currentPage - (int) ($maxButtonCount / 2));
         if (($endPage = $beginPage + $maxButtonCount - 1) >= $pageCount) {
             $endPage = $pageCount - 1;
             $beginPage = max(0, $endPage - $maxButtonCount + 1);
         }
         for ($i = $beginPage; $i <= $endPage; $i++) {
             $data['pages'][] = ['pageNo' => $i + 1, 'pageUrl' => $pagination->createUrl($i)];
         }
     }
     $sort = $dataProvider->getSort();
     if (!($sort === false || empty($sort->attributes) || $dataProvider->getCount() <= 0)) {
         $attributes = array_keys($sort->attributes);
         $data['sort'] = [];
         foreach ($attributes as $name) {
             $data['sort'][] = ['name' => $name, 'link' => $sort->createUrl($name)];
         }
     }
     $models = $dataProvider->getModels();
     if ($models) {
         $data['labels'] = $models[0]->attributeLabels();
     }
     $controller = Yii::$app->controller->id;
     foreach ($models as $key => $model) {
         $data['items'][$key] = $filter ? $filter($model) : $model->attributes;
         $data['items'][$key]['actions'] = ['viewUrl' => BaseUrl::toRoute(["{$controller}/view", 'id' => $model->primaryKey]), 'viewTitle' => Yii::t('app', 'View'), 'updateUrl' => BaseUrl::toRoute(["{$controller}/update", 'id' => $model->primaryKey]), 'updateTitle' => Yii::t('app', 'Update'), 'deleteUrl' => BaseUrl::toRoute(["{$controller}/delete", 'id' => $model->primaryKey]), 'deleteTitle' => Yii::t('app', 'Delete')];
     }
     return $data;
 }
Exemple #4
0
  <script type="text/javascript">


    $("#submit_button").click(function(){
      $("#loading").show();
      $("#show_data").empty();

      var regional = $('#regional').val();
      var area = $('#area').val();
      var provinsi = $('#provinsi').val();
      var kota = $('#kota').val();
      var nontelkom = $('#nontelkom').val();
      $.ajax({
        type: "POST",
        url: "<?php 
    echo BaseUrl::toRoute('getdata');
    ?>
",
        data: {regional:regional,area:area,provinsi:provinsi,kota:kota},
        success: function(data)
        {
          $("#loading").hide();
          $('#show_data').html(data);
          $('#regional').val(regional);
        },
        error : function(data){
          $("#loading").hide();
          $('#show_data').show();
        }
      });
    });
Exemple #5
0
}, 'value' => function ($model) use($arrCurrentAssets) {
    return isset($arrCurrentAssets[$model->current_assets]) ? $arrCurrentAssets[$model->current_assets] : '';
}, 'footer' => $htmlFooterAdding], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $lblCopy = Yii::t('button', 'Copy');
    $arrBtns = [];
    $entryId = $model->transactions_id;
    $urlEdit = BaseUrl::toRoute(['deposit/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['deposit/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $urlCopy = BaseUrl::toRoute(['deposit/copy', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
    $html = '<div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
    $html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}]]]);
Pjax::end();
?>
</div>
	<?php 
Exemple #6
0
    }

  }
  $(document).ready(function (){

    $("#button_submit").click(function(){
      var name = $("#name").val();
      var username = $("#username").val();
      var password = $("#password").val();

      if(name != '' && username != '' && password != ''){
          $.ajax({
            type : "POST",
            url : "<?php 
echo BaseUrl::toRoute('save');
?>
",
            data: {name:name,username:username,password:password},
            success: function(data){
              console.log("sukses");
              window.location.reload();
            },
            error: function(data){
              console.log("gagal");
            }
          });
      }else{
        alert("Ooops ! these field with (*) cannot be empty")
      }
    });
Exemple #7
0
    return NumberUtils::format($model->share_value);
}, 'footer' => $htmlFooterShareValue], ['label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left; max-width:280px', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return $model->description;
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $arrBtns = [];
    $entryId = $model->share_id;
    $urlEdit = BaseUrl::toRoute(['distribute/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['distribute/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html = '<div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
    $html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}]]]);
Pjax::end();
?>
</div>
    <?php 
use app\modules\yboard\YBoard;
?>
<div class="container">
    <div class="row">
        <div class="col-md-1" style="padding:5px 0 0 5px;">
            <?php 
if (!\Yii::$app->user->isGuest) {
    echo Html::a(YBoard::t('yboard', 'Mark all read'), ['forum/mark-all-read'], ['class' => 'btn btn-warning btn-xs']);
}
?>
        </div>
        
        <div class="col-md-7 hidden-xs">
        </div>
        
        <div class="col-md-4 hidden-xs" style="padding:5px 0 5px 5px;">
            <?php 
echo Html::dropDownList('yboard-jumpto', '', ArrayHelper::map(YBoardForum::getForumOptions(Yii::$app->user->isGuest, Yii::$app->user->id), 'id', 'name', 'group'), ['empty' => YBoard::t('yboard', 'Select forum'), 'onchange' => "\n                        group = \$(this.options[this.selectedIndex]).closest('optgroup').prop('label');\n                        window.location.href='" . BaseUrl::toRoute(['forum']) . "?id='+\$(this).val()", 'class' => 'form-control', 'id' => 'forum-categories-list']);
?>
  

            <?php 
if (isset($_GET['id'])) {
    $this->registerJs("\$('#forum-categories-list option[value=" . $_GET['id'] . "]').prop('selected', true);");
}
?>
 
        </div>
    </div>
</div>
Exemple #9
0
    $("#show_data").empty();

    var regional = $('#regional').val();
    var area = $('#area').val();
    var provinsi = $('#provinsi').val();
    var kota = $('#kota').val();
    var badan_hukum = $('#badan_hukum').val();
    var bidang_usaha = $('#bidang_usaha').val();
    var omset = $('#omzet').val();
    var jml_cabang = $('#jml_cabang').val();
    var jml_pegawai = $('#jml_pegawai').val();
    var jml_komp = $('#jml_komp').val();
    $.ajax({
      type: "POST",
      url: "<?php 
echo BaseUrl::toRoute('postprospek');
?>
",
      data: {regional:regional,area:area,provinsi:provinsi,kota:kota,badanhukum:badan_hukum,bidangusaha:bidang_usaha,omset:omset,jmlcabang:jml_cabang,jmlpegawai:jml_pegawai,jmlkomp:jml_komp},
      success: function(data)
      {
        $("#loading").hide();
        $('#show_data').html(data);
        $('#regional').val(regional);
      },
      error : function(data){
        $("#loading").hide();
        $('#show_data').show();
      }
    });
  });
Exemple #10
0
}, 'footer' => $htmlFooterOtherFee], ['label' => Yii::t('fin.grid', 'Investment'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return NumberUtils::format($model->purchase + $model->transfer_fee + $model->other_fee);
}, 'footer' => $htmlFooterInvestment], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $urlEdit = null;
    $arrBtns = [];
    $entryId = $model->id;
    $urlEdit = BaseUrl::toRoute(['purchase/update', 'id' => $model->id]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['purchase/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html = '<div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
    $html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}]]]);
Pjax::end();
?>
</div>
    <?php 
Exemple #11
0
    $html = '<span class="' . ($model->entry_status == MasterValueUtils::MV_JAR_ENTRY_TYPE_TEMP ? 'text-red' : '') . '">' . $html . '<span>';
    return $html;
}, 'footer' => Yii::t('fin.grid', 'Total')], ['label' => Yii::t('fin.grid', 'Date'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) {
    $html = DateTimeUtils::htmlDateFormatFromDB($model->entry_date, DateTimeUtils::FM_VIEW_DATE, true);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $urlEdit = null;
    $arrBtns = [];
    $entryId = $model->id;
    if ($model->share_id > 0) {
        $urlEdit = BaseUrl::toRoute(['distribute/update', 'id' => $model->share_id]);
    } else {
        $urlEdit = BaseUrl::toRoute(['payment/update', 'id' => $entryId]);
    }
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['payment/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html .= '<br/><div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
    $html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}, 'footer' => $htmlFooterDate], ['label' => Yii::t('fin.grid', 'Credit / Debit'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left; min-width:162px'], 'format' => 'raw', 'value' => function ($model) use($arrAccount) {
    $htmls = [];
    $htmlCredit = isset($arrAccount[$model->account_target]) ? $arrAccount[$model->account_target] : '';
    if (!empty($htmlCredit)) {
        $amount = $model->account_target == 0 ? '' : NumberUtils::format($model->entry_value);
/* @var $this \yii\web\View */
/* @var $content string */
$this->beginContent('@frontend/views/layouts/_clear.php');
?>


    <?php 
echo $content;
?>
<div class="xfk" id="js_xfk">
<ul>
<li><a href="<?php 
echo BaseUrl::toRoute('/learn');
?>
"><img src="/frontend/web/img/a1.png"/><br/><span>新手学堂</span></a></li>
<li><a href="<?php 
echo BaseUrl::toRoute('/user');
?>
"><img src="/frontend/web/img/a2.png"/><br/><span>会员中心</span></a></li>
<li><a href="<?php 
echo BaseUrl::toRoute('my-click/index');
?>
"><img src="/frontend/web/img/a3.png"/><br/><span>我的点击</span></a></li>
<li><a href="<?php 
echo BaseUrl::toRoute('vip/get-pay');
?>
"><img src="/frontend/web/img/a4.png"/><br/><span>提取佣金</span></a></li>
</ul>
</div>
<?php 
$this->endContent();
Exemple #13
0
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html .= '<br/><div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
    $html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}, 'footer' => $htmlFooterCredit], ['label' => Yii::t('fin.grid', 'Credit / Debit'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left'], 'format' => 'raw', 'value' => function ($model) {
    $htmls = [];
    if ($model->credit > 0) {
        $htmls[] = '<span class="label label-info pull-right">' . NumberUtils::format($model->credit) . '</span>';
    }
    if ($model->debit > 0) {
        $htmls[] = '<span class="label label-danger pull-right">' . NumberUtils::format($model->debit) . '</span>';
    }
    return implode('<br/>', $htmls);
}, 'footer' => $htmlFooterDebit], ['label' => Yii::t('fin.grid', 'Bill Date'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) {
    if ($model->order_id > 0 && !is_null($model->bill_date)) {
        $urlEdit = BaseUrl::toRoute(['bill/update', 'id' => $model->order_id]);
        return StringUtils::format('<a href="{0}">{1}</a>', [$urlEdit, DateTimeUtils::htmlDateFormatFromDB($model->bill_date, DateTimeUtils::FM_VIEW_DATE, true)]);
    }
    return '';
}]]]);
Pjax::end();
?>
</div></div>
</div></div></div>
Exemple #14
0
    switch ($model->entry_status) {
        case MasterValueUtils::MV_FIN_ENTRY_TYPE_SIMPLE:
            $urlEdit = BaseUrl::toRoute(['payment/update', 'id' => $entryId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
            $urlView = BaseUrl::toRoute(['payment/view', 'id' => $entryId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
            $urlCopy = BaseUrl::toRoute(['payment/copy', 'id' => $entryId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
            break;
        case MasterValueUtils::MV_FIN_ENTRY_TYPE_DEPOSIT:
        case MasterValueUtils::MV_FIN_ENTRY_TYPE_INTEREST_DEPOSIT:
            $urlEdit = BaseUrl::toRoute(['deposit/update', 'id' => $timeDepositTranId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
            $urlView = BaseUrl::toRoute(['deposit/view', 'id' => $timeDepositTranId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
            $urlCopy = BaseUrl::toRoute(['deposit/copy', 'id' => $timeDepositTranId]);
            $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
            break;
        default:
            break;
    }
    $html = '<div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
    $html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}]]]);
Exemple #15
0
<?php

use yii\helpers\Html;
?>
<h2>You want information?</h2>
<div class="block"> 
<?php 
echo HTML::a('Отчёт 2014', \yii\helpers\BaseUrl::toRoute(\Yii::$app->getModule('diary')->fourteenUrl[0] . "?year=2014"), ['title' => "", 'style' => 'text-decoration: none;']);
?>
 </div>
<div class="block"> 
<?php 
echo HTML::a('Отчёт 2015', \yii\helpers\BaseUrl::toRoute(\Yii::$app->getModule('diary')->fourteenUrl[0] . "?year=2015"), ['title' => "", 'style' => 'text-decoration: none;']);
?>
 
</div>
Exemple #16
0
Pjax::begin();
echo GridView::widget(['layout' => '{summary}<div class="table-responsive">{items}</div>{pager}', 'options' => ['class' => 'grid-view col-xs-12'], 'tableOptions' => ['class' => 'table table-bordered'], 'pager' => ['options' => ['class' => 'pagination pagination-bottom'], 'maxButtonCount' => 6], 'dataProvider' => new ActiveDataProvider(['query' => $dataQuery, 'pagination' => ['pagesize' => 20]]), 'columns' => [['label' => Yii::t('fin.grid', 'Ref'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    $pagination = $column->grid->dataProvider->pagination;
    $html = $pagination->page * $pagination->pageSize + $index + 1;
    $html .= '<br/>' . str_pad($model->nav_id, 6, '0', STR_PAD_LEFT);
    return $html;
}], ['label' => Yii::t('fin.grid', 'Trade'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) {
    $html = DateTimeUtils::htmlDateFormatFromDB($model->trade_date, DateTimeUtils::FM_VIEW_DATE, true);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $urlEdit = null;
    $arrBtns = [];
    $entryId = $model->nav_id;
    $urlEdit = BaseUrl::toRoute(['nav/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['nav/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $html .= '<br/><div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
    $html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}], ['label' => Yii::t('fin.grid', 'Nav / Prev'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left;'], 'format' => 'raw', 'value' => function ($model) {
    $htmls = [];
    $navPrev = NumberUtils::format($model->nav_value_prev, 2);
    $htmls[] = '<span class="label label-info pull-right">' . $navPrev . '</span>';
    $nav = NumberUtils::format($model->nav_value, 2);
Exemple #17
0
    $days = ($interval->invert === 1 ? 1 : -1) * $interval->days + 1;
    return NumberUtils::format($model->interest_unit * $days, 2);
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $lblCopy = Yii::t('button', 'Copy');
    $arrBtns = [];
    $entryId = $model->id;
    $urlEdit = BaseUrl::toRoute(['interest/update', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['interest/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
    $urlCopy = BaseUrl::toRoute(['interest/copy', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
    $html = '<div class="btn-group">';
    $html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
    $html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
    $html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
    $html .= '</button>';
    $html .= '<ul class="dropdown-menu" role="menu">';
    $html .= implode('', $arrBtns);
    $html .= '</ul></div>';
    return $html;
}]]]);
Pjax::end();
?>
</div>
    </div>