示例#1
1
					<?php 
$form = ActiveForm::begin(['id' => 'mapping']);
?>
					<input type="hidden"  name= custkd id="tes">
					<div class="form-group">
    			<!-- <label for="pwd">Nama Customers:</label> -->
    			<input type="hidden" class="form-control" id="cusnm">
					<!-- <label for="hidden">Alamat:</label> -->
					<input type="hidden" class="form-control" id="alam" >
  				</div>
					<?php 
echo '<label class="control-label">Group Name </label>';
?>
					<?php 
echo Select2::widget(['name' => 'group', 'data' => $data, 'options' => ['id' => 'select-group', 'placeholder' => 'Select Group ...']]);
?>



        <div class="modal-footer">
					  <?php 
echo Html::submitButton('SAVE', ['class' => 'btn btn-primary', 'id' => 'btn']);
?>
							<?php 
ActiveForm::end();
?>
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>
示例#2
0
    public function run()
    {
        FlagIconAsset::register($this->getView());
        $locales = [];
        $languages = [];
        if (!empty($this->countries)) {
            array_walk($this->countries, function (&$data) {
                $data = strtolower($data);
            });
        }
        $countryRepository = new Country();
        $data = $countryRepository->findAll();
        foreach ($data as $code => $lang) {
            if (empty($this->countries) || in_array(strtolower($code), $this->countries)) {
                $locales[$code] = FlagIcon::flag($code);
                $languages[$code] = $lang->name['english']['common'] . ' (' . reset($lang->name['native'])['common'] . ')';
            }
        }
        $format = '
        function format(state) {
            var locales = ' . Json::encode($locales) . ';
            if (!state.id) { return state.text; }

            return locales[state.id] + " " + state.text;
        }';
        $escape = new JsExpression('function(m) { return m; }');
        $this->getView()->registerJs($format, View::POS_HEAD);
        $this->options = array_merge(['placeholder' => Yii::$app->translate->t('Choose country')], $this->options);
        $pluginOptions = array_merge(['templateResult' => new JsExpression('format'), 'templateSelection' => new JsExpression('format'), 'escapeMarkup' => $escape], $this->pluginOptions);
        $pluginEvents = array_merge([], $this->pluginEvents);
        return Select2::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => $this->options, 'data' => $languages, 'pluginOptions' => $pluginOptions, 'pluginEvents' => $pluginEvents]);
    }
 /**
  * @inheritdoc
  */
 public function run()
 {
     FlagIconAsset::register($this->getView());
     $locales = [];
     $ids = [];
     $countryRepository = new Country();
     $data = $countryRepository->findAll();
     foreach ($this->currencies as $value) {
         $key = $value->id;
         if (!empty($value->country_flag)) {
             $locales[$key] = FlagIcon::flag($value->country_flag);
         } else {
             // iterate data (countries list) to find country code with defined ($value->code) currency
             foreach ($data as $code => $country_value) {
                 if (strcasecmp($country_value->currency['code'], $value->code) == 0) {
                     $locales[$key] = FlagIcon::flag($code);
                     break;
                 }
             }
         }
         $ids[$key] = $value->code;
     }
     $currencyFormat = 'function currencyFormat(state) {
         var locales = ' . Json::encode($locales) . ';
         if (!state.id) { return state.text; }
         return locales[state.id] + " " + state.text;
     }';
     $escape = new JsExpression('function(m) { return m; }');
     $this->getView()->registerJs($currencyFormat, View::POS_HEAD);
     $this->options = array_merge(['placeholder' => Yii::$app->translate->t('select currency')], $this->options);
     $pluginOptions = array_merge(['templateResult' => new JsExpression('currencyFormat'), 'templateSelection' => new JsExpression('currencyFormat'), 'escapeMarkup' => $escape], $this->pluginOptions);
     $pluginEvents = array_merge([], $this->pluginEvents);
     return Select2::widget(['model' => $this->model, 'attribute' => $this->attribute, 'name' => $this->name, 'value' => $this->value, 'options' => $this->options, 'data' => $ids, 'pluginOptions' => $pluginOptions, 'pluginEvents' => $pluginEvents]);
 }
示例#4
0
 /**
  * Initializes the widget
  *
  * @throw InvalidConfigException
  */
 public function init()
 {
     if (empty($this->pluginOptions['url'])) {
         throw new InvalidConfigException("The 'pluginOptions[\"url\"]' property has not been set.");
     }
     if (empty($this->pluginOptions['depends']) || !is_array($this->pluginOptions['depends'])) {
         throw new InvalidConfigException("The 'pluginOptions[\"depends\"]' property must be set and must be an array of dependent dropdown element ID.");
     }
     if (empty($this->options['class'])) {
         $this->options['class'] = 'form-control';
     }
     parent::init();
     if ($this->type !== self::TYPE_SELECT2 && !empty($this->options['placeholder'])) {
         $this->data = ['' => $this->options['placeholder']] + $this->data;
     }
     if ($this->type === self::TYPE_SELECT2 && (!empty($this->options['placeholder']) || !empty($this->select2Options['options']['placeholder']))) {
         $this->pluginOptions['placeholder'] = '';
     } elseif ($this->type === self::TYPE_SELECT2 && !empty($this->pluginOptions['placeholder']) && $this->pluginOptions['placeholder'] !== false) {
         $this->options['placeholder'] = $this->pluginOptions['placeholder'];
         $this->pluginOptions['placeholder'] = '';
     }
     $this->_view = $this->getView();
     $this->registerAssets();
     if ($this->type === self::TYPE_SELECT2) {
         if (empty($this->data)) {
             $this->data = ['' => ''];
         }
         if ($this->hasModel()) {
             $settings = ArrayHelper::merge($this->select2Options, ['model' => $this->model, 'attribute' => $this->attribute, 'data' => $this->data, 'options' => $this->options]);
         } else {
             $settings = ArrayHelper::merge($this->select2Options, ['name' => $this->name, 'value' => $this->value, 'data' => $this->data, 'options' => $this->options]);
         }
         echo Select2::widget($settings);
         $id = 'jQuery("#' . $this->options['id'] . '")';
         $text = ArrayHelper::getValue($this->pluginOptions, 'loadingText', 'Loading ...');
         $this->_view->registerJs("{$id}.on('depdrop.beforeChange',function(e,i,v){{$id}.select2('data',{text: '{$text}'});});");
         $this->_view->registerJs("{$id}.on('depdrop.change',function(e,i,v,c){{$id}.select2('val',{$id}.val());});");
     } else {
         echo $this->getInput('dropdownList', true);
     }
 }
示例#5
0
    case 5:
        // Текст
        echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . Html::activeTextarea($model, $option, $options_attributes) . "</div><div class='help-block'>" . $error . "</div></div>";
        break;
    case 6:
        // Файл (выбор)
        echo "<div class='{$class}'><div>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . "</div><div>" . InputFile::widget(['language' => 'ru', 'controller' => 'elfinder', 'filter' => 'image', 'template' => '<div class="input-group">
                                        {input}<span class="input-group-btn">{button}</span>
                                    </div>', 'options' => $options_attributes, 'buttonOptions' => ['class' => 'btn btn-default'], 'buttonName' => 'Выбрать файл', 'name' => 'Document[option_' . $i . ']', 'value' => $model->{$option}]) . "</div><div class='help-block'>" . $error . "</div></div>";
        break;
    case 7:
        // Изображение (загрузка)
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . FileInput::widget(['model' => $model, 'attribute' => $option_file, 'pluginOptions' => ['browseClass' => 'btn btn-default', 'browseLabel' => 'Загрузить файл', 'removeLabel' => 'Удалить', 'removeClass' => 'btn btn-default', 'browseIcon' => '', 'removeIcon' => '', 'showUpload' => false]]) . Html::activeHiddenInput($model, $option_file, $options_attributes);
        if (!$model->isNewRecord && $model->{$option} && $model->last_template_id == $model->template_id) {
            echo Html::img($model->{$option}, ['class' => 'doc_img img-thumbnail']) . "<p>" . Html::a('Удалить изображение', ['/document/deleteimg', 'document_id' => $model->id, 'option_id' => $i], ['class' => 'lnk delete_photo']) . "</p>";
        }
        echo "<div class='help-block'>" . $error . "</div></div>";
        break;
    case 8:
        // Список дочерних документов
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => Document::getChilds($template->{$option_param}, true), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>";
        break;
    case 9:
        // Список потомков документов
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => Document::getChilds($template->{$option_param}, false), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>";
        break;
    case 10:
        // Список пользователя
        echo "<div class='{$class}'>" . Html::activeLabel($model, $option, ['class' => 'control-label']) . Select2::widget(['model' => $model, 'attribute' => $option, 'data' => User::getAll(), 'options' => ['placeholder' => ''], 'pluginOptions' => $options_attributes]) . "<div class='help-block'>" . $error . "</div></div>";
        break;
}
$this->title = 'Lista de produtos de venda por insumo';

?>
<div class="produto-view">

    <h1><?= Html::encode($this->title) ?></h1>


    <?php $form = ActiveForm::begin(); ?>
    <?= '<label class="control-label">Insumo</label>'; ?>
    <?= Select2::widget([
        'name' => 'idinsumo',
        'data' => $insumos,
        'options' => [
            'required' => true,
            'placeholder' => 'Digite o insumo',
            //  'multiple' => true
        ],
    ]); ?>
    </br>
    <div class="form-group">
        <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary btn-block',
            'title' => 'Clique para listar os produtos do Insumo selecionado',]) ?>
    </div>

    <?php ActiveForm::end(); ?>
    <div class="panel panel-default">

        <?php
        if (isset($produtosVenda)) {
示例#7
0
        <div class="col-xs-12 col-sm-4 col-md-4">
            <?php 
echo $form->field($model, 'from_email')->textInput(['maxlength' => 250]);
?>

            <?php 
echo $form->field($model, 'from_name')->textInput(['maxlength' => 250]);
?>

            <div class="m-b-lg">
                <label class="control-label"><?php 
echo Adm::t('adm_email_config', 'Send copy to:', ['dot' => true]);
?>
</label>
                <?php 
echo Select2::widget(['name' => 'params', 'value' => $paramsValue, 'options' => ['multiple' => true, 'placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'data' => $data, 'pluginOptions' => ['tags' => true, 'maximumInputLength' => 250, 'tokenSeparators' => [EmailConfig::EMAIL_SEPARATOR]]]);
?>
            </div>
        </div>

        <div class="col-xs-12 col-sm-4 col-md-4 readonly-cont">
            <?php 
echo $form->field($model, 'username')->textInput(['maxlength' => 250]);
?>

            <?php 
echo $form->field($model, 'password')->textInput(['maxlength' => 250]);
?>

            <?php 
echo $form->field($model, 'enable_smtp', ["template" => "{input}\n{label}\n{hint}\n{error}"])->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
示例#8
0
?>
<div class="site-index">

        

        <p class="lead">
            <div class="alert alert-success">
            <div class="row">
                <div class="col-lg-4" style="text-align: center;">
                </div>
                <div class="col-lg-4" style="text-align: center;">
                    <p>เลือกสถานบริการสาธารณสุข</p>
                    <form method="POST">
                        <p>
                        <?php 
echo Select2::widget(['name' => 'hospcode', 'data' => ArrayHelper::map(ChospitalAmp::find()->all(), 'hoscode', 'hosname'), 'options' => ['placeholder' => empty($hosname) ? 'Select here...' : $hosname]]);
?>
                        </p>
                        <p>
                        <div>
                            <button class = 'btn btn-success'>Search</button>
                        </div>
                        </p>
                    </form>
                    
                    <div id="resp" style="display: none">
                        <img src="backend\web\images\Processing.gif">
                    </div>
                </div>
                <div class="col-lg-4" style="text-align: center;">
                </div>
示例#9
0
        echo $form->field($user, 'username');
        ?>
    <?php 
    }
    ?>

    <?php 
    echo $form->field($user, 'newPassword')->passwordInput();
    ?>

</div>

<div>
    <?php 
    echo Html::label('Permissões') . '</br>';
    echo Select2::widget(['name' => 'roles', 'data' => $permissoes, 'attribute' => 'roles', 'pluginOptions' => ['allowClear' => true, 'multiple' => true]]);
    echo "</br>";
    ?>
</div>




<div class="linha">
    <div class="user-default-register">
      
    </div>
    <?php 
    /* uncomment if you want to add profile fields here
    <?= $form->field($profile, 'full_name') ?>
            */
示例#10
0
    echo $i;
    ?>
" name="value-<?php 
    echo $i;
    ?>
" multiple="multiple" style="width: 100%;">
                                </select>
                            </div>
                            <div class="col-md-1 col-right">
                                <?php 
    echo \kartik\widgets\Select2::widget(['name' => 'right-' . $i, 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'data' => \common\populac\models\Preferences::getByClassmark('tRight'), 'options' => ['prompt' => '', 'title' => '如需要选择右括号,请选择..'], 'pluginOptions' => ['allowClear' => true, 'minimumResultsForSearch' => 'Infinity']]);
    ?>
                            </div>
                            <div class="col-md-1 col-relation">
                                <?php 
    echo \kartik\widgets\Select2::widget(['name' => 'relation-' . $i, 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'data' => \common\populac\models\Preferences::getByClassmark('tRelation'), 'value' => 'and', 'options' => ['multiple' => false], 'pluginOptions' => ['minimumResultsForSearch' => 'Infinity']]);
    ?>
                            </div>
                        </div>
                    <?php 
}
?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关 闭</button>
                    <button type="button" class="btn btn-primary" id="btn-view-adv-search-relation">确 定</button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
示例#11
0
<style>
    .search .form-control{ width:300px;}
    .search .form-group{ margin:0 10px;}
</style>
<?php 
use kartik\widgets\ActiveForm;
use kartik\helpers\Html;
$form = ActiveForm::begin(['method' => 'get', 'type' => ActiveForm::TYPE_INLINE, 'options' => ['class' => 'search']]);
if ($model->render == 'reg-user') {
    echo $form->field($model, 'userId');
}
//echo $form->field($model, 'filter_limit');
echo $form->field($model, 'regdate', [])->widget(\kartik\daterange\DateRangePicker::classname(), ['attribute' => "regdate", 'model' => $model, 'convertFormat' => true, 'pluginOptions' => ['timePicker' => true, 'timePickerIncrement' => 15, 'timePicker24Hour' => true, 'locale' => ['separator' => ' 至 ', 'format' => 'Y-m-d H:i:s'], 'opens' => 'right']]);
?>
<div style="display: inline-block">
<?php 
echo \kartik\widgets\Select2::widget(['name' => 'filter_limit', 'value' => \yii::$app->request->get('filter_limit', 50), 'data' => [20 => 20, 50 => 50, 100 => 100, 200 => 200], 'options' => ['placeholder' => '每页条数']]);
?>
</div>
<?php 
echo Html::submitButton("搜索", ['class' => 'btn btn-success', 'name' => Html::getInputName($model, 'do'), 'value' => 'search']);
//echo "&nbsp;&nbsp;";
//echo Html::submitButton("更新", [
//    'class' => 'btn btn-info',
//    'name' =>Html::getInputName($model,'do'),
//    'value'=>'update'
//]);
ActiveForm::end();
示例#12
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="events-index">
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

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

    <?php 
Pjax::begin();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'value' => 'user.username', 'options' => ['width' => '20%'], 'filter' => \kartik\widgets\Select2::widget(['model' => $searchModel, 'attribute' => 'user_id', 'data' => \yii\helpers\ArrayHelper::map(\dektrium\user\models\User::find()->all(), 'id', 'username'), 'options' => ['prompt' => '---请选择需要筛选的用户---'], 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' '], 'maximumInputLength' => 3, 'allowClear' => true]])], 'title', 'data:ntext', 'time:datetime', ['class' => 'yii\\grid\\ActionColumn', 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-pencil" style="cursor: pointer;"></span>', false, ['class' => 'showModalButton', 'value' => Yii::$app->urlManager->createUrl(['events/view', 'id' => $model->id, 'edit' => 't']), 'title' => Yii::t('yii', 'Edit')]);
}, 'view' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-eye-open" style="cursor: pointer;"></span>', false, ['class' => 'showModalButton', 'value' => Yii::$app->urlManager->createUrl(['events/view', 'id' => $model->id]), 'title' => Yii::t('yii', 'View')]);
}]]], 'responsive' => true, 'hover' => true, 'condensed' => true, 'floatHeader' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th-list"></i> ' . Html::encode($this->title) . ' </h3>', 'type' => 'info', 'before' => Html::a('<i class="glyphicon glyphicon-plus"></i> 新增', false, ['class' => 'showModalButton btn btn-success', 'value' => \yii\helpers\Url::to(['events/create']), 'title' => '新增事件']), 'after' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Reset List', ['index'], ['class' => 'btn btn-info']), 'showFooter' => false], 'filterSelector' => "select[name='" . $dataProvider->getPagination()->pageSizeParam . "'],input[name='" . $dataProvider->getPagination()->pageParam . "']", 'pager' => ['class' => \common\widgets\LinkPager::className(), 'template' => '{pageButtons} {customPage} {pageSize}', 'pageSizeMargin' => 'margin-left:5px;margin-right:5px;', 'pageSizeOptions' => ['class' => 'form-control', 'style' => 'display: inline-block;width:auto;margin-top:0px; margin-bottom: 2px;'], 'customPageWidth' => 50, 'customPageBefore' => ' <span class="text-center text-primary" style="margin-left: 10px;"><i class="fa fa-cog fa-lg fa-spin"></i> 跳转至第</span> ', 'customPageAfter' => ' <span class="text-center text-primary">页 每页显示</span> ', 'customPageMargin' => 'margin-left:5px;margin-right:5px; ime-mode:disabled; margin-bottom: 2px;', 'firstPageLabel' => '<span class="fa fa-step-backward" />', 'prevPageLabel' => '<span class="fa fa-chevron-left" />', 'nextPageLabel' => '<span class="fa fa-chevron-right" />', 'lastPageLabel' => '<span class="fa fa-step-forward" />', 'maxButtonCount' => 15]]);
Pjax::end();
?>

</div>
<?php 
\common\widgets\JsBlock::begin();
?>
<script type="text/javascript">
    //js获取get参数
    function GetUrlParms()
    {
示例#13
0
echo Html::hiddenInput('Orders[product_price]', $price, ["id" => "price", "class" => "item-shopcart"]);
echo '<div class="form-group' . ($price > 0 ? "" : " hidden") . '"><label class="control-label">' . Yii::t("app", "Quantity") . '</label>';
echo TouchSpin::widget(['name' => 'Orders[product_qty]', 'value' => 1, 'options' => ["id" => "quantity", 'class' => 'item-shopcart'], 'pluginOptions' => ['min' => 1, 'step' => 1, 'max' => 100000000000, 'boostat' => 10, 'maxboostedstep' => 100000, 'handle' => 'triangle', 'tooltip' => 'always']]);
echo '</div>';
$data = json_decode($model->data);
foreach ($data as $d) {
    $type = $d->type;
    if ($type == 0) {
        $options = [];
        $deval = "";
        foreach (explode(",", $d->value) as $v) {
            $options[trim($v)] = trim($v);
            $deval = $deval == "" ? trim($v) : $deval;
        }
        echo '<div class="form-group"><label class="control-label">' . Html::encode($d->label) . '</label>';
        echo Select2::widget(['name' => 'Orders[data][' . $d->label . ']', 'data' => $options, 'value' => $deval, 'options' => ['placeholder' => Yii::t('app', 'Select ') . $d->label, 'class' => 'item-shopcart', "id" => "data_" . str_replace(" ", "_", $d->label)]]);
        echo '</div>';
    } else {
        if ($type == 1) {
            echo '<div class="form-group"><label class="control-label">' . Html::encode($d->label) . '</label>';
            echo Html::textInput('Orders[data][' . $d->label . ']', $d->value, ["id" => "data_" . str_replace(" ", "_", $d->label), "class" => "form-control item-shopcart", "placeholder" => Yii::t("app", $d->label), "style" => "width:100%"]);
            echo '</div>';
        } else {
            if ($type == 2) {
                echo '<div class="form-group"><label class="control-label">' . Html::encode($d->label) . '</label>';
                echo TouchSpin::widget(['name' => 'Orders[data][' . $d->label . ']', 'value' => $d->value == null ? 0 : $d->value, 'options' => ["id" => "data_" . str_replace(" ", "_", $d->label), "class" => "item-shopcart"], 'pluginOptions' => ['min' => 1, 'step' => 1, 'max' => 100000000000, 'boostat' => 10, 'maxboostedstep' => 100000, 'handle' => 'triangle', 'tooltip' => 'always']]);
                echo '</div>';
            } else {
                if ($type == 3) {
                    echo '<div class="form-group"><label class="control-label">' . Html::encode($d->label) . '</label>';
                    echo Html::textArea('Orders[data][' . $d->label . ']', $d->value, ["id" => "data_" . str_replace(" ", "_", $d->label), "class" => "form-control item-shopcart", "placeholder" => Yii::t("app", $d->label), "style" => "width:100%"]);
示例#14
0
        // Строка
        case 9:
            // Регулярное выражение
            echo Html::activeInput('text', $model, $attr_value, ['class' => 'form-control', 'id' => $attr_id]);
            break;
        case 3:
            // Флажок
            echo Html::activeCheckbox($model, $attr_value, ['class' => 'form-control', 'id' => $attr_id, 'label' => null]);
            break;
        case 5:
            // Текст
            echo Html::activeTextarea($model, $attr_value, ['class' => 'form-control', 'id' => $attr_id]);
            break;
        case 6:
            // Список (дочерние документы
            echo Select2::widget(['model' => $model, 'attribute' => $attr_value, 'data' => Document::getAll($field['param']), 'options' => ['id' => $attr_id, 'placeholder' => ''], 'pluginOptions' => ['allowClear' => true, 'class' => 'form-control', 'id' => $attr_id]]);
            break;
        case 8:
            // Файл (выбор с сервера)
            echo InputFile::widget(['controller' => 'elfinder', 'template' => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>', 'options' => ['class' => 'form-control', 'id' => $attr_id], 'buttonOptions' => ['class' => 'btn btn-default'], 'buttonName' => Yii::t('document', 'Выбрать файл'), 'multiple' => false, 'name' => 'Document[fields][' . $field_id . '][data][' . $data_id . '][value]', 'value' => isset($model->fields[$field_id]['data'][$data_id]['value']) ? $model->fields[$field_id]['data'][$data_id]['value'] : null]);
            break;
        case 7:
            // Дата
            echo DatePicker::widget(['model' => $model, 'attribute' => $attr_value, 'options' => ['id' => $attr_id, 'placeholder' => ''], 'pluginOptions' => ['format' => 'dd.mm.yyyy', 'class' => 'form-control', 'id' => $attr_id]]);
            break;
    }
}
?>
            </div>
            <div class="help-block">
                <?php 
示例#15
0
    echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary', 'id' => 'smbBtn'] + ($registraciya->podtvershdenieNaObrabotku ? [] : ['disabled' => 'disabled']));
}
if ($registraciya->status == \app\enums\StatusZayavleniyaNaAttestaciyu::REDAKTIRUETSYA_PED_RABOTNIKOM || $registraciya->status == \app\enums\StatusZayavleniyaNaAttestaciyu::OTKLONENO) {
    echo Html::button('Отправить в отдел аттестации', ['class' => 'btn btn-primary', 'style' => 'margin-left:1em', 'id' => 'changeStatusBtn']);
}
if ($registraciya->status) {
    echo Html::a('Печать', '/attestaciya/print-zayavlenie?id=' . $registraciya->id, ['class' => 'btn btn-primary', 'style' => 'margin-left:1em', 'target' => 'blank']);
}
ActiveForm::end();
//Модальное окно для добавляние Должности
//$dolzhnostModel =  new DolzhnostFizLica();
//$dolzhnostModel->fizLicoId = $registraciya->fizLicoId;
//$dolzhnostModel->organizaciyaAdress = 421574;
//$dolzhnostModel->organizaciyaVedomstvo = 18;
Modal::begin(['options' => ['id' => 'dolzhnostModal', 'tabindex' => false], 'header' => '<h3>Добавление должности</h3>']);
echo Select2::widget(['name' => 'state_40', 'data' => AdresnyjObjekt::findBurRajon()->commonOnly()->formattedAll(EntityQuery::DROP_DOWN, 'formalnoeNazvanie'), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]);
Modal::end();
?>

<div onkeydown="modalKeyDown(event)" id="myModal" class="myModal" style="position: fixed;height:100%;width:100%;background: rgba(0,0,0,0.6);left:0;top:0;z-index:1000;display: none;">
    <div class="mmBody" style="width: 750px;height: 550px;overflow: scroll;background: #fff;margin:auto;position: absolute;top:0;bottom:0;left:0;top:0;right:0;padding: 0.5em 1em;border-radius: 5px;max-height: 100%;">
        <div style="border-bottom: 1px solid #eee">
            <button onclick="close_modal()" class="close">×</button>
            <h3>Добавление должности</h3>
        </div>
        <div id="modal_content" style="padding: 1em 0"></div>
    </div>
</div>


示例#16
0
    <form method="POST">
        ระหว่างวันที่:
        <div class="row">
        <div class="col-xs-4 col-sm-4 col-md-5">
            <?php 
echo yii\jui\DatePicker::widget(['name' => 'date1', 'value' => $date1, 'language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true], 'options' => ['class' => 'form-control']]);
?>
        ถึงวันที่:
        <?php 
echo yii\jui\DatePicker::widget(['name' => 'date2', 'value' => $date2, 'language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true], 'options' => ['class' => 'form-control']]);
?>
        </div>
         <div class="col-xs-4 col-sm-4 col-md-4">
            <?php 
$list = ArrayHelper::map(Campur::find()->all(), 'ampurname', 'ampurname');
echo Select2::widget(['name' => 'ampurname', 'data' => $list, 'value' => $ampurname, 'size' => Select2::MEDIUM, 'options' => ['placeholder' => 'เลือก อำเภอ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
              
            
            
       <div class="col-xs-4 col-sm-4 col-md-2">
            <button class='btn btn-danger'>ประมวลผล</button>
        </div>    
         
</div>
        
    </form>
    
</div>
<?php 
示例#17
0
 public static function baseWidget($name, $value, $sourceArray, $htmlOptions = [], $pluginOptions = [])
 {
     return \kartik\widgets\Select2::widget(['name' => $name, 'language' => 'hu', 'options' => $htmlOptions, 'value' => $value, 'data' => $sourceArray, 'pluginOptions' => ArrayHelper::merge(['allowClear' => true, 'minimumInputLength' => 3], $pluginOptions)]);
 }
示例#18
0
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

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

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'nombre', ['attribute' => 'fecha_inicio', 'filter' => DateControl::widget(['name' => 'fecha_inicio', 'attribute' => 'fecha_inicio', 'model' => $searchModel, 'type' => DateControl::FORMAT_DATE])], ['attribute' => 'tipo', 'value' => function ($model) {
    return Categoria::findOne(['id' => $model->tipo])->nombre;
}, 'filter' => Select2::widget(['name' => 'tipo', 'attribute' => 'tipo', 'model' => $searchModel, 'data' => ArrayHelper::map(Categoria::find()->all(), 'id', 'nombre'), 'options' => ['placeholder' => 'Categoría'], 'pluginOptions' => ['allowClear' => true]])], ['attribute' => 'subtipo', 'value' => function ($model) {
    return Subcategoria::findOne(['id' => $model->subtipo])->nombre;
}, 'filter' => Select2::widget(['name' => 'subtipo', 'attribute' => 'subtipo', 'model' => $searchModel, 'data' => ArrayHelper::map(Subcategoria::find()->all(), 'id', 'nombre'), 'options' => ['placeholder' => 'Subcategoría'], 'pluginOptions' => ['allowClear' => true]])], ['attribute' => 'convocatoria', 'value' => function ($model) {
    if (!empty(Convocatoria::findOne(['id' => $model->convocatoria]))) {
        return Convocatoria::findOne(['id' => $model->convocatoria])->descripcion;
    } else {
        return "N/A";
    }
}, 'filter' => Select2::widget(['name' => 'convocatoria', 'attribute' => 'convocatoria', 'model' => $searchModel, 'data' => ArrayHelper::map(Convocatoria::find()->all(), 'id', 'nombre'), 'options' => ['placeholder' => 'Convocatoria'], 'pluginOptions' => ['allowClear' => true]])], 'observaciones:ntext', ['attribute' => '', 'format' => 'raw', 'value' => function ($model) {
    return Html::a('Proyectos', ['/faer/index2', 'id' => $model->id], ['class' => 'btn btn-success btn-xs', 'style' => 'border-radius:4px;']);
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
示例#19
0
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\models\SubcategoriaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Subcategorias');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="subcategoria-index">

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

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Crear Subcategoria'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'categoria', 'value' => function ($model) {
    return Categoria::findOne(['id' => $model->categoria])->nombre;
}, 'filter' => Select2::widget(['name' => 'categoria', 'attribute' => 'categoria', 'model' => $searchModel, 'data' => ArrayHelper::map(Categoria::find()->all(), 'id', 'nombre'), 'options' => ['placeholder' => 'Categoría'], 'pluginOptions' => ['allowClear' => true]])], 'nombre', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
示例#20
0
                    <label for="warehouse_select" class="control-label">Select Warehouse</label>
                    <div class="">
                        <?php 
echo Html::dropDownList('warehouse_select', isset($posted_data['warehouse_select']) ? $posted_data['warehouse_select'] : null, ['0' => 'All'] + ArrayHelper::map(Warehouse::find()->all(), 'id', 'name'), ['class' => 'form-control', 'id' => 'warehouse_select']);
?>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="products_select" class="control-label">Select Products</label>
                    <div class="">
                        <?php 
echo Select2::widget(['name' => 'products_select', 'value' => isset($posted_data['products_select']) ? $posted_data['products_select'] : 0, 'data' => ['0' => 'All'] + ArrayHelper::map(Products::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'Select Products ...', 'class' => 'form-control', 'id' => 'products_select']]);
?>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <?php 
echo Html::submitButton('Generate Reports', ['class' => 'btn btn-success ']);
?>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>

    <div class="box box-default" >
        <div class="box-body">
示例#21
0
							
							<h4><?php 
echo Yii::t('articles', 'Item View');
?>
</h4>
							
							<?php 
// Item Image Width
echo '<div class="form-group field-categories-itemImageWidth">';
echo '<label class="control-label">' . Yii::t('articles', 'Image Width') . '</label>';
echo Select2::widget(['name' => 'itemImageWidth', 'data' => ['small' => Yii::t('articles', 'Small'), 'medium' => Yii::t('articles', 'Medium'), 'large' => Yii::t('articles', 'Large'), 'extra' => Yii::t('articles', 'Extra')]]);
echo '</div>';
// Show Item Data
echo '<div class="form-group field-categories-itemViewData">';
echo '<label class="control-label">' . Yii::t('articles', 'Show Item Data') . '</label>';
echo Select2::widget(['name' => 'itemViewData', 'data' => [1 => Yii::t('articles', 'Yes'), 0 => Yii::t('articles', 'No')]]);
echo '</div>';
?>
							
						</div> <!-- col-md-4 -->
                     
					</div> <!-- #params -->		
				
				</div> <!-- tab-content -->
			
			</div> <!-- bs-example -->

			<div class="col-lg-12">

				<div class="form-group">
					<?php 
示例#22
0
                <kbd id="oauth2-result" style="    display: block;
    padding: 10px;
    margin-top: 10px;
    white-space: pre;
    word-break: break-word;"></kbd>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-4">
        <div class="form-group">
            <label for="method">Select an API method</label>
            <?php 
echo Select2::widget(['id' => 'method', 'name' => 'method', 'data' => ['Profile' => ['1' => '[POST] Sign Up', '2' => '[GET] View', '3' => '[PUT] Edit'], 'Project' => ['4' => '[GET] List', '5' => '[GET] View', '6' => '[POST] Create', '7' => '[PUT] Edit', '8' => '[DELETE] Delete'], 'Task' => ['9' => '[GET] List', '10' => '[GET] View', '11' => '[POST] Create', '12' => '[PUT] Edit', '13' => '[DELETE] Delete']], 'options' => ['placeholder' => 'No Selected Method'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-2">
        <div class="form-group">
            <label for="url_type">Request URL</label>
            <select class="form-control" id="url_type" name="url_type">
                <option>GET</option>
                <option>POST</option>
                <option>DELETE</option>
                <option>PUT</option>
            </select>
示例#23
0
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel app\models\MetasCoberturaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Metas Coberturas');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="metas-cobertura-index">

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

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Registrar Metas Cobertura'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'categoria', 'value' => function ($model) {
    return \app\models\Categoria::findOne(['id' => $model->categoria])->nombre;
}, 'filter' => Select2::widget(['name' => 'id', 'attribute' => 'id', 'model' => $searchModel, 'data' => ArrayHelper::map(Categoria::find()->all(), 'id', 'nombre'), 'options' => ['placeholder' => 'Categoría'], 'pluginOptions' => ['allowClear' => true]])], ['attribute' => 'ano', 'value' => 'ano', 'filter' => Html::activeDropDownList($searchModel, 'ano', [2015 => "2015", 2016 => "2016", 2017 => "2017", 2018 => "2018", 2019 => "2019", 2020 => "2020"], ['class' => 'form-control'])], 'cobertura:integer', ['class' => 'yii\\grid\\ActionColumn']]]);
?>
</div>
示例#24
0
文件: _form.php 项目: hdushku/blog
				<?php 
echo $form->field($model, 'time')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Select posting time ...', 'readonly' => true], 'removeButton' => false, 'convertFormat' => true, 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:i:s', 'todayHighlight' => true]]);
?>
		
				<?php 
echo $form->field($model, 'tags')->widget(Select2::classname(), ['options' => ['placeholder' => Yii::t('app', 'Put additional tags ...')], 'data' => $model->getTags(), 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' ']]]);
?>
		
				
				<div clas="form-group">
					<label for="Post[category]"><?php 
echo Yii::t('app', 'Category');
?>
</label>
					<?php 
echo Select2::widget(['name' => 'Post[category]', 'data' => $listCategory, 'value' => $category, 'options' => ['placeholder' => Yii::t('app', 'Select categories ...'), 'multiple' => true]]);
?>
				</div>	
				
				<?php 
echo $form->field($model, 'status')->widget(Select2::classname(), ['data' => $model->itemAlias('status'), 'options' => ['placeholder' => Yii::t('app', 'Select post status...')], 'pluginOptions' => ['allowClear' => false], 'pluginEvents' => []]);
?>
				
				<?php 
if ($module->enableUpload) {
    echo $form->field($model, 'image')->widget(KCFinderInputWidget::className(), ['multiple' => false, 'kcfOptions' => $kcfOptions, 'kcfBrowseOptions' => ['type' => 'images', 'lng' => substr(Yii::$app->language, 0, 2)]]);
} else {
    echo $form->field($model, 'image')->textInput(['placeholder' => Yii::t('app', 'Url of image')]);
}
?>
	
示例#25
0
</div>
</div>		

<br/><br/>

<div class="row">
	<div class="col-md-4">
		
	</div>
	<div class="col-md-4">
		
	</div>
	<div class="col-md-4">
		<?php 
$model = new LedgerHead();
echo Select2::widget(['model' => $model, 'attribute' => 'headID', 'data' => [103 => 'Income', 104 => 'Expense'], 'options' => ['placeholder' => 'Select general ledger', 'id' => 'lg-head'], 'pluginOptions' => ['allowClear' => true]]);
?>
	</div>
</div>
<br/><br/>

<table class="table table-bordered">
	<thead>
	  <tr class="active">
		<th>Date</th>
		<th>Description</th>
		<th>Amount</th>
		<th>Voucher no</th>
		<th>Head</th>
		<th>Actions</th>
	  </tr>
<?php

use yii\helpers\Html;
use yii\helpers\Url;
use kartik\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use kartik\widgets\Select2;
use kartik\grid\GridView;
use yii\web\JsExpression;
use miloschuman\highcharts\Highcharts;
$this->title = 'Invoice Released Summary';
$this->params['breadcrumbs'][] = ['label' => 'Customer Invoice', 'url' => ['out']];
$this->params['breadcrumbs'][] = $this->title;
$form = ActiveForm::begin(['id' => 'saleAnnualReportForm', 'action' => [''], 'method' => 'get']);
echo '<label class="control-label">Search Form</label>';
echo Select2::widget(['name' => 'sales', 'data' => \yii\helpers\ArrayHelper::merge($saleUsers, ['all' => "All Sales", "group:g1" => "Group: G1", "group:g2" => "Group: G2", "group:g3" => "Group: G3", "group:g4" => "Group: G4", "group:g5" => "Group: G5", "group:g6" => "Group: G6", "group:jabotabek" => "Group: JABODETABEK", "group:smb" => 'Group: SMB / Sumatera', "group:jtt" => "Group: Jawa Tengah / Timur", "group:sls" => "Group: Sulawesi"]), 'value' => Yii::$app->request->get('sales'), 'options' => ['placeholder' => 'Select Sales ...', 'multiple' => true]]);
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">
    <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
</div>
<?php 
ActiveForm::end();
?>

<?php 
?>

示例#27
0
 /**
  * @param null $options
  * @param null $pluginOptions
  *
  * @return string
  * @throws \Exception
  */
 public function getItem($options = null, $pluginOptions = null)
 {
     switch ($this->type) {
         case self::TYPE_TEXT:
             return Html::input('text', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_EMAIL:
             return Html::input('email', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_NUMBER:
             return Html::input('number', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_TEXTAREA:
             return Html::textarea('Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
         case self::TYPE_COLOR:
             return ColorInput::widget(['value' => $this->value, 'name' => 'Setting[' . $this->code . ']', 'options' => $options != null ? $options : ['class' => 'form-control']]);
         case self::TYPE_DATE:
             return DatePicker::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['format' => 'yyyy-mm-dd', 'todayHighlight' => true]]);
         case self::TYPE_TIME:
             return TimePicker::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['minuteStep' => 1, 'showSeconds' => true, 'showMeridian' => false]]);
         case self::TYPE_DATETIME:
             return DateTimePicker::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => ['format' => 'yyyy-mm-dd H:i:s', 'todayHighlight' => true]]);
         case self::TYPE_PASSWORD:
             return PasswordInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['showMeter' => true, 'toggleMask' => false]]);
         case self::TYPE_ROXYMCE:
             return RoxyMceWidget::widget(['id' => 'Setting_' . $this->code, 'name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'action' => Url::to(['roxymce/default']), 'options' => $options != null ? $options : ['title' => $this->getName()], 'clientOptions' => $pluginOptions != null ? $pluginOptions : []]);
         case self::TYPE_SELECT:
             return Select2::widget(['value' => $this->value, 'name' => 'Setting[' . $this->code . ']', 'data' => $this->getStoreRange(), 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => ['allowClear' => true]]);
         case self::TYPE_MULTI_SELECT:
             $options['multiple'] = true;
             if (!isset($options['class'])) {
                 $options['class'] = 'form-control';
             }
             return Select2::widget(['name' => 'Setting[' . $this->code . ']', 'value' => explode(",", $this->value), 'data' => $this->getStoreRange(), 'options' => $options, 'pluginOptions' => ['allowClear' => true]]);
         case self::TYPE_FILE_PATH:
             $value = Yii::getAlias($this->store_dir) . DIRECTORY_SEPARATOR . $this->value;
             return FileInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $value, 'options' => $options != null ? $options : ['class' => 'form-control', 'multiple' => false], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['previewFileType' => 'any', 'showRemove' => false, 'showUpload' => false, 'initialPreview' => !$this->isNewRecord ? [$this->value] : []]]);
         case self::TYPE_FILE_URL:
             $value = $this->store_url . '/' . $this->value;
             return FileInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $value, 'options' => $options != null ? $options : ['class' => 'form-control'], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['previewFileType' => 'any', 'showRemove' => false, 'showUpload' => false, 'initialPreviewAsData' => true, 'initialPreviewFileType' => self::fileType(pathinfo($this->value, PATHINFO_EXTENSION)), 'initialPreview' => !$this->isNewRecord ? $value : [], 'initialCaption' => $this->value]]);
         case self::TYPE_PERCENT:
             return RangeInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $this->value, 'html5Options' => ['min' => 0, 'max' => 100, 'step' => 1], 'options' => $options != null ? $options : ['class' => 'form-control'], 'addon' => ['append' => ['content' => '%']]]);
         case self::TYPE_SWITCH:
             $selector = explode(',', $this->store_range);
             if (count($selector) != 2) {
                 throw new ErrorException(Yii::t('setting', 'Switch Field should have store with 2 value, and negative is first. Example: no,yes'), 500);
             }
             return Html::hiddenInput('Setting[' . $this->code . ']', $selector[0]) . SwitchInput::widget(['name' => 'Setting[' . $this->code . ']', 'value' => $selector[1], 'containerOptions' => ['class' => 'nv-switch-container'], 'options' => $options != null ? $options : [], 'pluginOptions' => $pluginOptions != null ? $pluginOptions : ['state' => $this->value == $selector[1], 'size' => 'small', 'offText' => ucfirst($selector[0]), 'onText' => ucfirst($selector[1])]]);
         case self::TYPE_CHECKBOX:
             $random = rand(1000, 9999);
             return Html::checkboxList('Setting[' . $this->code . ']', explode(",", $this->value), $this->getStoreRange(), $options != null ? $options : ['class' => 'nv-checkbox-list checkbox', 'item' => function ($index, $label, $name, $checked, $value) use($random) {
                 $html = Html::beginTag('div');
                 $html .= Html::checkbox($name, $checked, ['id' => 'Setting_checkbox_' . $label . '_' . $index . '_' . $random, 'value' => $value]);
                 $html .= Html::label($label, 'Setting_checkbox_' . $label . '_' . $index . '_' . $random);
                 $html .= Html::endTag('div');
                 return $html;
             }]);
         case self::TYPE_RADIO:
             $random = rand(1000, 9999);
             return Html::radioList('Setting[' . $this->code . ']', $this->value, $this->getStoreRange(), $options != null ? $options : ['class' => 'nv-checkbox-list radio', 'item' => function ($index, $label, $name, $checked, $value) use($random) {
                 $html = Html::beginTag('div');
                 $html .= Html::radio($name, $checked, ['id' => 'Setting_radio_' . $label . '_' . $index . '_' . $random, 'value' => $value]);
                 $html .= Html::label($label, 'Setting_radio_' . $label . '_' . $index . '_' . $random);
                 $html .= Html::endTag('div');
                 return $html;
             }]);
         case self::TYPE_SEPARATOR:
             return '<hr>';
         default:
             return Html::input('text', 'Setting[' . $this->code . ']', $this->value, $options != null ? $options : ['placeholder' => $this->getName(), 'class' => 'form-control']);
     }
 }
示例#28
0
    <?php 
Pjax::begin(['id' => 'pjax-gridview']);
?>

    <?php 
$dataEmitens = \yii\helpers\ArrayHelper::map(app\models\Emiten::find()->select(['KODE', 'NAMA', 'DERIVED' => 'CONCAT(KODE," - ",NAMA)'])->asArray()->all(), 'KODE', 'KODE');
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'responsive' => true, 'responsiveWrap' => true, 'hover' => true, 'resizableColumns' => false, 'showFooter' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-th"></i> <span class="hidden-xs"></span> ' . Html::encode($this->title) . '</h3>', 'before' => '
              <div class="row">' . '<div class="col-xs-2 col-md-1">' . Html::dropDownList('per-page', $perpage, ['2' => '2', '10' => '10', '20' => '20', '50' => '50', '100' => '100', 'all' => 'all'], ['id' => 'per-page', 'class' => 'form-control']) . '</div>' . '<div class="col-xs-6 col-md-4">' . \kartik\widgets\Select2::widget(['name' => 'emitens', 'data' => $dataEmitens, 'value' => $emitens, 'options' => ['placeholder' => 'Pilih Emiten ...', 'onchange' => '
                        $.pjax.reload("#pjax-gridview", {
                          url: "' . Url::to(['index']) . '?emitens="+$(this).val(),
                          container: "#pjax-gridview",
                          timeout: 3000,
                          push: false,
                          replace: false
                        });
                    '], 'pluginOptions' => ['allowClear' => true, 'multiple' => true]]) . '</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' => 'KODE', 'label' => 'Kode', 'options' => ['width' => '100px'], 'hAlign' => 'center', 'vAlign' => 'middle'], ['attribute' => 'JMLLOT', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['attribute' => 'JMLSAHAM', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'format' => ['decimal', 2], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['header' => 'Range Beli', 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) use($lotshare) {
    //-	Range Beli = saldob / (jmllotb * jmllbrsaham) -> Ket:  saldob, jmllotb dr detemiten; jmllbrsaham dr lotshare.
    $detemiten = Detemiten::find()->where(['EMITEN_KODE' => $data->KODE])->orderBy('TGL DESC')->one();
    $range_beli = (double) @($detemiten->SALDOB / ($detemiten->JMLLOTB * $lotshare));
    return number_format($range_beli, 2);
    //-	Laba/Rugi = (jmlsaham * harga) - saldo
}], ['header' => 'Range', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    //- Range = Saldo / Jml Saham
    return @($data->SALDO / $data->JMLSAHAM);
}], ['attribute' => 'SALDO', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['attribute' => 'HARGA', 'format' => ['decimal', 2], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'filter' => false], ['header' => 'Tgl Akhir', 'format' => ['date', 'php:d/M/Y'], 'options' => ['width' => '100px'], 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'right', 'vAlign' => 'middle', 'value' => function ($data) {
    //-	Range Beli = saldob / (jmllotb * jmllbrsaham) -> Ket:  saldob, jmllotb dr detemiten; jmllbrsaham dr lotshare.
    $detemiten = Detemiten::find()->where(['EMITEN_KODE' => $data->KODE])->orderBy('TGL DESC')->one();
				],
				]);*/
echo Html::activeLabel($models[$i], $idprodutoInsumo, ['class'=>'control-label']);
echo Select2::widget([
	'model'=>$models[$i],
	'name' =>'Insumos[idprodutoInsumo][]',
    'value' => $models[$i]->idprodutoInsumo, // initial value
    'data' => $insumos,
    
    'options' => ['placeholder' => 'Selecione o insumo',
    'id'=>'idinsumo'.$i,

    ],
    'pluginOptions' => [
    'allowClear'=>true,
    ],
    'pluginEvents'=>[
    "change" => "function() {
    	var s = $(\"#idinsumo".$i."\").val();
    	console.log(s); 
    	if (s == \"\" || s == null) {
    		$(\".help-block-insumo".$i."\").append('</br><div class=\"alert alert-danger\">\"Insumo\" não pode ficar em branco.</div>');
    		//alert('Escolha um insumo ou remova-o');
    	}else{
    		$(\".help-block-insumo".$i."\").remove();
    	}
    }",
    ],
    ]);
?><div class="help-block-insumo<?= $i?>"> </div><?php
echo "</br>";
echo $form->field($models[$i],  $quantidade)->textInput([ 'type' => 'number', 
示例#30
0
    <div class="form-group">
        <label class="controll-label" for="sales">Sales</label>
        <?php 
echo Select2::widget(['model' => $model, 'attribute' => 'sales', 'data' => $saleUsers, 'value' => Yii::$app->request->get('sales'), 'options' => ['placeholder' => 'Select Sales ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
    </div>
    <div class="form-group">
        <label class="controll-label" for="customer">Customer</label>

        <?php 
echo Select2::widget(['model' => $model, 'attribute' => 'customer', 'value' => $model->customer, 'pluginOptions' => ['ajax' => ['url' => Url::to(['service/search-customer']), 'dataType' => 'json', 'data' => new JsExpression('function(term,page){return {search:term}; }'), 'results' => new JsExpression('function(data,page){ return {results:data.results}; }')], 'allowClear' => true, 'initSelection' => new JsExpression('function (element, callback) {
                    var id=$(element).val();
                    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">