public function dateTime($options = [])
 {
     $this->parts['{input}'] = DateTimePicker::widget(['model' => $this->model, 'attribute' => $this->attribute, 'options' => $options]);
     return $this;
 }
Example #2
0
?>
			
	</div>

	<?php 
echo $form->field($model, 'PILOT_NM')->textInput();
?>

	<?php 
echo $form->field($model, 'PLAN_DATE1')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Enter date ...'], 'pluginOptions' => ['autoclose' => true], 'pluginEvents' => ['show' => "function(e) {show}"]]);
?>

  

 <?php 
echo $form->field($model, 'PLAN_DATE2')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Enter date ...'], 'pluginOptions' => ['autoclose' => true], 'pluginEvents' => ['show' => "function(e) {show}"]]);
?>

    

<?php 
echo $form->field($model, 'DESTINATION_TO')->widget(Select2::classname(), ['data' => $dropemploy, 'options' => ['placeholder' => 'Pilih Karyawan ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
	
		
	<div style="text-align: right;"">
		<?php 
echo Html::submitButton('Submit', ['class' => 'btn btn-primary']);
?>
	</div>
	<?php 
Example #3
0
echo $form->field($model, 'precio')->textInput(['maxlength' => true]);
?>

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

    <?php 
echo $form->field($model, 'dia')->textInput();
?>

    <?php 
echo $form->field($model, 'fecha_ini')->widget(DateTimePicker::classname(), ['name' => 'datetime_20', 'type' => DateTimePicker::TYPE_COMPONENT_APPEND, 'options' => ['placeholder' => 'Seleccione fecha...'], 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:ii', 'autoclose' => true]]);
?>

    <?php 
echo $form->field($model, 'fecha_fin')->widget(DateTimePicker::classname(), ['name' => 'datetime_20', 'type' => DateTimePicker::TYPE_COMPONENT_APPEND, 'options' => ['placeholder' => 'Seleccione fecha...'], 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:ii', 'autoclose' => true]]);
?>

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

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

</div>
<div class="form-group">
    <?php 
if ($label) {
    ?>
<label class="control-label"><?php 
    echo $label;
    ?>
</label><?php 
}
?>
    <?php 
echo \kartik\widgets\DateTimePicker::widget(['name' => $name, 'value' => $value ? $value : "", 'options' => ['placeholder' => 'выберите дату', 'data-name' => $name], 'pluginOptions' => ['format' => 'dd.mm.yyyy hh:ii', 'todayHighlight' => true]]);
?>
</div>
Example #5
0
?>

    <?php 
echo $form->field($model, 'description')->textInput(['maxlength' => true, 'placeholder' => 'Description']);
?>

    <?php 
echo $form->field($model, 'allDay')->textInput(['placeholder' => 'AllDay']);
?>

    <?php 
echo $form->field($model, 'start')->widget(\kartik\widgets\DateTimePicker::classname(), ['options' => ['placeholder' => 'Choose Start'], 'pluginOptions' => ['autoclose' => true, 'format' => 'mm/dd/yyyy hh:ii:ss']]);
?>

    <?php 
echo $form->field($model, 'end')->widget(\kartik\widgets\DateTimePicker::classname(), ['options' => ['placeholder' => 'Choose End'], 'pluginOptions' => ['autoclose' => true, 'format' => 'mm/dd/yyyy hh:ii:ss']]);
?>

    <?php 
echo $form->field($model, 'dow')->textInput(['maxlength' => true, 'placeholder' => 'Dow']);
?>

    <?php 
echo $form->field($model, 'url')->textInput(['maxlength' => true, 'placeholder' => 'Url']);
?>

    <?php 
echo $form->field($model, 'className')->textInput(['maxlength' => true, 'placeholder' => 'ClassName']);
?>

    <?php 
Example #6
0
                    </div>
                </div>
                <?php 
echo $form->field($model, 'language')->dropDownList(Yii::$app->getLanguagesList(), ['prompt' => Yii::t('gromver.platform', 'Select ...'), 'id' => 'language']);
?>

                <?php 
echo $form->field($model, 'category_id')->widget(\kartik\widgets\DepDrop::className(), ['pluginOptions' => ['depends' => ['language'], 'placeholder' => Yii::t('gromver.platform', 'Select ...'), 'url' => \yii\helpers\Url::to(['categories', 'selected' => $model->category_id])]]);
?>

                <?php 
echo $form->field($model, 'status')->dropDownList(['' => Yii::t('gromver.platform', 'Select ...')] + $model->statusLabels());
?>

                <?php 
echo $form->field($model, 'published_at')->widget(\kartik\widgets\DateTimePicker::className(), ['options' => ['value' => date('d.m.Y H:i', is_int($model->published_at) ? $model->published_at : time())], 'pluginOptions' => ['format' => 'dd.mm.yyyy hh:ii', 'autoclose' => true]]);
?>
            </div>

            <div id="advanced-options" class="tab-pane">
                <?php 
echo $form->field($model, 'preview_text')->textarea(['rows' => 6]);
?>

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

                <?php 
echo $form->field($model, 'tags')->widget(\dosamigos\selectize\Selectize::className(), ['options' => ['multiple' => true], 'items' => \yii\helpers\ArrayHelper::map($model->tags, 'id', 'title', 'group'), 'clientOptions' => ['maxItems' => 'NaN'], 'url' => ['/grom/tag/default/tag-list']]);
?>
Example #7
0
?>

            <?php 
echo $form->field($model, 'announce')->widget(Yii::$app->getModule('core')->wysiwyg_class_name(), Yii::$app->getModule('core')->wysiwyg_params());
?>

            <?php 
echo $form->field($model, 'content')->widget(Yii::$app->getModule('core')->wysiwyg_class_name(), Yii::$app->getModule('core')->wysiwyg_params());
?>

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

            <?php 
echo $form->field($model, 'date_added')->widget(DateTimePicker::classname(), ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd hh:ii', 'todayHighlight' => true, 'todayBtn' => true]]);
?>

            <?php 
if ($model->isNewRecord === false) {
    echo $form->field($model, 'parent_id')->dropDownList(ArrayHelper::merge([0 => Yii::t('app', 'Root')], ArrayHelper::map(\app\modules\shop\models\Category::find()->where('id != :id', ['id' => $model->id])->all(), 'id', 'name')));
}
?>
            <?php 
BackendWidget::end();
?>

            <?php 
BackendWidget::begin(['title' => Yii::t('app', 'Images'), 'icon' => 'image', 'footer' => $this->blocks['submit']]);
?>
Example #8
0
<div class="card-form">

    <?php 
$form = ActiveForm::begin();
?>

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

    <?php 
echo $form->field($model, 'creation_date')->widget(\kartik\widgets\DateTimePicker::className(), $params);
?>

    <?php 
echo $form->field($model, 'deactivation_date')->widget(\kartik\widgets\DateTimePicker::className(), $params);
?>

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

    <?php 
echo $form->field($model, 'status')->dropDownList([Card::StatusArray()]);
?>

    <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>
Example #9
0
    <?php 
$form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'validationUrl' => Url::toRoute('/purchasing/salesman-order/valid-alias-header')]);
?>

    

    <?php 
echo $form->field($model, 'parent_cusid')->widget(Select2::classname(), ['data' => $data_cus, 'options' => ['placeholder' => 'Pilih parent Customers..'], 'pluginOptions' => ['allowClear' => true]]);
?>

    <?php 
echo $form->field($model, 'CUST_ID')->widget(DepDrop::classname(), ['options' => ['placeholder' => 'Select Customers'], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['soheader-parent_cusid'], 'url' => Url::to(['/purchasing/salesman-order/lis-child-cus']), 'loadingText' => 'Loading data ...']]);
?>

    <?php 
echo $form->field($model, 'TGL')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => ' pilih ...'], 'pluginOptions' => ['autoclose' => true], 'pluginEvents' => ['show' => "function(e) {errror}"]]);
?>


     <?php 
echo $form->field($model, 'USER_SIGN1')->widget(Select2::classname(), ['data' => $data_user, 'options' => ['placeholder' => 'Pilih User..'], 'pluginOptions' => ['allowClear' => true]]);
?>


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

    <?php 
Example #10
0
<div class="news-form">

    <?php 
$form = ActiveForm::begin();
?>

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

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

    <?php 
echo $form->field($model, 'date')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Enter event time ...'], 'pluginOptions' => ['autoclose' => true, 'format' => 'dd.mm.yyyy hh:ii']]);
?>

    <?php 
echo $form->field($model, 'text')->widget(\dosamigos\tinymce\TinyMce::className(), ['options' => ['rows' => 6], 'language' => 'ru', 'clientOptions' => ['plugins' => ["advlist autolink lists link charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste"], 'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"]]);
?>

    <?php 
echo $form->field($model, 'approve')->dropDownList([0 => 'Нет', 1 => 'Да']);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
Example #11
0
	<?php 
echo $form->field($model, 'client_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Client::find()->all(), 'id', 'searchableName'), 'options' => ['placeholder' => 'Selecciona un Cliente...'], 'pluginOptions' => ['allowClear' => true]]);
?>
	
    <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(User::find()->all(), 'id', 'user_name'));
?>
	
	<?php 
echo $form->field($model, 'solved')->checkbox([], false);
?>

    <!--?= $form->field($model, 'date_solved')->textInput() ?-->
	
	<?php 
echo $form->field($model, 'date_solved')->widget(DateTimePicker::classname(), ['type' => DateTimePicker::TYPE_INPUT, 'pluginOptions' => ['minuteStep' => 1, 'autoclose' => true, 'format' => 'yyyy-mm-dd H:ii:s', 'todayBtn' => true]]);
?>

    

    <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', 'style' => 'float:left; margin-left:299px;']);
?>
		<?php 
echo Html::a('Cancelar', ['assignation/index'], ['class' => 'btn btn-danger btn-md', 'style' => 'margin-left:396px;']);
?>
    </div>

    <?php 
ActiveForm::end();
Example #12
0
?>

<?php 
if ($this->context->module->settings['enableShort']) {
    ?>
    <?php 
    echo $form->field($model, 'short')->textarea();
}
?>

<?php 
echo $form->field($model, 'text')->widget(\kucha\ueditor\UEditor::className(), ['clientOptions' => ['initialFrameHeight' => '400', 'lang' => 'zh-cn']]);
?>

<?php 
echo $form->field($model, 'time')->widget(\kartik\widgets\DateTimePicker::className(), ['pluginOptions' => ['autoclose' => true]]);
?>

<?php 
if ($this->context->module->settings['enableTags']) {
    ?>
    <?php 
    echo $form->field($model, 'tagNames')->widget(TagsInput::className());
}
?>

<?php 
if (IS_ROOT) {
    ?>
    <?php 
    echo $form->field($model, 'slug');
Example #13
0
    <?php 
$form = ActiveForm::begin();
?>


        <?php 
echo $form->field($model, 'user_id')->dropDownList(ArrayHelper::map(User::find()->all(), 'id', 'firstname'), ['prompt' => 'Pilih Nama']);
?>
           <?php 
echo $form->field($model, 'armada_id')->dropDownList(ArrayHelper::map(Armada::find()->all(), 'armada_id', 'armada_nama'), ['prompt' => 'Pilih Armada']);
?>
        <?php 
echo $form->field($model, 'alamat_penjemputan');
echo $form->field($model, 'start_datetime')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Tanggal Mulai'], 'value' => date('d M Y h:m:s'), 'pluginOptions' => ['format' => 'yyyy-mm-dd h:m:s', 'autoclose' => true]]);
?>
  
    <?php 
echo $form->field($model, 'end_datetime')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Tanggal Mulai'], 'value' => date('d M Y h:m:s'), 'pluginOptions' => ['format' => 'yyyy-mm-dd h:m:s', 'autoclose' => true]]);
?>
    
        <div class="form-group">
            <?php 
echo Html::submitButton('Submit', ['class' => 'btn btn-primary']);
?>
        </div>
    <?php 
ActiveForm::end();
?>

</div><!-- order -->
Example #14
0
	<?php 
if ($model->competition_type == $model::TYPE_MATCH) {
    ?>

    <?php 
    echo $form->field($model, 'course_id')->dropDownList(Course::getCourseList(true));
    ?>

	<?php 
    echo $form->field($model, 'holes')->dropDownList(array(18 => '18', 9 => '9'));
    ?>

	<div class='row'>
		<div class='col-lg-4'>
	    <?php 
    echo $form->field($model, 'start_date')->widget(DateTimePicker::classname(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]])->label(Yii::t('igolf', 'Start Date &amp; Time'));
    ?>
		</div>

		<div class='col-lg-8'>
		<?php 
    echo $form->field($model, 'recurrence_text', ['addon' => ['prepend' => ['content' => Html::button('<span class="glyphicon glyphicon-repeat"></span>', ['class' => 'btn btn-default', 'data' => ['toggle' => 'modal', 'target' => '#recurrence-modal'], 'style' => 'background-color: #eee;']) . PHP_EOL . Html::button('<span class="glyphicon glyphicon-remove"></span>', ['class' => 'btn btn-default remove-recurrence', 'style' => 'background-color: #eee;']), 'asButton' => true]]])->label(Yii::t('igolf', 'Repeat Event'));
    // echo Html::activeHiddenInput($model, 'recurrence');
    echo $form->field($model, 'recurrence')->textInput(['readonly' => true])->label(false);
    echo $this->render('scheduler', ['form' => $form]);
    ?>
		</div>
	</div>

	<div class="clearfix"></div>
	<?php 
Example #15
0
    <div class="row">
        <div class="col-md-7">
            <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
            <?php 
echo $form->field($model, 'category')->dropDownList(['' => ''] + ContentCategory::getLabels());
?>
        </div>
        <div class="col-md-5">
            <?php 
echo $form->field($model, 'publishTime')->widget(DateTimePicker::classname());
?>
            <?php 
echo $form->field($model, 'image')->widget(FileInput::className());
?>
            <?php 
echo $form->field($model, 'isPublished')->checkbox();
?>
        </div>
    </div>
    <?php 
echo $form->field($model, 'previewText')->widget(CKEditor::className());
?>
    <?php 
echo $form->field($model, 'text')->widget(CKEditor::className());
?>
Example #16
0
echo $form->field($model, 'number', ['options' => ['id' => 'number-group-single', 'style' => "display:{$display};"]])->textInput(['id' => 'sendsmsForm-number-single']);
?>
    
    <?php 
echo $form->field($model, 'timeOptions')->radioList($model->getTimeOptions(), ['separator' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'validateOnChange' => false]);
?>
    
    <?php 
if ($model->timeOptions == SendSmsForm::TIME_OPT_DATETIME) {
    $display = 'block';
} else {
    $display = 'none';
}
?>
    <?php 
echo $form->field($model, 'sendingDateTime', ['options' => ['style' => "display:{$display};"]])->widget(DateTimePicker::classname(), ['removeButton' => false, 'options' => ['placeholder' => 'Masukkan Tanggal dan Jam Pengiriman'], 'pluginOptions' => ['autoClose' => true, 'format' => 'yyyy-mm-dd hh:ii:ss']]);
?>
    
    <?php 
if ($model->timeOptions == SendSmsForm::TIME_OPT_DELAY) {
    $display = 'block';
} else {
    $display = 'none';
}
?>
    <?php 
echo $form->field($model, 'sendingTime', ['options' => ['style' => "display:{$display};"]])->widget(TimePicker::className(), ['pluginOptions' => ['showMeridian' => false, 'defaultTime' => '00:00']]);
?>
    
    <?php 
echo $form->field($model, 'text')->widget(TextCounterWidget::className(), ['options' => ['rows' => 5, 'class' => 'form-control'], 'pluginOptions' => ['maxCharacterSize' => 153, 'originalStyle' => 'originalTextareaInfo', 'warningStyle' => 'warningTextareaInfo', 'warningNumber' => 40, 'displayFormat' => '#left Karakter Tersisa']]);
Example #17
0
}
JS
, 'actionHandler' => 'function(url) {return (new URI(url)).addSearch("CategorySearch[language]", $("#' . $idLanguage . '").val())}']) . '</div>'])->widget(\kartik\select2\Select2::className(), ['initValueText' => $model->parent ? $model->parent->isRoot() ? Yii::t('gromver.platform', 'Top Level') : $model->parent->title : null, 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'pluginOptions' => ['allowClear' => true, 'placeholder' => Yii::t('gromver.platform', 'Top Level'), 'ajax' => ['url' => \yii\helpers\Url::to(['category-list', 'exclude' => $model->isNewRecord ? null : $model->id]), 'data' => new \yii\web\JsExpression('function(params) { return {q:params.term, language:$("#' . $idLanguage . '").val()}; }')]]]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'status', ['wrapperOptions' => ['class' => 'col-sm-9']])->dropDownList($model->statusLabels());
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'published_at', ['wrapperOptions' => ['class' => 'col-sm-9']])->widget(\kartik\widgets\DateTimePicker::className(), ['options' => ['value' => Yii::$app->formatter->asDatetime(is_int($model->published_at) ? $model->published_at : time(), 'php:d.m.Y H:i')], 'pluginOptions' => ['format' => 'dd.mm.yyyy hh:ii', 'autoclose' => true]]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
$idTags = Html::getInputId($model, 'tags');
$handlerJs = <<<JS
function(data) {
    var select = \$("#{$idTags}").append('<option value="' + data.id + '">' + data.title + '</option>'),
        selectedValues = select.val() || [];
        selectedValues.push(data.id);

    select.val(\$.unique(selectedValues)).trigger('change');
/** @var \yii\web\View $title */
$this->title = Yii::t('app', 'Post edit');
$this->params['breadcrumbs'][] = ['url' => ['/admin-posts/index'], 'label' => Yii::t('app', 'Posts')];
?>

<div class="row">
    <div class="col-md-12">
        <div class="box">
            <?php 
$form = ActiveForm::begin(['id' => 'post-form', 'type' => ActiveForm::TYPE_HORIZONTAL, 'options' => ['enctype' => 'multipart/form-data']]);
?>
            <div class="box-body">
                <div class="row">
                    <div class="col-md-6 col-xs-12">
                        <?php 
echo $form->field($model, 'created_at')->widget(DateTimePicker::className(), ['type' => DateTimePicker::TYPE_COMPONENT_APPEND, 'pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii', 'todayHighlight' => true]]);
?>
                    </div>
                    <div class="col-md-6 col-xs-12">
                        <?php 
if ($model->photo) {
    ?>
                            <div class="form-group">
                                <div><b><?php 
    echo Yii::t('app', 'Current photo');
    ?>
</b></div>
                                <?php 
    echo Html::img($model->getImageUrl('photo', 'mini'));
    ?>
                            </div>
Example #19
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']);
     }
 }
Example #20
0
File: _form.php Project: poykub/wph
          <div class="row">
            <div class="col-md-4">
              <?php 
echo $form->field($model, 'section_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Section::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'หน่วยงาน/ฝ่าย/แผนก...'], 'pluginOptions' => ['allowClear' => true]]);
?>
            </div>
            <div class="col-md-3">
                  <?php 
echo $form->field($model, 'equipment_id')->inline(true)->radiolist(['1' => 'Software', '2' => 'Hardware', '3' => 'อื่นๆ']);
?>
            </div>
            <div class="col-md-5">
              <?php 
echo '<label>วันที่/เวลา ที่ดำเนินการ</label>';
echo DateTimePicker::widget(['model' => $model, 'attribute' => 'datetime', 'options' => ['placeholder' => 'เลือกวันที่ และเวลา ...'], 'pickerButton' => ['icon' => 'time'], 'removeButton' => false, 'pluginOptions' => ['todayHighlight' => true, 'autoclose' => true, 'showSeconds' => false, 'showMeridian' => false, 'minuteStep' => 1, 'secondStep' => 5], 'language' => 'th']);
?>
            </div>

          </div>

          <div class="row">
            <div class="col-md-12">
                <div class="well">
                    <?php 
echo $form->field($model, 'result')->inline(true)->radiolist(['1' => 'สำเร็จ', '0' => 'ไม่สำเร็จ (ระบุสาเหตุ)']);
?>
                </div>
            </div>
          </div>
Example #21
0
                        <div class="col-lg-4">
                                                       
                            <?php 
if ($model->isNewRecord) {
    ?>
                        
								<?php 
    echo $form->field($model, 'modified')->widget(DateTimePicker::classname(), ['options' => ['disabled' => 'disabled', 'value' => date("Y-m-d H:i:s")], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
    ?>
                                
                            <?php 
} else {
    ?>
                            
                            	<?php 
    echo $form->field($model, 'modified')->widget(DateTimePicker::classname(), ['options' => ['disabled' => 'disabled', 'value' => $model->modified], 'pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd hh:ii:ss']]);
    ?>
                            
                            <?php 
}
?>

                            <?php 
echo $form->field($model, 'created_by')->widget(Select2::classname(), ['data' => [$created_by => $created_by_username], 'addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-user"></i>']]]);
?>
                            
                            <?php 
echo $form->field($model, 'modified_by')->widget(Select2::classname(), ['data' => [$modified_by => $modified_by_username], 'addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-user"></i>']]]);
?>
                            
                            <?php 
Example #22
0
 /**
  * @param \Yii\widgets\ActiveForm $form
  * @param array $options
  * @return \Yii\widgets\ActiveField|static
  */
 public function field($form, $options = [])
 {
     return parent::field($form, $options)->widget(DateTimePicker::className(), ['pluginOptions' => ['format' => $this->format], 'convertFormat' => true]);
 }
Example #23
0
?>

    <?php 
echo $form->field($model, 'message_type')->dropDownList(Message::getLocalizedConstants('TYPE_'));
?>

    <?php 
echo $form->field($model, 'facility_id')->dropDownList(['' => ''] + ArrayHelper::map(Facility::find()->asArray()->all(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'message_start')->widget(DateTimePicker::classname(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'message_end')->widget(DateTimePicker::classname(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(Message::getLocalizedConstants('STATUS_'));
?>

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

    <?php 
ActiveForm::end();
?>
Example #24
0
<?php 
Modal::begin(['id' => 'modal-' . $suffix, 'header' => '<h4>' . $title . '</h4>', 'options' => ['aria-hidden' => 'true']]);
?>
<hr/>
<?php 
$formIdPrefix = 'form_';
$form_id = $formIdPrefix . $suffix;
$pjax_id = 'pjax-' . $suffix;
$pjax = Pjax::begin(['id' => $pjax_id, 'linkSelector' => '#' . 'submit-' . $suffix, 'formSelector' => "#{$form_id}"]);
$form = ActiveForm::begin(['action' => Url::toRoute($action), 'options' => ['anniversary_id' => $id, 'id' => $form_id], 'enableClientValidation' => false, 'enableAjaxValidation' => true]);
?>
<div class="row">
    <div class="col-md-12">
        <?php 
echo $form->field($model, $model->contentAttribute)->widget(DateTimePicker::className(), ['pluginOptions' => ['format' => 'yyyy-mm-dd hh:ii:ss', 'todayHighlight' => true]]);
?>
    </div>
</div>
<div class="row">
    <div class="col-md-6">
        <div class="row">
            <div class="col-md-12">
                <?php 
echo $form->field($model, $model->contentTypeAttribute)->dropDownList($model->contentTypes);
?>
            </div>
        </div>
    </div>
    <div class="col-md-6">
        <div class="row">