示例#1
1
 /**
  * Формирование Html кода поля для вывода в форме
  * @param ActiveForm $form объект форма
  * @param array $options массив html атрибутов поля
  * @param bool|int $index инднкс модели при табличном вводе
  * @return string
  */
 public function renderInput(ActiveForm $form, array $options = [], $index = false)
 {
     $options = ArrayHelper::merge($this->options, $options);
     $widgetOptions = ArrayHelper::merge(["options" => ["class" => "form-control"]], $this->widgetOptions, ["options" => $options]);
     $fieldOptions = ["options" => ["class" => "form-group col-xs-6"]];
     $html = Html::beginTag('div', ['class' => 'row']);
     $html .= $form->field($this->modelField->model, $this->fromAttr, $fieldOptions)->widget(DatePicker::className(), $widgetOptions);
     $html .= $form->field($this->modelField->model, $this->toAttr, $fieldOptions)->widget(DatePicker::className(), $widgetOptions);
     $html .= Html::endTag('div');
     return $html;
 }
示例#2
0
 /**
  * @param $model - profile model
  * @param $field - profile fields model item
  * @param $htmlOptions - htmlOptions
  * @return string
  */
 public function editAttribute($model, $field, $htmlOptions = [])
 {
     if (!isset($htmlOptions['size'])) {
         $htmlOptions['size'] = 60;
     }
     if (!isset($htmlOptions['maxlength'])) {
         $htmlOptions['maxlength'] = $field->field_size ? $field->field_size : 10;
     }
     if (!isset($htmlOptions['id'])) {
         $htmlOptions['id'] = get_class($model) . '_' . $field->varname;
     }
     // $this->params['dateFormat'] = 'yy-mm-dd';
     $this->params['options']['class'] = 'form-control';
     /** @var $afield ActiveForm*/
     $field = $htmlOptions['formField'];
     unset($htmlOptions['formField']);
     return $field->widget(DatePicker::className(), $this->params);
 }
$form = ActiveForm::begin();
?>
    
    <?php 
foreach ($modelGS as $key => $gs) {
    ?>
        <div class="panel panel-primary">
            <div class="panel-heading">     
        <?php 
    echo 'Семестр : ' . $gs->semester_number;
    ?>
            </div>
            <div class="panel-body">
    <?php 
    echo $form->field($gs, "[{$key}]begin_date")->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'dd-MM-yyyy', 'language' => 'ru']);
    echo $form->field($gs, "[{$key}]end_date")->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'dateFormat' => 'dd-MM-yyyy', 'language' => 'ru']);
    ?>
            </div>
        </div>
    <?php 
}
?>
    
    
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
示例#4
0
文件: index.php 项目: ElegguaDP/books
?>

    <?php 
echo $form->field($searchModel, 'name');
?>
    <?php 
echo $form->field($searchModel, 'author_id')->dropDownList($authors, ['prompt' => ''])->label(Yii::t('app', 'Автор'));
?>
    <?php 
echo Yii::t('app', 'Дата выхода книги');
?>
    <?php 
echo $form->field($searchModel, 'date_from')->widget(DatePicker::className(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'yearRange' => '1900:2099', 'changeYear' => true]]);
?>
    <?php 
echo $form->field($searchModel, 'date_to')->widget(DatePicker::className(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'yearRange' => '1900:2099', 'changeYear' => true]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton(Yii::t('app', 'Искать'), ['class' => 'btn btn-primary']);
?>
    </div>

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

</div>
    
    <p>
示例#5
0
文件: index.php 项目: jibendi/shinda2
<!-- Modal -->
<div class="modal fade" id="appointModal" tabindex="-1" role="dialog" aria-labelledby="consentModal">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Change appointment date</h4>
      </div>
      <div class="modal-body">
          <?php 
$model = new Participant();
?>
          
          <?php 
$form = ActiveForm::begin();
?>
          <?php 
echo $form->field($model, 'appoint_date')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control'], 'clientOptions' => ['changeMonth' => true, 'changeYear' => true, 'minDate' => 'today']]);
?>

      </div>
      <div class="modal-footer">
          <input type="hidden" value="" id="idparticipant2" />
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" onClick="updateAppoint()">Submit</button>
      </div>
    </div>
  </div>
</div>

示例#6
0
        						 					  'class'	 => 'uborder disabled help-30percent']) ?>
    	</div>
	</div>

	<?= $form->field($model, 'truck_van', ['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->textInput(['maxlength' => 10,
													  'class' => 'uborder help-20percent',
													  'onchange' => 'setFieldValueToUpperCaseById(this.id, this.value);'])->label('T.PLATE #') ?>

	<?= $form->field($model, 'plant_location', ['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->textInput(['value'	  => Yii::$app->user->identity->assignment,
														   'readonly' => 'readonly',
														   'class'	  => 'uborder disabled help-40percent'])->label('P. Loc') ?>

  	<?= $form->field($model, 'storage_location', ['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->dropDownList($storage_list, ['class'	=> 'uborder help-40percent',
																			   'prompt'	=> '-- Select a storage --'])->label('S. Loc'); ?>

	<?= $form->field($model,'actual_gr_date',['template' => '<div class="control-group">{label}<div class="f-inline-size">{input}</div><div class=\"col-lg-8\">{error}</div></div>'])->widget(DatePicker::className(),[
		'language' 		=> 'en-GB',
		'clientOptions'	=> ['dateFormat'     => 'dd-M-yy',
                            'showOn'        => 'button',
                         	'buttonImage'  => '../images/calendar.gif',
                         	'buttonImageOnly' => 'true',],
       	'options'       => ['class'         => 'uborder disabled help-25percent dateclass',
                            'readonly'        => 'readonly',
                            'dateFormat'     => 'dd-M-yy',]]) ?>

    <?= $form->field($model, 'remarks',
            ['template' => '<div class="control-group">{label}<div class="f-inline-size">
                                <label class="class="control-label">' . Yii::$app->user->identity->username . '@:</label>
                                {input}</div><div class=\"col-lg-8\">{error}</div></div>'])->textarea(['rows'=>'5']) ?>

示例#7
0
      </div>
      <?php 
}
?>
    </div>



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

    <?php 
echo $form->field($model, 'task_start')->widget(\yii\jui\DatePicker::className(), ['options' => ['class' => 'form-control', 'readonly' => 'readonly'], 'dateFormat' => 'dd MMMM yyyy', 'clientOptions' => ['minDate' => 0, 'changeMonth' => true, 'changeYear' => true]]);
?>

<?php 
echo $form->field($model, 'task_end')->widget(\yii\jui\DatePicker::className(), ['options' => ['class' => 'form-control', 'readonly' => 'readonly'], 'dateFormat' => 'dd MMMM yyyy', 'clientOptions' => ['minDate' => 0, 'changeMonth' => true, 'changeYear' => true]]);
?>
   <?php 
echo $form->field($model, 'status')->dropDownList(Status::getTaskStatusList(), ['prompt' => 'Pilih']);
?>



    <?php 
echo $form->field($model, 'period')->dropDownList(Status::getPeriodList(), ['prompt' => 'Pilih']);
?>

   </div>

   <div class="col-lg-12">
    <div class="form-group">
示例#8
0
	</div>
	<div class="box-body"><?php 
$form = ActiveForm::begin(['requiredCssClass' => 'form-group-required']);
?>
		<div class="row">
			<div class="col-md-6">
				<?php 
echo $form->field($searchModel, 'entry_date_from')->widget(DatePicker::className(), ['inline' => false, 'dateFormat' => $phpFmShortDateGui, 'options' => ['class' => 'form-control']]);
?>
				<?php 
echo $form->field($searchModel, 'account_source')->dropDownList($arrFinAccount, ['prompt' => '']);
?>
			</div>
			<div class="col-md-6">
				<?php 
echo $form->field($searchModel, 'entry_date_to')->widget(DatePicker::className(), ['inline' => false, 'dateFormat' => $phpFmShortDateGui, 'options' => ['class' => 'form-control']]);
?>
				<?php 
echo $form->field($searchModel, 'account_target')->dropDownList($arrFinAccount, ['prompt' => '']);
?>
			</div>
			<div class="col-md-6"><div class="form-group">
				<?php 
echo Html::submitButton(Yii::t('button', 'Search'), ['class' => 'btn btn-info', 'name' => MasterValueUtils::SM_MODE_NAME, 'value' => MasterValueUtils::SM_MODE_INPUT]);
?>
			</div></div>
			<div class="col-md-6"><table class="table table-bordered"><thead><tr>
				<th class="warning" style="text-align: left; width: 120px"><?php 
echo Yii::t('fin.grid', 'This Month');
?>
</th>
    <div class="model">
        <?php 
echo $form->errorSummary([$customer, $reservation]);
?>
        <h2>Customer</h2>
        <?php 
echo $form->field($customer, 'name')->textInput();
echo $form->field($customer, 'surname')->textInput();
echo $form->field($customer, 'phone_number')->textInput();
?>
        <h2>Reservation</h2>
        <?php 
echo $form->field($reservation, 'room_id')->dropDownList(ArrayHelper::map(Room::find()->all(), 'id', function ($room) {
    return sprintf('Room #%d. Floor #%d', $room->room_number, $room->floor);
}));
echo $form->field($reservation, 'price_per_day')->textInput();
echo $form->field($reservation, 'date_from')->widget(DatePicker::className(), ['dateFormat' => 'yyyy/MM/dd']);
echo $form->field($reservation, 'date_to')->widget(DatePicker::className(), ['dateFormat' => 'yyyy/MM/dd']);
?>
    </div>
    <div class="form-group">
        <?php 
echo Html::submitButton('Send', ['class' => 'btn btn-primary']);
?>
    </div>
    <?php 
ActiveForm::end();
?>
</div>

示例#10
0
        </div>
        <div class="form-group col-lg-3">
            <?php 
echo $form->field($model, 'book_name')->label('Book name');
?>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-lg-3">
            <?php 
echo $form->field($model, 'book_published_from')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['defaultDate' => '2014-01-01'], 'options' => ['class' => 'form-control'], 'value' => $model->book_published_from]);
?>
        </div>
        <div class="form-group col-lg-3">
            <?php 
echo $form->field($model, 'book_published_to')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['defaultDate' => '2015-01-01'], 'options' => ['class' => 'form-control'], 'value' => $model->book_published_to]);
?>
        </div>
    </div>
    <div class="row">
        <div class="form-group col-lg-6">
            <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary pull-right']);
?>
        </div>
    </div>
    <?php 
ActiveForm::end();
?>
    <?php 
if (!empty($books)) {
示例#11
0
use yii\jui\DatePicker;
/* @var $this \yii\web\View */
/* @var $historyModel \app\modules\discount\models\history */
/* @var $items \app\modules\discount\models\History[] */
$this->title = 'История посещений:';
?>


<div class="row-fluid">
    <div class="col-md-7">
        <div class="well well-sm">
            <?php 
$form = ActiveForm::begin(['options' => ['class' => 'form-inline']]);
?>
            <?php 
echo $form->field($historyModel, 'dateUse')->widget(DatePicker::className(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
?>
            <?php 
echo Html::submitButton('Применить', ['class' => 'btn btn-success']);
?>
 | <?php 
echo Html::a('Сбросить фильтр', ['/discount/user/client-history']);
?>
            <?php 
ActiveForm::end();
?>

        </div>
    </div>
</div>
示例#12
0

    <div class="row">
        <div class="col-md-1">
            <?php 
echo $form->field($model, 'visible')->checkbox(['label' => 'Активен']);
?>
        </div>
        <div class="col-md-6">
            <?php 
echo $form->field($model, 'type')->dropDownList(\app\modules\cms\models\Article::typeList(), ['prompt' => 'Выбор']);
?>
        </div>
        <div class="col-md-5">
            <?php 
echo $form->field($model, 'dateCreate')->widget(\yii\jui\DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => 128]);
?>
        </div>
        <div class="col-md-6">
            <?php 
echo $form->field($model, 'alias')->textInput(['maxlength' => 128]);
?>
        </div>
示例#13
0
文件: _form.php 项目: EduSec/EduSec
	<div class = "col-sm-4 col-xs-12">
	    <?php 
echo $form->field($info, 'emp_gender', ['inputOptions' => ['class' => 'form-control', 'placeholder' => $model->getAttributeLabel('emp_gender')]])->dropDownList($info->getGenderOptions(), ['prompt' => Yii::t('stu', '--- Select Gender ---')]);
?>
	</div>
	  <div class = "col-sm-4 col-xs-12">
		<?php 
echo $form->field($info, 'emp_dob')->widget(yii\jui\DatePicker::className(), ['model' => $info, 'attribute' => 'emp_dob', 'clientOptions' => ['dateFormat' => 'dd-mm-yyyy', 'changeMonth' => true, 'yearRange' => '1900:' . (date('Y') + 1), 'changeYear' => true, 'readOnly' => true, 'autoSize' => true, 'buttonImage' => Yii::$app->homeUrl . "images/calendar.png"], 'options' => ['class' => 'form-control']])->label(true);
?>
	</div>
</div>

<div class="col-xs-12 col-lg-12 col-sm-12">
	<div class = "col-sm-4 col-xs-12">
   		 <?php 
echo $form->field($info, 'emp_joining_date')->widget(yii\jui\DatePicker::className(), ['model' => $info, 'attribute' => 'emp_joining_date', 'clientOptions' => ['dateFormat' => 'dd-mm-yyyy', 'changeMonth' => true, 'yearRange' => '1900:' . (date('Y') + 1), 'changeYear' => true, 'readOnly' => true, 'autoSize' => true, 'buttonImage' => Yii::$app->homeUrl . "images/calendar.png"], 'options' => ['class' => 'form-control']])->label(true);
?>
	</div>
	<div class = "col-sm-4 col-xs-12">
	      <?php 
echo $form->field($model, 'emp_master_department_id')->dropDownList(ArrayHelper::map(app\modules\employee\models\EmpDepartment::find()->where(['is_status' => 0])->all(), 'emp_department_id', 'emp_department_name'), ['prompt' => Yii::t('emp', '--- Select Department ---')]);
?>
	</div>
	<div class="col-sm-4 col-xs-12">
	    <?php 
echo $form->field($model, 'emp_master_designation_id')->dropDownList(ArrayHelper::map(app\modules\employee\models\EmpDesignation::find()->where(['is_status' => 0])->all(), 'emp_designation_id', 'emp_designation_name'), ['prompt' => Yii::t('emp', '--- Select Designation ---')]);
?>
	</div>
</div>

<div class="col-xs-12 col-lg-12 col-sm-12">
示例#14
0
 /**
  * Формирование Html кода поля для вывода в форме
  * @param ActiveForm $form объект форма
  * @param array $options массив html атрибутов поля
  * @param bool|int $index инднкс модели при табличном вводе
  * @return string
  */
 public function renderInput(ActiveForm $form, array $options = [], $index = false)
 {
     $options = ArrayHelper::merge($this->options, $options);
     $widgetOptions = ArrayHelper::merge(["options" => ["class" => "form-control"]], $this->widgetOptions, ["options" => $options]);
     return $form->field($this->modelField->model, $this->getFormAttrName($index, $this->modelField->attr))->widget(DatePicker::className(), $widgetOptions);
 }
示例#15
0
    </div>

    <?php 
$form = ActiveForm::begin(['action' => ['/catalog/reservation/step-one'], 'enableAjaxValidation' => true, 'options' => ['class' => 'product-form']]);
?>

        <div class="row">
            <div class="col-md-6">
                <?php 
echo $form->field($formModel, 'dateIn')->widget(DatePicker::className());
?>
            </div>
            <div class="col-md-6">
                <?php 
echo $form->field($formModel, 'dateOut')->widget(DatePicker::className());
?>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4"><?php 
echo $form->field($formModel, 'email')->textInput();
?>
</div>
            <div class="col-md-4"><?php 
echo $form->field($formModel, 'name')->textInput();
?>
</div>
            <div class="col-md-4"><?php 
echo $form->field($formModel, 'phone')->textInput();
示例#16
0
文件: _form.php 项目: evgenylev/books
if (!(is_null($model->preview) || $model->preview == '')) {
    ?>
        <img src="/images/books/<?php 
    echo $model->preview;
    ?>
" width="100" height="150" />
    <?php 
} else {
    ?>
        <div class="clearfix"></div>
    <?php 
}
?>

    <?php 
echo $form->field($model, 'date')->widget(DatePicker::className(), ['model' => $model, 'attribute' => 'date', 'language' => 'ru', 'dateFormat' => 'dd.MM.yyyy', 'options' => ['class' => 'form-control'], 'clientOptions' => ['changeMonth' => true, 'changeYear' => true]]);
?>

    <?php 
echo $form->field($model, 'author_id')->dropDownList(Authors::find()->select(['name', 'id'])->indexBy('id')->column(), ['prompt' => 'выберите автора']);
?>

    <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();
?>
示例#17
0
<div class="acc-periode-form">

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

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

	<?php 
echo $form->field($model, 'date_from')->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'clientOptions' => ['dateFormat' => 'yy-mm-dd']]);
?>

<?php 
echo $form->field($model, 'date_to')->widget(DatePicker::className(), ['options' => ['class' => 'form-control'], 'clientOptions' => ['dateFormat' => 'yy-mm-dd']]);
?>

	<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>
示例#18
0
 public function renderField($name, $definition, $forms)
 {
     $output = "";
     // Determine Model
     $model = null;
     foreach ($forms as $formName) {
         if (isset($this->models[$formName])) {
             $model = $this->models[$formName];
         }
     }
     if ($model == null && $this->primaryModel !== null) {
         $model = $this->primaryModel;
     }
     if ($model) {
         $options = [];
         if (isset($definition['readonly']) && $definition['readonly']) {
             $options['readOnly'] = true;
         }
         if (isset($definition['prompt']) && $definition['prompt']) {
             $options['prompt'] = $definition['prompt'];
         }
         if ($definition['type'] == 'text') {
             $output .= $this->form->field($model, $name)->textInput($options);
         } elseif ($definition['type'] == 'dropdownlist') {
             $output .= $this->form->field($model, $name)->dropDownList($definition['items'], $options);
         } elseif ($definition['type'] == 'checkbox') {
             $output .= $this->form->field($model, $name)->checkbox($options);
         } elseif ($definition['type'] == 'textarea') {
             $output .= $this->form->field($model, $name)->textarea($options);
         } elseif ($definition['type'] == 'hidden') {
             $output .= $this->form->field($model, $name)->hiddenInput($options)->label(false);
         } elseif ($definition['type'] == 'password') {
             $output .= $this->form->field($model, $name)->passwordInput($options);
         } elseif ($definition['type'] == 'datetime') {
             $output .= $this->form->field($model, $name)->widget(\yii\jui\DatePicker::className(), ['clientOptions' => ['changeYear' => true, 'yearRange' => date('Y') - 100 . ":" . date('Y'), 'changeMonth' => true], 'options' => ['class' => 'form-control']]);
         } else {
             $output .= "Field Type " . $definition['type'] . " not supported by Compat HForm";
         }
     } else {
         $output .= "No model for: FieldName: " . $name . " Type:" . $definition['type'] . " Forms: " . print_r($forms, 1) . "<br>";
     }
     return $output;
 }
示例#19
0
                </div>
            </div>
            <div class="row">
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <?php 
echo $form->field($model, 'username', ['inputTemplate' => '<label>Username</label>{input}', 'inputOptions' => []])->label(false)->textInput(['class' => 'form-control pva-form-control'], ['maxlength' => true]);
?>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <?php 
echo $form->field($model, 'gender', ['inputTemplate' => '<label>Gender</label>{input}', 'inputOptions' => []])->dropDownList([0 => 'Male', 1 => 'Female'], ['class' => 'form-control pva-form-control'])->label(false);
?>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-12">
                    <?php 
echo $form->field($model, 'birth_date', ['inputTemplate' => '<label>Birth Date</label>{input}', 'inputOptions' => []])->label(false)->widget(DatePicker::className(), ['options' => ['class' => 'form-control pva-form-control']]);
?>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-8 col-md-8 col-sm-12">

                </div>
            </div>
            <div class="row">
                <div class="col-lg-8 col-md-8 col-sm-12">
                    <?php 
echo $form->field($model, 'email', ['inputTemplate' => '<label>Email</label>{input}', 'inputOptions' => []])->label(false)->textInput(['class' => 'form-control pva-form-control'], ['maxlength' => true]);
?>
                </div>
            </div>
示例#20
0
    <?php 
$form = ActiveForm::begin();
?>
    
    <?php 
echo $form->field($model, 'first_name')->textInput(['maxlength' => 45]);
?>

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

    <?php 
echo $form->field($model, 'birthdate')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['yearRange' => '-115:+0', 'changeYear' => true]]);
?>
 
<br>       

<?php 
echo $form->field($model, 'gender_id')->dropDownList($model->genderList, ['prompt' => 'Please Choose One']);
?>
        
<div class="form-group">

<?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        
        </div>
示例#21
0
/* @var $model app\models\ExperienciaLaboral */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="experiencia-laboral-form">

    <?php 
$form = ActiveForm::begin();
?>
    
    <?php 
echo $form->field($model, 'fechaInicio')->widget(DatePicker::className(), ['language' => 'es', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['yearRange' => '-105:+0)', 'changeYear' => true]]);
?>
    
    <?php 
echo $form->field($model, 'fechaFinal')->widget(DatePicker::className(), ['language' => 'es', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['yearRange' => '-105:+0)', 'changeYear' => true]]);
?>

    <?php 
echo $form->field($model, 'estadoLaboral')->dropDownList(array('T' => 'Trabajando', 'B' => 'Buscando'));
?>

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

    <?php 
示例#22
0
 public function renderField($name, $definition, $forms)
 {
     $output = "";
     // Determine Model
     $model = null;
     foreach ($forms as $formName) {
         if (isset($this->models[$formName])) {
             $model = $this->models[$formName];
         }
     }
     if ($model == null && $this->primaryModel !== null) {
         $model = $this->primaryModel;
     }
     if ($model) {
         $options = [];
         if (isset($definition['id'])) {
             $options['id'] = $definition['id'];
         }
         if (isset($definition['readonly']) && $definition['readonly']) {
             $options['readOnly'] = true;
             $options['disabled'] = true;
         }
         if (isset($definition['value'])) {
             $options['value'] = $definition['value'];
         }
         if (isset($definition['prompt']) && $definition['prompt']) {
             $options['prompt'] = $definition['prompt'];
         }
         if (isset($definition['label']) && $definition['label']) {
             $options['label'] = $definition['label'];
         }
         if (isset($definition['type'])) {
             switch ($definition['type']) {
                 case 'text':
                     return $this->form->field($model, $name)->textInput($options);
                 case 'multiselectdropdown':
                     $options['class'] = 'form-control multiselect_dropdown';
                     $options['multiple'] = 'multiple';
                     return $this->form->field($model, $name)->listBox($definition['items'], $options);
                 case 'dropdownlist':
                     return $this->form->field($model, $name)->dropDownList($definition['items'], $options);
                 case 'checkbox':
                     if (isset($options['readOnly']) && $options['readOnly']) {
                         $options['disabled'] = 'disabled';
                     }
                     return $this->form->field($model, $name)->checkbox($options);
                 case 'textarea':
                     return $this->form->field($model, $name)->textarea($options);
                 case 'hidden':
                     return $this->form->field($model, $name)->hiddenInput($options)->label(false);
                 case 'password':
                     return $this->form->field($model, $name)->passwordInput($options);
                 case 'datetime':
                     $format = Yii::$app->formatter->dateFormat;
                     if (isset($definition['format'])) {
                         $format = $definition['format'];
                     }
                     $yearRange = isset($definition['yearRange']) ? $definition['yearRange'] : date('Y') - 100 . ":" . (date('Y') + 100);
                     return $this->form->field($model, $name)->widget(\yii\jui\DatePicker::className(), ['dateFormat' => $format, 'clientOptions' => ['changeYear' => true, 'yearRange' => $yearRange, 'changeMonth' => true, 'disabled' => isset($options['readOnly']) && $options['readOnly']], 'options' => ['class' => 'form-control']]);
                 case 'markdown':
                     $options['id'] = $name;
                     $returnField = $this->form->field($model, $name)->textarea($options);
                     $returnField .= \humhub\widgets\MarkdownEditor::widget(array('fieldId' => $name));
                     return $returnField;
                 default:
                     return "Field Type " . $definition['type'] . " not supported by Compat HForm";
             }
         } else {
             return "No type found for: FieldName: " . $name . " Forms: " . print_r($forms, 1) . "<br>";
         }
     } else {
         return "No model for: FieldName: " . $name . " Forms: " . print_r($forms, 1) . "<br>";
     }
     return $output;
 }
示例#23
0
use yii\jui\DatePicker;
/* @var $this yii\web\View */
/* @var $dataProvider \yii\data\ActiveDataProvider */
/* @var $searchModel \app\models\WindowSearch */
$this->title = Yii::t('app', 'Dashboard');
$form = ActiveForm::begin(['method' => 'post', 'layout' => 'inline', 'fieldConfig' => ['labelOptions' => ['class' => '']]]);
?>
    <?php 
echo $form->field($searchModel, 'groupBy')->dropDownList(['title' => Yii::t('app', 'Title'), 'process_id' => Yii::t('app', 'Process')]);
?>

    <?php 
echo $form->field($searchModel, 'dateFrom')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd']);
?>
    <?php 
echo $form->field($searchModel, 'dateTo')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd']);
?>

    <?php 
echo \yii\bootstrap\Button::widget(['label' => 'Submit', 'options' => ['class' => 'btn-primary']]);
ActiveForm::end();
?>
<div id="keys-activity-area" class="keys-activity-area clearfix"></div>
<div id="keys-activity" class="keys-activity clearfix"></div>
<div id="color-strip" class="color-strip clearfix"></div>
<div id="color-strip-clusters" class="color-strip clearfix"></div>
<div id="tasks" class="tasks-list"></div>
<div id="sunburst" class="clearfix"></div>
<div id="sunburst-clusters" class="clearfix"></div>
<div id="sunburst-task" class="clearfix"></div>
示例#24
0
echo $form->errorSummary($model);
?>
    <div class="box box-danger no-padding">
        <div class="box-body">
            <div class="col-lg-5">
                <div class="form-group field-glheader-gldate required">
                    <?php 
echo Html::label('Select Category', 'sheet');
echo Html::dropDownList('', $es, $sheets, ['id' => 'sheets', 'prompt' => '-', 'class' => 'form-control']);
?>
                </div>
                <?php 
echo $form->field($model, 'gl_num')->textInput(['style' => 'width:60%']);
?>
                <?php 
echo $form->field($model, 'glDate')->widget(DatePicker::className(), ['options' => ['class' => 'form-control', 'style' => 'width:60%'], 'clientOptions' => ['dateFormat' => 'dd-mm-yy']]);
?>
            </div>
            <div class="col-lg-7">
                <?php 
echo $form->field($model, 'id_periode')->textInput(['style' => 'width:30%']);
?>
                <?php 
echo $form->field($model, 'id_branch')->dropDownList(Helper::getBranchList());
?>
                <?php 
echo $form->field($model, 'description')->textarea();
?>
                <?php 
echo '';
?>
示例#25
0
?>

<?php 
if ($model) {
    ?>
<div class="row"><div class="col-md-12"><div class="box box-widget widget-detail">
	<div class="widget-detail-header bg-maroon"><h3 class="widget-detail-title"><?php 
    echo Yii::t('fin.form', 'Input Values');
    ?>
</h3></div>
	<div class="box-footer" id="finPaymentConfirmForm">
		<?php 
    $form = ActiveForm::begin(['requiredCssClass' => 'form-group-required']);
    ?>
			<?php 
    echo $form->field($model, 'entry_date')->widget(DatePicker::className(), ['inline' => false, 'dateFormat' => 'php:' . $phpFmShortDate, 'options' => ['class' => 'form-control']]);
    ?>
			<?php 
    echo $form->field($model, 'account_source')->dropDownList($arrFinAccount, ['prompt' => '']);
    ?>
			<?php 
    echo $form->field($model, 'account_target')->dropDownList($arrFinAccount, ['prompt' => '']);
    ?>
			<?php 
    echo $form->field($model, 'entry_value')->textInput(['type' => 'number', 'readonly' => 'readonly']);
    ?>
			<?php 
    echo $form->field($model, 'entry_adjust')->textInput(['type' => 'number']);
    ?>
			<?php 
    echo $form->field($model, 'arr_entry_log')->inline(true)->checkboxList($arrEntryLog);
示例#26
0
?>
    <br/>
    <h4><?php 
echo Yii::t('app', 'Time');
?>
</h4>
    <?php 
echo $form->field($model, 'status_charge')->dropDownList(Transport::getStatus(), ['prompt' => Yii::t('app', 'Select the carcase')]);
?>

    <?php 
echo $form->field($model, 'charge_start')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
?>

    <?php 
echo $form->field($model, 'charge_end')->widget(DatePicker::className(), ['dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]);
?>
    <br/>
    <h4><?php 
echo Yii::t('app', 'Work');
?>
</h4>
    <?php 
echo $form->field($model, 'work_preferences')->dropDownList(Transport::getPrefer(), ['prompt' => Yii::t('app', 'Select prefer')]);
?>
    <br/>
    <h4><?php 
echo Yii::t('app', 'Payment');
?>
</h4>
    <?php 
示例#27
0
echo $form->field($model, 'ampur')->widget(DepDrop::className(), ['data' => $amp, 'options' => ['placeholder' => '<--คลิกเลือกอำเภอ-->'], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['employees-chw'], 'url' => yii\helpers\Url::to(['/employees/get-amp']), 'loadingText' => 'กำลังค้นข้อมูล...']]);
?>
        </div>     
        <div class="col-xs-3 col-sm-3 col-md-3">
            <?php 
echo $form->field($model, 'tumbon')->widget(DepDrop::className(), ['data' => $tum, 'options' => ['placeholder' => '<--คลิกเลือกตำบล-->'], 'type' => DepDrop::TYPE_SELECT2, 'select2Options' => ['pluginOptions' => ['allowClear' => true]], 'pluginOptions' => ['depends' => ['employees-chw', 'employees-ampur'], 'url' => yii\helpers\Url::to(['/employees/get-dist']), 'loadingText' => 'กำลังค้นข้อมูล...']]);
?>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3">
            <?php 
echo $form->field($model, 'tel')->widget(\yii\widgets\MaskedInput::classname(), ['mask' => '999-999-9999']);
?>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3">            
            <?php 
echo $form->field($model, 'comein')->widget(DatePicker::className(), ['language' => 'th', 'dateFormat' => 'yyyy-MM-dd', 'clientOptions' => ['changeMonth' => true, 'changeYear' => true], 'options' => ['class' => 'form-control']]);
?>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3">            
            <?php 
echo $form->field($model, 'department_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Departments::find()->all(), 'id', 'name'), 'language' => 'th', 'options' => ['placeholder' => 'เลือกแผนก ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
        <div class="col-xs-3 col-sm-3 col-md-3">
             <?php 
echo $form->field($model, 'education')->dropDownList(['ปริณญาตรี' => 'ปริณญาตรี', 'ปริณญาโท' => 'ปริณญาโท', 'สูงกว่าระดับปริณญาโทขึ้นไป' => 'สูงกว่าระดับปริณญาโทขึ้นไป', 'ปวส/อนุปริณญา' => 'ปวส/อนุปริณญา', 'มัธยมศึกษา6' => 'มัธยมศึกษา6', 'มัธยมศึกษา3' => 'มัธยมศึกษา3', 'ประถมศึกษา' => 'ประถมศึกษา'], ['prompt' => '']);
?>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-6 col-sm-6col-md-6">
示例#28
0
    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <div class="row">
        <div class="col-xs-4">
            <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>

            <?php 
echo $form->field($model, 'user_id')->dropDownList(User::getUsersList());
?>

            <?php 
echo $form->field($model, 'date')->widget(DatePicker::className(), ['clientOptions' => []]);
?>

            <div class="row">
                <div class="col-xs-8">
                    <?php 
echo $form->field($model, 'imageFile')->fileInput();
?>
                </div>
                <div class="col-xs-4">
                   <?php 
echo ThumbHelper::getImg($model->img, 180, 38);
?>
                </div>
            </div>
示例#29
0
文件: _form.php 项目: EduSec/EduSec
		<div class="col-xs-12 col-sm-4 col-lg-4">
			<?php 
echo $form->field($model, 'fees_pay_tran_bank_id')->dropDownList(ArrayHelper::map(app\modules\fees\models\BankMaster::find()->where(['is_status' => 0])->all(), 'bank_master_id', 'bank_master_name'), ['prompt' => 'Select Bank']);
?>
		</div>
		<div class="col-xs-12 col-sm-4 col-lg-4">
			<?php 
echo $form->field($model, 'fees_pay_tran_bank_branch')->textInput(['placeholder' => $model->getAttributeLabel('fees_pay_tran_bank_branch')]);
?>
		</div>
	</div>

	<div class="col-xs-12 col-sm-12 col-lg-12 no-padding cheque-data">
		<div class="col-xs-12 col-sm-4 col-lg-4">
			<?php 
echo $form->field($model, 'fees_pay_tran_cheque_date')->widget(yii\jui\DatePicker::className(), ['model' => $model, 'attribute' => 'fees_pay_tran_cheque_date', 'clientOptions' => ['dateFormat' => 'dd-mm-yyyy', 'changeMonth' => true, 'yearRange' => date('Y') - 5 . ':' . (date('Y') + 5), 'changeYear' => true, 'readOnly' => true, 'autoSize' => true, 'buttonImage' => Yii::$app->homeUrl . "images/calendar.png"], 'options' => ['class' => 'form-control', 'placeholder' => $model->getAttributeLabel('fees_pay_tran_cheque_date')]]);
?>
		</div>
		<div class="col-xs-12 col-sm-4 col-lg-4"></div>
		<div class="col-xs-12 col-sm-4 col-lg-4"></div>
	</div>
	<!--End cheque related field-->

</div><!---End box-body div---->
<div class="box-footer">
	<div class="<?php 
echo Yii::$app->language == 'ar' ? 'pull-left' : 'pull-right';
?>
" style="padding-bottom:10px">
	<?php 
if ($collectOn) {
示例#30
0
echo $form->field($calendarEntry, 'start_datetime')->widget(DatePicker::className(), ['clientOptions' => [], 'options' => ['class' => 'form-control']]);
?>
                </div>
                <div class="col-md-6">
                    <div class="timeFields">
                        <?php 
echo $form->field($calendarEntry, 'start_time')->textInput(['placeholder' => 'hh:mm']);
?>
                    </div>
                </div>
            </div>

            <div class="row">
                <div
                    class="col-md-6"><?php 
echo $form->field($calendarEntry, 'end_datetime')->widget(DatePicker::className(), ['clientOptions' => [], 'options' => ['class' => 'form-control']]);
?>
</div>
                <div class="col-md-6">
                    <div class="timeFields">
                        <?php 
echo $form->field($calendarEntry, 'end_time')->textInput(['placeholder' => 'hh:mm']);
?>
                    </div>
                </div>
            </div>
            <hr>

            <div class="form-group">
                <?php 
$modes = array(CalendarEntry::PARTICIPATION_MODE_NONE => Yii::t('CalendarModule.views_entry_edit', 'No participants'), CalendarEntry::PARTICIPATION_MODE_ALL => Yii::t('CalendarModule.views_entry_edit', 'Everybody can participate'));