示例#1
0
            <?php 
echo $form->field($model, 'sort_order');
?>


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

</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">

<?php 
BackendWidget::begin(['icon' => 'gear', 'title' => Yii::t('app', 'Currency formatting'), 'footer' => Html::a(Icon::show('arrow-circle-left') . Yii::t('app', 'Back'), Yii::$app->request->get('returnUrl', ['/backend/currencies/index', 'id' => $model->id]), ['class' => 'btn btn-danger']) . ' ' . ($model->isNewRecord ? Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go next'), ['class' => 'btn btn-success', 'name' => 'action', 'value' => 'next']) : '') . ' ' . Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go back'), ['class' => 'btn btn-warning', 'name' => 'action', 'value' => 'back']) . ' ' . Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'save'])]);
echo $form->field($model, 'intl_formatting')->textInput()->widget(\kartik\widgets\SwitchInput::className());
echo $form->field($model, 'min_fraction_digits');
echo $form->field($model, 'max_fraction_digits');
echo $form->field($model, 'dec_point');
echo $form->field($model, 'thousands_sep')->dropDownList(['' => 'Don\'t separate', ' ' => 'Space', '.' => 'Dot', ',' => 'Dash']);
echo $form->field($model, 'format_string');
BackendWidget::end();
?>

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


<div class="clearfix"></div>
示例#2
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']);
     }
 }
示例#3
0
文件: view.php 项目: RAPOS/baron-nt
echo $page;
?>
</a></div>
			<div class="breviews-view-name clearfix"> 
				<img src="/images/panel/user.png" width="48"/>
				<span><?php 
echo $model->name;
?>
</span>
			</div>
			<div class="breviews-view-baloon"><?php 
echo $model->text;
?>
</div>
			<?php 
echo $form->field($model, 'moderate', ['labelOptions' => ['class' => 'breviews-label-switch']])->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal', 'onColor' => 'success', 'offColor' => 'danger', 'onText' => 'Включить', 'offText' => 'Выключить']]);
?>
		</div>
		<div class="breviews-view-right">
			<p>
				<span>Дата:</span> 
				<span><?php 
echo Yii::$app->formatter->asTime($model->date, 'php:d.m.Y');
?>
</span>
			</p>
			<p>
				<span>Время:</span> 
				<span><?php 
echo Yii::$app->formatter->asTime($model->date, 'php:H:i:s');
?>
示例#4
0
        <?php 
echo $form->field($model, 'errorMonitorEnabled')->widget(SwitchInput::className());
?>
        <?php 
echo $form->field($model, 'emailNotifyEnabled')->widget(SwitchInput::className());
?>
        <?php 
echo $form->field($model, 'devmail');
?>
        <?php 
echo $form->field($model, 'notifyOnlyHttpCodes');
?>
        <?php 
echo $form->field($model, 'numberElementsToStore');
?>
        <?php 
echo $form->field($model, 'immediateNotice')->widget(SwitchInput::className());
?>
        <?php 
echo $form->field($model, 'immediateNoticeLimitPerUrl');
?>
        <?php 
echo $form->field($model, 'httpCodesForImmediateNotify');
?>
        <?php 
BackendWidget::end();
?>
    </div>
</div>

示例#5
0
文件: _form.php 项目: hdushku/blog
    <?php 
$form = ActiveForm::begin();
?>
	<div class="row">				
		<div class="col-md-6">
			
			<div class="row">				
				<div class="col-xs-8">
			<?php 
echo $form->field($model, 'title')->textInput(['maxlength' => 65, 'placeholder' => Yii::t('app', 'Title contain a seo keyword if possible')]);
?>
				</div>
				<div class="col-xs-4">
			<?php 
echo $form->field($model, 'status')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
		
				</div>						
			</div>

			<?php 
echo $form->field($model, 'description')->textArea(['rows' => 4, 'maxlength' => 155, 'placeholder' => Yii::t('app', 'This description also used as meta description')]);
?>
			
			
			<?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>	
示例#6
0
                        <?php 
echo $form->field($model, 'analytics[ecGoogle][currency]')->dropDownList($currencies)->label(Yii::t('app', 'Currency'));
?>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        <?php 
echo Yii::t('app', 'Yandex ecommerce');
?>
                    </div>
                    <div class="panel-body">
                        <?php 
echo $form->field($model, 'analytics[ecYandex][active]')->widget(SwitchInput::className())->label(Yii::t('app', 'Active'));
?>
                        <?php 
echo $form->field($model, 'analytics[ecYandex][currency]')->dropDownList($currencies)->label(Yii::t('app', 'Currency'));
?>
                    </div>
                </div>
            </div>
        <?php 
BackendWidget::end();
?>
    </div>
    <div class="col-md-6 col-sm-12">
        <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Meta cache'), 'options' => ['class' => 'visible-header']]);
?>
示例#7
0
文件: _form.php 项目: prasgema/cap
/* @var $this yii\web\View */
/* @var $model amilna\cap\models\Transaction */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="transaction-form">

    <?php 
$form = ActiveForm::begin();
?>
	
						
	<div class="pull-right">
	<?php 
echo Yii::t('app', 'Only Template?');
echo SwitchInput::widget(['name' => 'Transaction[template]', 'type' => SwitchInput::CHECKBOX]);
?>
	
	</div>
		
	<div class="row"></div>
		
	<div class="well">
		<div class="row">		
			<div class="col-sm-3">
		<?php 
/*= $form->field($model, 'time')->textInput() */
?>
		<?php 
echo $form->field($model, 'time')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Select transaction time ...', 'readonly' => true], 'removeButton' => false, 'convertFormat' => true, 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:i:s', 'todayHighlight' => true]]);
?>
示例#8
0
<div>
    <div class="col-md-6 col-sm-12">
        <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Main settings'), 'options' => ['class' => 'visible-header']]);
?>
            <?php 
echo $form->field($model, 'mainPage');
?>
            <?php 
echo $form->field($model, 'include');
?>
            <?php 
echo $form->field($model, 'redirectWWW')->dropDownList(SeoModule::getRedirectTypes());
?>
            <?php 
echo $form->field($model, 'redirectTrailingSlash')->widget(SwitchInput::className());
?>
        <?php 
BackendWidget::end();
?>
    </div>
    <div class="col-md-6 col-sm-12">
        <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Meta cache'), 'options' => ['class' => 'visible-header']]);
?>
            <?php 
echo $form->field($model, 'cacheConfig[metaCache][name]')->label(Yii::t('app', 'Name'));
?>
            <?php 
echo $form->field($model, 'cacheConfig[metaCache][expire]')->label(Yii::t('app', 'Duration'));
?>
示例#9
0
echo $form->field($model, 'params')->widget(\devgroup\jsoneditor\Jsoneditor::className(), ['editorOptions' => ['modes' => ['code', 'tree'], 'mode' => 'tree', 'editable' => new \yii\web\JsExpression('function(node) {
                                        return {
                                            field : false,
                                            value : true
                                        };
                                    }
                                ')]]);
?>
            <?php 
echo $form->field($model, 'logo')->textInput(['maxlength' => 255]);
?>
            <?php 
echo $form->field($model, 'commission')->textInput();
?>
            <?php 
echo $form->field($model, 'active')->widget(\kartik\widgets\SwitchInput::className());
?>
            <?php 
echo $form->field($model, 'payment_available')->widget(\kartik\widgets\SwitchInput::className());
?>
            <?php 
echo $form->field($model, 'sort')->textInput();
?>
        <?php 
BackendWidget::end();
?>
    <?php 
ActiveForm::end();
?>
</div>
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use kartik\widgets\SwitchInput;
use kartik\widgets\Select2;
?>
<div class="tab-content default-tab">
    <?php 
echo $form->field($model, 'type')->dropDownList(['system' => Yii::t('app', 'System'), 'user-defined' => Yii::t('app', 'User defined')], ['options' => ['system' => ['disabled' => Yii::$app->user->can('Superadmin') ? false : true], 'user-defined' => ['disabled' => $model->type == 'system' && !Yii::$app->user->can('Superadmin') ? true : false]]]);
echo $form->field($model, 'template_id')->dropDownList(ArrayHelper::map($templates, 'id', 'name'), ['options' => ['system' => ['disabled' => Yii::$app->user->can('Superadmin') ? false : true]]]);
echo $form->field($model, 'homepage')->widget(SwitchInput::classname(), ['inlineLabel' => false, 'pluginOptions' => ['onColor' => 'success', 'offColor' => 'danger', 'onText' => Yii::t('app', 'Yes'), 'offText' => Yii::t('app', 'No')]]);
echo $form->field($model, 'active')->widget(SwitchInput::classname(), ['inlineLabel' => false, 'pluginOptions' => ['onColor' => 'success', 'offColor' => 'danger', 'onText' => Yii::t('app', 'Yes'), 'offText' => Yii::t('app', 'No')]]);
if (Yii::$app->getModule('pages')->enablePrivatePages) {
    echo $form->field($model, 'public')->widget(SwitchInput::classname(), ['inlineLabel' => false, 'pluginOptions' => ['onColor' => 'success', 'offColor' => 'danger', 'onText' => Yii::t('app', 'Yes'), 'offText' => Yii::t('app', 'No')]]);
}
?>
</div>
示例#11
0
                <?php 
echo $form->field($model, 'description')->textarea();
?>
            </div>
            <div class="col-sm-4">
                <?php 
echo $form->field($model, 'langs')->dropDownList(\app\models\tblLangs::makeDropDown(), ['style' => 'width: 150px;']);
echo $form->field($model, 'type')->widget(Select2::classname(), ['data' => \app\models\TblMenutype::makeDropDown($model->langs), 'hideSearch' => true, 'options' => ['placeholder' => 'เลือก...', 'class' => 'form-control ', 'multiple' => false, 'style' => 'width: 98%;']]);
echo $form->field($model, 'parent_id')->widget(DepDrop::classname(), ['type' => DepDrop::TYPE_SELECT2, 'data' => [$model->parent_id => ''], 'options' => ['style' => 'width: 98%;'], 'select2Options' => ['hideSearch' => true], 'pluginOptions' => ['depends' => [Html::getInputId($model, 'type')], 'placeholder' => 'เลือก...', 'url' => Url::to(["getsubmenu"]), 'initialize' => true]]);
?>
            
                <?php 
echo $form->field($model, 'published')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal'], 'inlineLabel' => false]);
?>
                <?php 
echo $form->field($model, 'target')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal', 'onText' => 'หน้าต่างใหม่', 'offText' => 'หน้าต่างเดิม'], 'inlineLabel' => false]);
?>
            </div>
        </div>

        <?php 
echo $form->field($model, 'id', ['options' => ['class' => 'sr-only']])->hiddenInput();
?>
        <?php 
echo $form->field($model, 'langs', ['options' => ['class' => 'sr-only']])->hiddenInput();
?>

        <?php 
ActiveForm::end();
?>
    </div>
示例#12
0
	<?php 
$form = ActiveForm::begin();
?>
	<?php 
$userClass = \Yii::$app->getUser()->identityClass;
$users = ArrayHelper::map($userClass::find()->where(['status' => 10])->asArray()->all(), 'id', 'username');
echo '<div class="form-group">';
echo '<label class="control-label">Receiver</label>';
echo Select2::widget(['name' => 'receivers', 'data' => $users, 'options' => ['placeholder' => 'Select a receiver ...', 'multiple' => true]]);
echo '</div>';
?>
	<?php 
echo $form->field($model, 'subject')->textInput(['maxlength' => 255]);
?>
	<?php 
echo $form->field($model, 'content')->textarea(['rows' => 6]);
?>
		
	<?php 
echo $form->field($model, 'status')->widget(\kartik\widgets\SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Send', 'offText' => 'Draft']]);
?>
	<div class="form-group">
		<?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
	</div>
	<?php 
ActiveForm::end();
?>
</div>
示例#13
0
?>

        <?php 
echo $form->field($model, 'showDeletedOrders')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'defaultMeasureId')->dropDownList(Helper::getModelMap(\app\modules\shop\models\Measure::className(), 'id', 'name'));
?>

        <?php 
echo $form->field($model, 'defaultOrderStageFilterBackend')->dropDownList([0 => ''] + Helper::getModelMap(\app\modules\shop\models\OrderStage::className(), 'id', 'name_short'));
?>

        <?php 
echo $form->field($model, 'useCeilQuantity')->widget(SwitchInput::className());
?>

        <?php 
BackendWidget::end();
?>
    </div>
    <?php 
/**
 * @var bool Allow to add same product in the order
 */
$allowToAddSameProduct = 0;
/**
 * @var bool Count only unique products in the order
 */
$countUniqueProductsOnly = 1;
示例#14
0
文件: _form.php 项目: prasgema/cap
		<div class="col-sm-3">	
	<?php 
echo $form->field($model, 'increaseon')->widget(Select2::classname(), ['data' => $model->itemAlias('increaseon'), 'options' => ['placeholder' => Yii::t('app', 'Select a increase on type...')], 'pluginOptions' => ['allowClear' => false]]);
?>
		</div>
		<div class="col-sm-2">
	
	<?php 
echo $form->field($model, 'isbalance')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
	
		</div>
		<div class="col-sm-2">
	
	<?php 
echo $form->field($model, 'exchangable')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
	
		</div>
	</div>	

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
示例#15
0
文件: _form.php 项目: hdushku/blog
?>
					
		</div>	
		
		<div class="col-md-6">
			<div class="well">
				<div class="row">
					<div class="col-xs-6">
				<?php 
echo $form->field($model, 'status')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
		
					</div>						
					<div class="col-xs-6">
				<?php 
echo $form->field($model, 'image_only')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
		
					</div>				
				</div>			
				<div class="row">
					<div class="col-sm-6 ">
						<?php 
echo $form->field($model, 'time')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Select media time ...', 'readonly' => true], 'removeButton' => false, 'convertFormat' => true, 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:i:s', 'todayHighlight' => true]]);
?>
					</div>
					<div class="col-sm-6 ">
						<?php 
echo $form->field($model, 'position')->widget(TouchSpin::classname(), ['pluginOptions' => ['min' => 0, 'max' => 20, 'step' => 1, 'handle' => 'triangle', 'tooltip' => 'always']]);
?>
					</div>	
示例#16
0
</p>		
	</div>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    <hr/>    
    <?php 
$form = ActiveForm::begin();
?>
    
		<?php 
$opt = [];
foreach ($model as $porton) {
    $opt[] = ['label' => $porton->descripcion, 'value' => $porton->id];
}
echo SwitchInput::widget(['name' => 'eligeporton', 'type' => SwitchInput::RADIO, 'items' => $opt, 'value' => \Yii::$app->session->get('porton'), 'pluginOptions' => ['size' => 'large', 'onText' => 'SI', 'offText' => 'NO'], 'labelOptions' => ['style' => 'font-size: 16px']]);
//\Yii::$app->session->set('porton',1);
?>
		<hr/>
		<div class="form-group">
			<?php 
echo Html::submitButton('Confirmar la selección', ['class' => 'btn btn-primary']);
?>
		</div>		
	<?php 
ActiveForm::end();
?>
		
 
</div>
示例#17
0
?>

        <?php 
echo $form->field($model, 'allowToAddSameProduct')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'countUniqueProductsOnly')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'countChildrenProducts')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'showDeletedOrders')->widget(SwitchInput::className());
?>

        <?php 
echo $form->field($model, 'defaultMeasureId')->dropDownList(Helper::getModelMap(\app\modules\shop\models\Measure::className(), 'id', 'name'));
?>

        <?php 
echo $form->field($model, 'defaultOrderStageFilterBackend')->dropDownList([0 => ''] + Helper::getModelMap(\app\modules\shop\models\OrderStage::className(), 'id', 'name_short'));
?>

        <?php 
BackendWidget::end();
?>
    </div>
    <?php 
示例#18
0
<br>
<?php 
echo $createButton;
?>
<h3 class="header text-left">FILTER USING THE FOLLOWING</h3>
<div id="filters">
<?php 
$form = ActiveForm::begin(['id' => 'filter', 'method' => 'get', 'type' => ActiveForm::TYPE_HORIZONTAL, 'action' => \Yii::$app->urlManager->createUrl(['/search/filter', '__format' => 'json', '_type' => $model->isWhat()]), 'options' => ['class' => 'form-horizontal', "role" => "filter", 'data-id' => $isWhat], 'fieldConfig' => ['inputOptions' => ['class' => 'form-control'], 'template' => '{label}<div class="col-lg-9 col-md-9">{input}</div><div class="col-lg-12">{error}</div>', 'labelOptions' => ['class' => 'col-lg-3 col-md-3 control-label']]]);
?>
	<?php 
echo Html::submitButton(Html::tag('span', '', ['class' => 'glyphicon glyphicon-filter']), ['class' => 'btn btn-primary btn-lg', "title" => "Run this filer"]);
?>
<br><br>
	
	<?php 
echo $form->field($model, 'filter[exclusive]', ['options' => ['data-toggle' => 'tooltip', 'title' => "When set to Yes everything set below will be used to find results. Otherwise the search will find anything that matches at least one of the criteria you set."]])->widget(\kartik\widgets\SwitchInput::className(), ['pluginOptions' => ['size' => 'small', 'onText' => 'Yes', 'offText' => 'No']])->label("Match All");
?>
	
	<?php 
echo $form->field($model, 'q')->textInput()->label("Search");
?>

	<?php 
echo $form->field($model, 'type_id')->widget(Select2::className(), ['options' => ['multiple' => true, 'placeholder' => 'Select types...'], 'data' => $model->primaryModel->getCategoryList($model->primaryModel->isWhat() . '-categories')])->label("Type");
?>

	<?php 
echo $form->field($model, 'request_for_id')->widget(Select2::className(), ['options' => ['multiple' => true, 'placeholder' => 'Select for...'], 'data' => $model->primaryModel->getCategoryList($model->primaryModel->isWhat() . '-for')])->label("For");
?>

	<?php 
示例#19
0
?>

    <?php 
echo $form->field($model, 'allDay')->widget(\kartik\widgets\SwitchInput::className(), ['pluginOptions' => ['onText' => '是', 'offText' => '否', 'onColor' => 'success', 'offColor' => 'danger']]);
?>

    <?php 
echo $form->field($model, 'editable')->widget(\kartik\widgets\SwitchInput::className(), ['pluginOptions' => ['onText' => '是', 'offText' => '否', 'onColor' => 'success', 'offColor' => 'danger']]);
?>

    <?php 
echo $form->field($model, 'startEditable')->widget(\kartik\widgets\SwitchInput::className(), ['pluginOptions' => ['onText' => '是', 'offText' => '否', 'onColor' => 'success', 'offColor' => 'danger']]);
?>

    <?php 
echo $form->field($model, 'durationEditable')->widget(\kartik\widgets\SwitchInput::className(), ['pluginOptions' => ['onText' => '是', 'offText' => '否', 'onColor' => 'success', 'offColor' => 'danger']]);
?>

  
	<?php 
if (!Yii::$app->request->isAjax) {
    ?>
	  	<div class="form-group">
	        <?php 
    echo Html::submitButton('保存', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
    ?>
	    </div>
	<?php 
}
?>
示例#20
0
文件: _form.php 项目: RAPOS/baron-nt
$form = ActiveForm::begin();
?>
	<div class="clearfix">
		<div style="float: left;">
			<?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true, 'style' => 'width: 250px;']);
?>
		</div>
		<div style="float: left;margin-left: 39px;">
			<?php 
echo $form->field($model, 'new')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal', 'onColor' => 'success', 'offColor' => 'danger', 'onText' => 'Включить', 'offText' => 'Выключить']]);
?>
		</div>
		<div style="float: left;margin-left: 39px;">
			<?php 
echo $form->field($model, 'tour')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal', 'onColor' => 'success', 'offColor' => 'danger', 'onText' => 'Включить', 'offText' => 'Выключить']]);
?>
		</div>
	</div>
	<div class="clearfix">
		<div style="float: left;">
			<?php 
echo $form->field($model, 'age')->textInput(['style' => 'width: 50px;', 'maxlength' => 2]);
?>
		</div>
		<div style="float: left;margin-left: 150px;">
			<?php 
echo $form->field($model, 'growth')->textInput(['style' => 'width: 50px;', 'maxlength' => 3]);
?>
		</div>
		<div style="float: left;margin-left: 150px;">
<?php

use yii\helpers\Html;
use kartik\widgets\SwitchInput;
?>
<div class="tab-content default-tab">

    <div class="form-group">
        <label class="control-label"><?php 
echo Yii::t('app', 'Example');
?>
</label>
        <a href="<?php 
echo $model->getUrl("{$slider->width}x{$slider->height}");
?>
" class="fancybox">
            <img class="img-responsive thumbnail" src="<?php 
echo $model->getUrl('350x');
?>
">    
        </a>    
    </div>
    
    <?php 
echo $form->field($model, 'active')->widget(SwitchInput::classname(), ['pluginOptions' => ['onColor' => 'success', 'offColor' => 'danger', 'onText' => Yii::t('app', 'Yes'), 'offText' => Yii::t('app', 'No')]]);
?>
</div>
示例#22
0

    </div>
    <div class="col-md-6 col-sm-12">
        <h2><?php 
echo Yii::t('app', 'Add new component');
?>
</h2>
        <?php 
foreach ($model['defaultComponents'] as $componentName => $componentConf) {
    BackendWidget::begin(['id' => $componentName, 'title' => Yii::t('app', $componentName), 'options' => ['class' => 'visible-header']]);
    $necessaryContent = $form->field($model, "defaultComponents[{$componentName}][name]")->label('name');
    foreach ($componentConf['necessary'] as $necessaryConfName => $necessaryConfVal) {
        $content = $form->field($model, "defaultComponents[{$componentName}][necessary][{$necessaryConfName}]")->label($necessaryConfName);
        if (is_bool($necessaryConfVal) === true || $necessaryConfName === 'active') {
            $content = $content->widget(\kartik\widgets\SwitchInput::className());
        }
        $necessaryContent .= $content;
    }
    $unnecessaryContent = '';
    foreach ($componentConf['unnecessary'] as $unnecessaryConfName => $unnecessaryConfVal) {
        $unnecessaryContent .= $form->field($model, "defaultComponents[{$componentName}][unnecessary][{$unnecessaryConfName}]")->label($unnecessaryConfName);
    }
    echo Tabs::widget(['items' => [['label' => Yii::t('app', 'necessary'), 'content' => $necessaryContent], ['label' => Yii::t('app', 'unnecessary'), 'content' => $unnecessaryContent]]]);
    BackendWidget::end();
}
?>
    </div>
</div>

示例#23
0
?>

<div class="user-form">
  <div class="row">
    <div class="col-md-6">
     <?php 
$form = ActiveForm::begin();
?>
     <?php 
echo $form->field($model, 'username')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>
    <?php 
echo $form->field($model, 'status')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Aktif', 'offText' => 'Banned']]);
?>

    <?php 
echo $form->field($authAssignment, 'item_name')->widget(Select2::classname(), ['data' => $authItems, 'options' => ['placeholder' => 'Pilih role ...'], 'pluginOptions' => ['allowClear' => true]])->label('Hak Akses');
?>
  
    </div>
    <div class="col-md-6">

      <?php 
echo $form->field($model, 'new_password');
?>
      <?php 
echo $form->field($model, 'repeat_password');
?>
示例#24
0
文件: _form.php 项目: letyii/cms
?>

<?php 
$form = ActiveForm::begin(['id' => 'formDefault', 'options' => ['enctype' => 'multipart/form-data']]);
echo Html::hiddenInput('save_type', 'save');
echo $form->field($model, 'category_id')->widget(\app\components\FieldCategory::className());
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
echo $form->field($model, 'content')->widget(letyii\tinymce\Tinymce::className(), ['options' => ['id' => 'testid', 'class' => 'abc'], 'configs' => ['selector' => 'textarea#testid', 'link_list' => [['title' => 'My page 1', 'value' => 'http://www.tinymce.com'], ['title' => 'My page 2', 'value' => 'http://www.tinymce.com']]]]);
echo FieldRange::widget(['form' => $form, 'model' => $model, 'useAddons' => false, 'label' => 'Time range', 'attribute1' => 'from_time', 'attribute2' => 'to_time', 'type' => FieldRange::INPUT_DATETIME]);
//echo $form->field($model, 'from_time')->widget(DateTimePicker::className([
//    'type' => DateTimePicker::TYPE_INPUT,
//    'pluginOptions' => [
//        'autoclose'=>true,
//        'format' => 'dd-mm-yyyy hh:ii'
//    ]
//]));
echo $form->field($model, 'promotion')->widget(SwitchInput::className(['type' => SwitchInput::RADIO]));
echo $form->field($model, 'status')->widget(SwitchInput::className(['type' => SwitchInput::RADIO]));
$imageConfig = ['options' => ['accept' => 'uploads/*'], 'pluginOptions' => ['previewFileType' => 'image', 'showCaption' => FALSE, 'showRemove' => FALSE, 'showUpload' => FALSE, 'browseClass' => 'btn btn-primary btn-block', 'browseIcon' => '<i class="glyphicon glyphicon-camera"></i> ', 'browseLabel' => 'Select Photo']];
if (!empty($model->image)) {
    $imageConfig['pluginOptions']['initialPreview'] = Html::img(LetHelper::getFileUploaded($model->image), ['class' => 'file-preview-image']);
}
echo $form->field($model, 'image')->widget(FileInput::classname(), $imageConfig);
echo $form->field($model, 'author')->textInput(['maxlength' => 255]);
echo $form->field($model, 'source')->textInput(['maxlength' => 255]);
echo $form->field($model, 'seo_url')->textInput(['maxlength' => 255]);
echo $form->field($model, 'intro')->textInput(['maxlength' => 500]);
echo $form->field($model, 'tags')->textInput(['maxlength' => 500]);
echo $form->field($model, 'seo_title')->textInput(['maxlength' => 70]);
echo $form->field($model, 'seo_desc')->textInput(['maxlength' => 160]);
ActiveForm::end();
示例#25
0
?>
</div>
<?php 
$this->endBlock('submit');
?>

<div class="row">
    <div class="col-md-4" id="jstree-more">
        <?php 
$form = ActiveForm::begin(['id' => 'newsletter_config', 'type' => ActiveForm::TYPE_VERTICAL, 'method' => 'get']);
?>

            <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Newsletter config'), 'icon' => 'cogs', 'footer' => $this->blocks['submit']]);
?>
                <?php 
echo $form->field($model, 'isActive')->textInput()->widget(\kartik\widgets\SwitchInput::className());
?>
            <?php 
BackendWidget::end();
?>

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



示例#26
0
文件: update.php 项目: jatuponp/iweb
            <?php 
echo $form->field($model, 'id', ['options' => ['class' => 'sr-only']])->hiddenInput();
?>
            <?php 
echo $form->field($model, 'langs', ['options' => ['class' => 'sr-only']])->hiddenInput();
?>
        </div>
        <div class="col-lg-4">
            <?php 
echo $form->field($model, 'langs')->dropDownList(\app\models\tblLangs::makeDropDown(), ['style' => 'width: 140px;', 'disabled' => 'disabled', 'onchange' => 'form.submit();']);
?>
            <?php 
echo $form->field($model, 'cid')->dropDownList(Categories::makeDropDown($model->langs), ['style' => 'margin-right: 10px; width: 230px;']);
?>
            <?php 
echo $form->field($model, 'published')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'normal'], 'inlineLabel' => false]);
echo $form->field($model, 'startdate')->widget(DatePicker::classname(), ['options' => ['placeholder' => 'เริ่มวันที่', 'style' => 'width: 160px;'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
echo $form->field($model, 'finishdate')->widget(DatePicker::classname(), ['options' => ['placeholder' => 'สิ้นสุดวันที่', 'style' => 'width: 160px;'], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>
    
        </div>
    </div>
    <?php 
if (Yii::$app->user->can('Administrator')) {
    ?>
        <div class="row">
            <div class="col-md-12">
                <?php 
    echo $form->field($model, 'upload_files[]')->widget(FileInput::classname(), ['options' => ['multiple' => true], 'pluginOptions' => ['showPreview' => true, 'showUpload' => false, 'showCaption' => false, 'uploadClass' => 'btn btn-info', 'removeClass' => 'btn btn-danger', 'elCaptionText' => '#customCaption']]);
    ?>
                <div class="file-input">
示例#27
0
use kartik\daterange\DateRangePicker;
use softark\duallistbox\DualListbox;
use kartik\widgets\SwitchInput;
/* @var $this yii\web\View */
/* @var $model lukisongroup\models\widget\Pilotproject */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="pilotproject-form">

    <?php 
$form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'validationUrl' => Url::toRoute('/widget/pilotproject/valid')]);
?>
	
	 <?php 
echo $form->field($model, 'TYPE')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Private', 'offText' => 'Public']]);
?>

    <?php 
echo $form->field($model, 'parentpilot')->checkbox();
?>

    <div id='prnt'>
    <?php 
echo $form->field($model, 'PARENT')->widget(Select2::classname(), ['data' => $parent, 'options' => ['id' => 'pilotproject-parent', 'placeholder' => 'Pilih...'], 'pluginOptions' => ['allowClear' => true]]);
?>
    </div>

  
	  <?php 
echo $form->field($model, 'PILOT_NM')->textInput();
示例#28
0
    echo $form->field($model, 'option_' . $i . '_name')->textInput(['maxlength' => true]);
    ?>
                    </div>
                    <div class="col-sm-3">
                        <?php 
    echo $form->field($model, 'option_' . $i . '_type')->dropDownList([''] + Template::getTypesField(), ['class' => 'ex-field-type form-control']);
    ?>
                    </div>
                    <div class="col-sm-3">
                        <?php 
    echo $form->field($model, 'option_' . $i . '_param')->textInput(['maxlength' => true]);
    ?>
                    </div>
                    <div class="col-sm-3">
                        <?php 
    echo $form->field($model, 'option_' . $i . '_require')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Да', 'offText' => 'Нет']]);
    ?>
                    </div>
                </div>
            <?php 
}
?>
        </div>
    </div>

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

        <?php 
if (!$model->isNewRecord) {
示例#29
0
?>

    <div class="row">
      <div class="col-md-9">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">Simulasi Pembelian &amp; Penjualan Saham</h3>
          </div>
          <div class="panel-body">
            <?php 
$form = ActiveForm::begin(['options' => ['data-pjax' => true]]);
?>

            <div>
              <?php 
echo $form->field($simulation, 'tipe')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Pembelian', 'offText' => 'Penjualan']])->label('Pilih tipe simulasi');
?>
            </div>
            <div class="row">
              <div class="col-xs-6">
                <div class="row">
                  <div class="col-xs-6">
                    <?php 
echo $form->field($simulation, 'jml_lot')->widget(MaskedInput::classname(), ['clientOptions' => ['alias' => 'numeric', 'groupSeparator' => ',', 'radixPoint' => '.', 'autoGroup' => true, 'removeMaskOnSubmit' => true]]);
?>
                  </div>
                  <div class="col-xs-6">
                  </div>
                </div>
                <div class="row">
                  <div class="col-xs-6">
示例#30
0
                    <td>Suspensión</td>
                    <td><?php 
echo $form->field($model, 'dia_suspension')->textInput(['maxlength' => true])->label(false);
?>
</td>
                    <td><?php 
echo Html::tag('span', 'días después del vencimiento de la factura');
?>
</td>
                    <td><?php 
echo $form->field($model, 'notificar_suspension_plataforma')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'small', 'onColor' => 'success', 'offColor' => 'danger']])->label(false);
?>
</td>
                    <td>
                        <?php 
echo $form->field($model, 'notificar_suspension_correo')->widget(SwitchInput::classname(), ['pluginOptions' => ['size' => 'small', 'onColor' => 'success', 'offColor' => 'danger']])->label(false);
?>
                    </td>
                </tr>

            </table>

        </div>


    </div>
</div>


<div class="form-group">
    <?php