本文整理汇总了PHP中kartik\widgets\DatePicker::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP DatePicker::widget方法的具体用法?PHP DatePicker::widget怎么用?PHP DatePicker::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\widgets\DatePicker
的用法示例。
在下文中一共展示了DatePicker::widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: genField
private function genField($name, $setting, $options)
{
if (preg_match("/number|string/i", $setting->type)) {
return Html::textInput($name, $setting->value, $options);
} elseif (preg_match("/text/i", $setting->type)) {
return Html::textArea($name, $setting->value, $options);
} elseif (preg_match("/bool/i", $setting->type)) {
return Html::checkBox($name, $setting->value, array_merge($options, $this->checkboxOptions, ['template' => '']));
} elseif (preg_match("/dropdown/i", $setting->type)) {
$data = @unserialize($setting->options);
$data = is_array($data) ? $data : [];
return Html::dropDownList($name, $setting->value, $data, $options);
} elseif (preg_match("/radiolist/i", $setting->type)) {
$data = @unserialize($setting->options);
$data = is_array($data) ? $data : [];
$template = $this->radioTemplate;
$this->radioOptions['item'] = !$this->radioCallback ? function ($index, $label, $name, $checked, $value) use($template) {
return strtr($template, ['{input}' => Html::radio($name, $checked, ['value' => $value]), '{labelText}' => $label]);
} : $this->radioCallback;
return Html::radioList($name, $setting->value, $data, array_merge($options, $this->radioOptions));
} elseif (preg_match("/{dateradiolist}/i", $setting->type)) {
$data = @unserialize($setting->options);
$data = is_array($data) ? $data : [];
$template = $this->radioTemplate;
$this->radioOptions['item'] = function ($index, $label, $name, $checked, $value) use($template) {
return strtr($template, ['{input}' => Html::radio($name, $checked, ['value' => $value]), '{labelText}' => date($value, time())]);
};
return Html::radioList($name, $setting->value, array_combine($data, $data), array_merge($options, $this->radioOptions));
} elseif (preg_match("/timezone/i", $setting->type)) {
return Html::dropDownList($name, $setting->value, $this->getTimezones(), $options);
} elseif (preg_match("/date/i", $setting->type)) {
return DatePicker::widget(['name' => $name, 'type' => DatePicker::TYPE_INPUT, 'value' => date('d-m-Y', strtotime($setting->value)), 'pluginOptions' => ['autoclose' => true, 'format' => 'dd-M-yyyy']]);
} else {
return Html::textArea($name, $setting->value, $options);
}
}
示例2:
<div class="form-group">
<?php
if ($label) {
?>
<label class="control-label"><?php
echo $label;
?>
</label><?php
}
?>
<?php
echo \kartik\widgets\DatePicker::widget(['name' => $name, 'value' => $value ? $value : "", 'options' => ['placeholder' => 'выберите дату', 'data-name' => $name], 'pluginOptions' => ['format' => 'dd.mm.yyyy', 'todayHighlight' => true]]);
?>
</div>
示例3: array
'name'=>'date_range',
'id'=>'id_date_range',
'language'=>'zh',
'convertFormat'=>true,
'pluginOptions'=>[
'timePicker'=>false,
// 'timePickerIncrement'=>30,
// 'format'=>'Y-m-d h:i A'
'format'=>'Y-m-d',
'separator'=>'_'
]
]);
*/
if (empty($cur_date)) {
echo '<label class="control-label">请输入时间范围</label>';
echo DatePicker::widget(['name' => 'date_start', 'value' => $date_start, 'options' => ['id' => 'id_date_start'], 'type' => DatePicker::TYPE_RANGE, 'name2' => 'date_end', 'value2' => $date_end, 'options2' => ['id' => 'id_date_end'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd', 'language' => 'zh-CN']]);
}
?>
</p>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterSelector' => '#id_date_start, #id_date_end', 'filterModel' => $filter, 'options' => ['class' => 'table-responsive'], 'tableOptions' => ['class' => 'table table-striped'], 'columns' => [['label' => '渠道编号', 'attribute' => 'id', 'headerOptions' => array('style' => 'width:15%;'), 'filter' => true, 'visible' => false], ['label' => '渠道名称', 'attribute' => 'title', 'headerOptions' => array('style' => 'width:25%;')], ['label' => '渠道推广数量', 'attribute' => 'cnt_sum', 'headerOptions' => array('style' => 'width:20%;')]], 'bordered' => false, 'export' => false, 'panel' => ['heading' => "<h3 class=\"panel-title\"> </h3>", 'type' => 'default', 'before' => Html::a('下载 <i class="glyphicon glyphicon-arrow-down"></i>', Url::to() . '&channelscoretopxdownload=1', ['class' => 'btn btn-success']), 'showFooter' => false]]);
?>
</div>
<?php
/*
[
'label' => '渠道类别',
'attribute' => 'cat',
示例4:
//= $form->field($model, 'created')->textInput()
?>
<?php
//= $form->field($model, 'updated')->textInput()
?>
<table width="100%">
<tr>
<td style="width: 270px; vertical-align: top">
<div>
<label>Плановая дата</label>
<div class="well well-sm" style="background-color: #fff; width:245px;">
<?php
echo DatePicker::widget(['model' => $model, 'attribute' => 'plan_date', 'type' => DatePicker::TYPE_INLINE, 'language' => 'ru', 'pluginOptions' => ['format' => 'yyyy-mm-dd']]);
?>
</div>
</div>
</td>
<td style="vertical-align: top">
<?php
echo $form->field($model, 'client')->dropDownList(Clients::getClients());
?>
<?php
//= $form->field($model, 'client')->textInput(['maxlength' => true])
?>
<?php
//= $form->field($model, 'plan_date')->textInput()
?>
示例5:
<div class="col col1">
<label>First Name</label>
<?php
echo $form->field($user, 'fname')->textInput(['value' => $user->fname, 'class' => 'form-control'])->label(false);
?>
</div>
<div class="col col2">
<label>Last Name</label>
<?php
echo $form->field($user, 'lname')->textInput(['value' => $user->lname, 'class' => 'form-control'])->label(false);
?>
</div>
<div class="col col3">
<?php
echo '<label class="control-label">Date of Birth</label>';
echo DatePicker::widget(['name' => 'UserProfile[DOB]', 'value' => '01/01/1990', 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd/mm/yyyy']]);
?>
</div>
</div>
<div class="col-3 clearfix">
<div class="col col1">
<label>Gender</label>
<?php
echo $form->field($model, 'gender')->dropDownList(['0' => 'Select', 'M' => 'Male', 'F' => 'Female'], ['class' => 'singleSelectBox'])->label(false);
?>
</div>
<div class="col col2">
<label>Mobile Number</label>
<?php
echo $form->field($user, 'phone')->textInput(['value' => $user->phone, 'class' => 'form-control'])->label(false);
?>
示例6:
?>
<?php
echo $form->field($implink, 'url')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'logo')->fileInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'banner')->fileInput(['maxlength' => true]);
?>
<?php
echo '<label class="control-label">Establish</label>';
echo DatePicker::widget(['name' => 'College[establish]', 'value' => '01/01/1990', 'pluginOptions' => ['autoclose' => true, 'todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd/mm/yyyy']]);
?>
<?php
echo $form->field($addresmodel, 'address')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($addresmodel, 'landmark')->textInput(['maxlength' => true]);
?>
<?php
if (empty($addresmodel->country_id)) {
$addresmodel->country_id = 'IND';
}
$coutrylist = ArrayHelper::map(\common\models\Countries::findAll(['is_visible' => 1, 'status' => 1]), 'countryID', 'countryName');
示例7:
echo Html::activeDropDownList($model, "[{$num}]tipDokumenta", TipDokumentaObObrazovanii::namesMap(), ['class' => 'form-control']);
echo Html::tag('div', $model->getFirstError('tipDokumenta'), ['class' => 'help-block']);
echo '</div>';
echo '<div class="col-md-4 no-right-padding ' . (($model->hasErrors('kvalifikaciyaId') or $model->hasErrors('kvalifikaciyaNazvanie')) ? 'has-error' : '') . '">';
echo Select3::widget(['model' => $model, 'attribute' => "[{$num}]kvalifikaciyaId", 'secondAttribute' => "[{$num}]kvalifikaciyaNazvanie", 'data' => $kvalifikaciya, 'placeholder' => 'Выберите квалификацию', 'secondPlaceholder' => 'Введите наименование квалификации']);
echo '</div>';
echo '<div class="col-md-3 no-left-padding field-seriya ' . ($model->hasErrors('seriya') ? 'has-error' : '') . '">';
echo Html::activeLabel($model, "[{$num}]seriya");
echo Html::activeTextInput($model, "[{$num}]seriya", ['class' => 'form-control', 'placeholder' => '', 'maxlength' => 40]);
echo Html::tag('div', $model->getFirstError('seriya'), ['class' => 'help-block']);
echo '</div>';
echo '<div class="col-md-3 ' . ($model->hasErrors('nomer') ? 'has-error' : '') . '">';
echo Html::activeLabel($model, "[{$num}]nomer");
echo Html::activeTextInput($model, "[{$num}]nomer", ['class' => 'form-control', 'maxlength' => 40]);
echo Html::tag('div', $model->getFirstError('nomer'), ['class' => 'help-block']);
echo '</div>';
echo '<div class="col-md-3 ' . ($model->hasErrors('dataVidachi') ? 'has-error' : '') . '">';
echo Html::activeLabel($model, '[{$num}]dataVidachi');
echo DatePicker::widget(['model' => $model, 'attribute' => "[{$num}]dataVidachi", 'language' => 'ru', 'type' => DatePicker::TYPE_COMPONENT_PREPEND, 'pluginOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy'], 'options' => ['placeholder' => 'Выберите дату выдачи']]);
echo Html::tag('div', $model->getFirstError('dataVidachi'), ['class' => 'help-block']);
echo '</div>';
echo '<div class="col-md-3 no-right-padding ' . ($model->hasErrors('documentKopiya') ? 'has-error' : '') . '">';
echo Html::activeLabel($model, "[{$num}]documentKopiya");
echo \app\widgets\Files2Widget::widget(['model' => $model, 'attribute' => "[{$num}]documentKopiya"]);
echo Html::tag('div', $model->getFirstError('documentKopiya'), ['class' => 'help-block']);
echo Html::activeHiddenInput($model, "[{$num}]udalit", ['class' => 'udalit_input']);
echo '</div>';
//panel-body end
echo '</div>';
//panel end
echo '</div>';
示例8: JsExpression
?>
" class="btn btn-default right" style="margin-right:10px;"><i class="glyphicon glyphicon-repeat"></i></a>
<br/>
<br/>
</div>
<div style="clear:both"></div>
<div id="jurnalar">
<?php
$form = ActiveForm::begin(['id' => 'jurnalArForm', 'action' => [''], 'options' => ['target' => '_blank'], 'method' => 'get']);
?>
<?php
echo $form->field($model, 'partner')->widget(Select2::classname(), ['options' => ['placeholder' => 'All Customer ...'], 'pluginOptions' => ['tags' => true, 'allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => $url, 'dataType' => 'json', 'data' => new JsExpression('function(term,page) { return {search:term}; }'), 'results' => new JsExpression('function(data,page) { return {results:data.results}; }')], 'initSelection' => new JsExpression($initScript)]]);
?>
<br/>
<?php
echo DatePicker::widget(['model' => $model, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'options' => ['placeholder' => 'Start date'], 'options2' => ['placeholder' => 'End date'], 'type' => DatePicker::TYPE_RANGE, 'form' => $form, 'pluginOptions' => ['format' => 'yyyy-MM-dd', 'autoclose' => true, 'startDate' => '01/07/2014'], 'convertFormat' => true]);
?>
<div class="form-group">
<br/>
<?php
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
<div style="clear:both"></div>
</div>
示例9: function
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">
<div class="page-header">
<h4><?php
// Html::encode($this->title)
?>
</h4>
</div>
<?php
Pjax::begin(['id' => 'pjax-gridview']);
?>
<?php
$toolbars = [['content' => Html::a('<i class="glyphicon glyphicon-plus"></i>', ['user/create'], ['type' => 'button', 'title' => 'Add ' . $this->title, 'class' => 'btn btn-success']) . ' ' . Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['user/index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}'], '{export}'];
$panels = ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i> ' . $this->title . '</h3>'];
$columns = [['class' => 'kartik\\grid\\SerialColumn', 'order' => DynaGrid::ORDER_FIX_LEFT], 'username', 'email', 'registration_ip:html', ['attribute' => 'created_at', 'format' => 'date', 'value' => function ($model) {
return $model->created_at;
}, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'pluginOptions' => ['format' => 'dd-M-yyyy', 'todayHighlight' => true], 'options' => ['class' => 'form-control']])], ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'flags', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'vAlign' => 'middle', 'viewOptions' => ['title' => 'view', 'data-toggle' => 'tooltip'], 'updateOptions' => ['title' => 'update', 'data-toggle' => 'tooltip'], 'deleteOptions' => ['title' => 'delete', 'data-toggle' => 'tooltip']]];
$dynagrid = DynaGrid::begin(['id' => 'user-grid', 'columns' => $columns, 'theme' => 'panel-primary', 'showPersonalize' => true, 'storage' => 'db', 'allowSortSetting' => true, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary' => true, 'floatHeader' => true, 'pjax' => false, 'panel' => $panels, 'toolbar' => $toolbars], 'options' => ['id' => 'user']]);
DynaGrid::end();
Pjax::end();
?>
</div>
示例10:
<?php
use yii\helpers\Html;
use yii\bootstrap\Modal;
use kartik\widgets\ActiveForm;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\Peso */
$this->title = 'Nuevo Peso';
$this->params['breadcrumbs'][] = ['label' => 'Pesos', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="peso-create">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
echo '<label class="control-label">Birth Date</label>';
echo DatePicker::widget(['model' => $model, 'attribute' => 'date_1', 'options' => ['placeholder' => 'Enter birth date ...'], 'pluginOptions' => ['autoclose' => true]]);
?>
<?php
echo $this->render('_form', ['model' => $model]);
?>
</div>
示例11: callback
if (id !== "") {
$.ajax("' . Url::to(['service/search-customer']) . '?id=" + id, {
dataType: "json"
}).done(function(data) {
callback(data.results);
}
);
}
}')], 'options' => ['placeholder' => 'Select Sales ...']]);
?>
</div>
<div class="form-group">
<?php
echo DatePicker::widget(['model' => $model, 'attribute' => 'date_begin', 'options' => ['placeholder' => 'Start date'], 'form' => $form, 'pluginOptions' => ['format' => 'yyyy-MM-dd', 'autoclose' => true, 'startDate' => '2014-07-01'], 'convertFormat' => true]);
?>
</div>
<div class="form-group">
<?php
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
<?php
echo Html::resetButton('Reset', ['class' => 'btn btn-default']);
?>
</div>
<?php
ActiveForm::end();
?>
示例12: empty
<?php
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<div class="row">
<div class="col-xs-2">
<?php
echo Html::a('Nueva Actividad', ['create'], ['class' => 'btn btn-success']);
?>
</div>
<div class="col-xs-3">
<?php
$inicial = empty($searchModel->rango_inicial) ? date('Y-m-d') : $searchModel->rango_inicial;
$final = empty($searchModel->rango_final) ? date('Y-m-d') : $searchModel->rango_final;
echo DatePicker::widget(['name' => 'rango_inicial', 'value' => $inicial, 'type' => DatePicker::TYPE_RANGE, 'name2' => 'rango_final', 'value2' => $final, 'separator' => 'a', 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-m-dd']]);
?>
</div>
<div class="col-xs-2">
<?php
echo Html::dropDownList('usuario', Yii::$app->user->identity->id, ArrayHelper::map(\common\models\User::find()->orderBy('nombre')->all(), 'id', 'nombre'), array('class' => 'form-control'));
?>
</div>
<div class="col-xs-2">
<?php
echo Html::submitButton('Filtrar Fechas', ['class' => 'btn btn-primary']);
示例13: date
//use kartik\grid\GridView;
use yii\grid\GridView;
use miloschuman\highcharts\Highcharts;
$this->title = 'Yandex метрика';
$this->params['breadcrumbs'][] = $this->title;
if (Yii::$app->user->identity->hasRouter('/default/settings')) {
echo Html::a('<i class="glyphicon glyphicon-cog"></i> Настройки', ['settings'], ['class' => 'btn btn-default']);
}
?>
<div style="width: 300px;float: right;">
<?php
$form = ActiveForm::begin(['method' => 'get']);
?>
<div style="width: 252px;display: inline-block;">
<?php
echo DatePicker::widget(['name' => 'date1', 'value' => date('Y-m-d', strtotime($returt->date1)), 'type' => DatePicker::TYPE_RANGE, 'name2' => 'date2', 'value2' => date('Y-m-d', strtotime($returt->date2)), 'separator' => '<i class="glyphicon glyphicon-resize-horizontal"></i>', 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
</div>
<?php
echo Html::submitButton('<i class="glyphicon glyphicon-refresh"></i>', ['class' => 'btn btn-default', 'style' => 'vertical-align: top;']);
?>
<?php
ActiveForm::end();
?>
</div>
<div class="clearfix"></div>
<?php
echo Highcharts::widget(['options' => ['title' => false, 'xAxis' => ['categories' => ArrayHelper::getColumn($returt->row, function ($element) {
return date('d.m', strtotime($element['date']));
})], 'yAxis' => ['title' => ['text' => 'Количество']], 'series' => [['name' => 'Визиты', 'data' => ArrayHelper::getColumn($returt->row, function ($element) {
return (int) $element['visits'];
示例14: function
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pembelian-index">
<!-- <div class="ui divider"></div> -->
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<?php
Pjax::begin(['id' => 'pembelian-index-pjax']);
?>
<?php
$total_lot = 1;
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'responsive' => true, 'hover' => true, 'resizableColumns' => false, 'showPageSummary' => true, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-shopping-cart"></i> ' . Html::encode($this->title) . ' - ' . '(<span class="hidden-xs">tanggal</span> transaksi terakhir ' . ($latestDate[1] == 1 ? 'belum ada' : $latestDate[1]) . ')</h3>', 'before' => '<div class="row">' . '<div class="col-xs-2 col-lg-1">' . (Mimin::filterRoute($this->context->id . '/create') ? Html::a('Create', ['create', 'date' => $dates[1]], ['class' => 'btn btn-success', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Create Data Pembelian", 'data-size' => "modal-lg"]) : '') . ' ' . '</div>' . '<div class="col-xs-2 col-md-1">' . Html::dropDownList('per-page', $perpage, ['5' => '5', '10' => '10', '20' => '20', '50' => '50', '100' => '100', 'all' => 'all'], ['id' => 'per-page', 'class' => 'form-control']) . '</div>' . '<div class="col-xs-5 col-sm-4 col-md-3 col-lg-2">' . DatePicker::widget(['name' => 'grid_date', 'value' => $dates[1], 'removeButton' => false, 'options' => ['placeholder' => 'Tgl Grid ...'], 'readonly' => true, 'pluginOptions' => ['todayHighlight' => true, 'todayBtn' => true, 'format' => 'dd-M-yyyy', 'autoclose' => true, 'buttonClose' => false], 'pluginEvents' => ["changeDate" => "function(e) {\n \$.pjax.reload({\n \t\t\t\t\t\t\t\turl: '" . Url::to(['index']) . "?per-page='+" . $perpage . "+'&date='+e.format(0,'yyyy-m-d'),\n \t\t\t\t\t\t\t\tcontainer: '#pembelian-index-pjax',\n \t\t\t\t\t\t\t\ttimeout: 1,\n \t\t\t\t\t\t\t});\n }"]]) . '</div>' . '</div>'], 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['index'], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Reset Grid'])], ButtonExport::widget()], 'export' => ['fontAwesome' => true], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'TGL', 'header' => 'Tanggal', 'filter' => false, 'format' => ['date', 'php:d M Y'], 'options' => ['width' => '125px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'NOMOR', 'label' => 'Nomor', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'EMITEN_KODE', 'label' => 'Emiten', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'SECURITAS_KODE', 'label' => 'Securitas', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'JMLLOT', 'label' => 'Jml Lot', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'JMLSAHAM', 'label' => 'Jml Saham', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'HARGA', 'label' => 'Harga', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'KOM_BELI', 'label' => 'Komisi', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'value' => function ($data) {
// 2. Perhitungan Total Komisi = kom_beli * harga * share / 100
$bruto = $data->JMLSAHAM * $data->HARGA;
$komisi_total = $data->KOM_BELI * $bruto / 100;
return $komisi_total;
}, 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['attribute' => 'TOTAL_BELI', 'format' => ['decimal', 2], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'pageSummary' => true, 'pageSummaryFunc' => GridView::F_SUM], ['class' => 'kartik\\grid\\ActionColumn', 'hAlign' => 'center', 'vAlign' => 'middle', 'options' => ['width' => '100px'], 'template' => Mimin::filterTemplateActionColumn(['update', 'delete'], $this->context->route), 'buttons' => ['update' => function ($url, $model) {
$icon = '<span class="glyphicon glyphicon-pencil"></span>';
return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => "Update Data Pembelian", 'data-size' => "modal-lg"]);
}, 'delete' => function ($url, $model) {
$icon = '<span class="glyphicon glyphicon-trash"></span>';
return Html::a($icon, $url, ['class' => 'btn btn-default btn-xs', 'data-confirm' => "Apakah anda mau menghapus data ini?", 'data-method' => 'post']);
}]]]]);
?>
<?php
$this->registerJs('
$("#per-page").on("change", function () {
示例15:
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'formConfig' => ['showLabels' => true, 'showErrors' => true, 'labelSpan' => 2, 'deviceSize' => ActiveForm::SIZE_SMALL]]);
////////////////////////////////////////////////////////////
// Формируем список из базы по типам контрактов.
?>
<div class="contract-form">
<?php
echo $form->field($model, 'ContractNumber')->textInput(['maxlength' => true]);
?>
<?php
echo DatePicker::widget(['model' => $model, 'form' => $form, 'attribute' => 'Period', 'language' => 'ru', 'options' => ['placeholder' => 'Начало действия'], 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['format' => 'yyyy/mm/dd', 'autoclose' => true]]);
?>
<?php
echo DatePicker::widget(['model' => $model, 'form' => $form, 'attribute' => 'DateOfSigning', 'language' => 'ru', 'options' => ['placeholder' => 'Конец действия'], 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['format' => 'yyyy/mm/dd', 'autoclose' => true]]);
?>
<?php
echo $form->field($model, 'Name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'status')->radioList(array('1' => 'В работе', 0 => 'Закрыт'));
?>
<?php
echo $form->field($model, 'AlfrescoLink')->input('url', ['placeholder' => 'Введите ссылку на электронную версию документа...']);
?>