Exemplo n.º 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;
 }
Exemplo n.º 2
0
 public function run()
 {
     BowerAssets::register($this->getView());
     $containerID = $this->inline ? $this->containerOptions['id'] : $this->options['id'];
     $this->getView()->registerJs("\n            \$('#{$containerID}').parent().append('<div id=\\'yii2-date-picker-{$containerID}\\' class=\\'yii2-date-picker\\'><span></span></div>');\n            \$('#{$containerID}').addClass('form-control').detach().appendTo('#yii2-date-picker-{$containerID}');\n        ");
     parent::run();
 }
Exemplo n.º 3
0
 /**
  * Renders the DatePicker widget.
  * @return string the rendering result.
  */
 protected function renderWidget()
 {
     if ($this->hasModel()) {
         $this->model->{$this->attribute} = $this->model->{$this->attribute} ? Yii::$app->formatter->asDate($this->model->{$this->attribute}, 'medium') : null;
     }
     return parent::renderWidget();
 }
Exemplo n.º 4
0
 /**
  * Renders a datepicker text input.
  * @see \yii\widgets\ActiveField::textInput()
  * @return static the field object itself
  */
 public function datepicker($options = [])
 {
     $datepickerOptions = isset($options['datepicker']) ? $options['datepicker'] : [];
     unset($options['datepicker']);
     $datepickerOptions['model'] = $this->model;
     $datepickerOptions['attribute'] = $this->attribute;
     $datepickerOptions['options'] = array_merge($this->inputOptions, $options);
     $this->adjustLabelFor($datepickerOptions['options']);
     $this->parts['{input}'] = DatePicker::widget($datepickerOptions);
     return $this;
 }
Exemplo n.º 5
0
 public function run()
 {
     if (!empty($this->between)) {
         \yii\jui\DatePicker::widget(['model' => $this->model, 'attribute' => $this->between[0]]);
         echo $this->form->field($this->model, $this->between[0], ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-calendar"></i>'], 'groupOptions' => ['class' => 'col-sm-4']]])->textInput(['readonly' => 'readonly', 'placeholder' => "คลิกเลือก {$this->label[0]}"]);
         \yii\jui\DatePicker::widget(['model' => $this->model, 'attribute' => $this->between[1]]);
         echo $this->form->field($this->model, $this->between[1], ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-calendar"></i>'], 'groupOptions' => ['class' => 'col-sm-4']]])->textInput(['readonly' => 'readonly', 'placeholder' => "คลิกเลือก {$this->label[1]}"]);
     } else {
         \yii\jui\DatePicker::widget(['model' => $this->model, 'attribute' => $this->attr]);
         echo $this->form->field($this->model, $this->attr, ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-calendar"></i>'], 'groupOptions' => ['class' => 'col-sm-4']]])->textInput(['readonly' => 'readonly', 'placeholder' => "คลิกเลือก {$this->label[0]}"]);
     }
     $this->js();
 }
Exemplo n.º 6
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);
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!in_array($this->mode, array('date', 'time', 'datetime'))) {
         throw new InvalidConfigException('Unknown mode: "' . $this->mode . '". Use time, datetime or date!');
     }
     if ($this->inline && !isset($this->containerOptions['id'])) {
         $this->containerOptions['id'] = $this->options['id'] . '-container';
     }
     if ($this->size) {
         Html::addCssClass($this->options, 'input-' . $this->size);
         Html::addCssClass($this->containerOptions, 'input-group-' . $this->size);
     }
     if ($this->language === null && ($language = Yii::$app->language) !== 'en-US') {
         $this->language = substr($language, 0, 2);
     }
     Html::addCssClass($this->options, 'form-control');
     Html::addCssClass($this->containerOptions, 'input-group ' . $this->mode);
 }
Exemplo n.º 8
0
 /**
  * Renders the filter cell content.
  * The default implementation simply renders a space.
  * This method may be overridden to customize the rendering of the filter cell (if any).
  * @return string the rendering result
  */
 protected function renderFilterCellContent()
 {
     if (is_string($this->filter)) {
         return $this->filter;
     }
     $model = $this->grid->filterModel;
     if ($this->filter !== false && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
         if ($model->hasErrors($this->attribute)) {
             Html::addCssClass($this->filterOptions, 'has-error');
             $error = ' ' . Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
         } else {
             $error = '';
         }
         $filterOptions = ['=' => '=', '>' => '>', '<' => '<'];
         Html::addCssClass($this->filterInputOptions, 'date-filter-input');
         $dropDown = Html::activeDropDownList($model, $this->attribute . '_operand', $filterOptions, ['class' => 'form-control pull-left', 'style' => 'width: 32px; appearance: none; -moz-appearance: none; -webkit-appearance: none;']);
         $field = DatePicker::widget(['model' => $model, 'attribute' => $this->attribute, 'options' => $this->filterInputOptions, 'dateFormat' => 'yyyy-MM-dd']);
         return $dropDown . $field . $error;
     } else {
         return parent::renderFilterCellContent();
     }
 }
Exemplo n.º 9
0
		<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) {
Exemplo n.º 10
0
<div class="post-index">
    <p>
        <?php 
echo Html::a('Создать запись', ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    
    <?php 
Pjax::begin();
?>
    <?php 
echo himiklab\sortablegrid\SortableGridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'id' => 'post_tbl', 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => CheckboxColumn::classname()], ['attribute' => 'title', 'format' => 'html', 'value' => function ($model) {
    return Html::a($model['title'], ['update', 'id' => $model['id']]);
}], ['attribute' => 'cat_id', 'content' => function ($data) {
    return $data->getCategoryName();
}, 'filter' => \yii\helpers\Arrayhelper::map(\app\modules\category\models\Category::find()->all(), 'id', 'title')], ['attribute' => 'created_at', 'format' => ['date', 'dd.MM.yyyy'], 'options' => array('width' => '225px'), 'filter' => \yii\jui\DatePicker::widget(['dateFormat' => 'dd.MM.yyyy', 'model' => $searchModel, 'attribute' => 'created_at', 'options' => ['class' => 'form-control'], 'clientOptions' => ['dateFormat' => 'dd.mm.yy']])], ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    $class = $model->status === 1 ? '<i class="icon-ok"></i>' : '<i class="icon-lock">';
    return $class;
}, 'options' => array('width' => '100px'), 'filter' => Html::activeDropDownList($searchModel, 'status', array(1 => 'On', 0 => 'Off'), ['class' => 'form-control', 'prompt' => 'Все'])], ['attribute' => 'main', 'format' => 'html', 'value' => function ($model) {
    $res = $model->main === 1 ? '<i class="icon-ok"></i>' : '<i class="icon-minus">';
    return $res;
}, 'options' => array('width' => '100px'), 'filter' => Html::activeDropDownList($searchModel, 'main', array(1 => 'Да', 0 => 'Нет'), ['class' => 'form-control', 'prompt' => 'Все'])], 'username', ['class' => 'yii\\grid\\ActionColumn', 'header' => 'Действия', 'headerOptions' => ['width' => '100']]]]);
?>

<p> 
  <?php 
echo Html::a('Удалить выбранные', ['massdelete'], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Вы уверены?', 'data-method' => 'post']]);
?>
  
</p>
Exemplo n.º 11
0
$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 
Exemplo n.º 12
0
echo $form->field($model, 'author_id')->dropDownList(ArrayHelper::map(Authors::find()->all(), 'id', 'Name'), ['prompt' => '---']);
?>
		</div>
		<div class="col-md-4">
			<?php 
echo $form->field($model, 'name');
?>
		</div>
    </div>
    <div class="row">
        <div class="col-md-6">
			Дата выхода от: <?php 
echo DatePicker::widget(['model' => $model, 'attribute' => 'date_ot', 'language' => 'ru', 'dateFormat' => 'yyyy-MM-dd']);
?>
			до <?php 
echo DatePicker::widget(['model' => $model, 'attribute' => 'date_do', 'language' => 'ru', 'dateFormat' => 'yyyy-MM-dd']);
?>
			
		</div>

	</div>
	<div class="row">	
		<div class="col-md-4">
			<?php 
echo Html::submitButton('Поиск', ['class' => 'btn btn-primary']);
?>
		</div>
	</div>
    <?php 
ActiveForm::end();
?>
Exemplo n.º 13
0
?>

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

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

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

    <?php 
echo $form->field($model, 'date_doc')->widget(DatePicker::classname(), ['value' => $model->date_doc ? $model->date_doc : (new DateTime())->format('Y-m-d'), 'dateFormat' => 'php:Y-m-d', 'options' => ['class' => 'form-control']]);
?>

    <?php 
echo $form->field($model, 'id_type')->dropDownList(ArrayHelper::map(TestType::find()->orderBy(['order' => SORT_ASC])->all(), 'id', 'type'))->label(Yii::t('test-type', 'Type'));
?>

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

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

    <div class="form-group">
Exemplo n.º 14
0
use yii\helpers\Html;
use yii\grid\GridView;
use yii\jui;
/* @var $this yii\web\View */
/* @var $searchModel app\models\search\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Users');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-index">

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

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

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'username', 'name', 'surname', ['attribute' => 'create_date', 'value' => 'create_date', 'filter' => \yii\jui\DatePicker::widget(['language' => 'ru', 'dateFormat' => 'dd-MM-yyyy']), 'format' => 'html'], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemplo n.º 15
0
<!-- 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>

Exemplo n.º 16
0
<div class="subscriber-form">

    <?php 
$form = ActiveForm::begin(['id' => 'dynamic-form']);
?>

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

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

   <!-- <?php 
echo DatePicker::widget(['model' => $model, 'attribute' => 'birth_date', 'dateFormat' => 'yyyy-MM-dd']);
?>
 -->

    <?php 
echo $form->field($model, 'notes')->textarea(['rows' => 6]);
?>

<div class="row">
	<div class="panel panel-default">
        <div class="panel-heading"><h4><i class="glyphicon glyphicon-envelope"></i> Phones</h4></div>
        <div class="panel-body">
             <?php 
DynamicFormWidget::begin(['widgetContainer' => 'dynamicform_wrapper', 'widgetBody' => '.container-items', 'widgetItem' => '.item', 'limit' => 5, 'min' => 1, 'insertButton' => '.add-item', 'deleteButton' => '.remove-item', 'model' => $modelsPhone[0], 'formId' => 'dynamic-form', 'formFields' => ['number']]);
?>
Exemplo n.º 17
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">
Exemplo n.º 18
0
                                                            <label for="sqllogsearch-sqltext">IP:</label>
                                                            <?php 
echo Html::activeTextInput($accLogErr, 'Ip1', ['class' => 'form-control', 'style' => 'width:200px']);
?>
                                                            <label for="sqllogsearch-sqltext">站点:</label>
                                                            <?php 
echo Html::activeTextInput($accLogErr, 'visitwebsite', ['class' => 'form-control', 'style' => 'width:200px']);
?>
                                                            <label for="sqllogsearch-sqltext">耗时:</label>
                                                            <?php 
echo Html::activeTextInput($accLogErr, 'request_time', ['class' => 'form-control', 'style' => 'width:200px']);
?>
                                                            
                                                            <label for="exampleInputEmail2">访问日期:</label>
                                                            <?php 
echo \yii\jui\DatePicker::widget(['options' => ['class' => 'form-control datepicker', 'readonly' => true], 'model' => $accLogErr, 'language' => 'zh-CN', 'attribute' => 'date_reg', 'value' => date('Y-m-d'), 'dateFormat' => 'php:Y-m-d', 'clientOptions' => ['autoclose' => true]]);
?>
                                                            <button type="submit" class="btn btn-default btn-primary btn-sm">查询</button>
                                                        </div>
                                                    </div>
                                                </div>
                                                <?php 
ActiveForm::end();
?>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <div class="summary">第<b><?php 
echo $begin . '-' . $end;
?>
Exemplo n.º 19
0
    </div>
    <div style="width: 30%; float: left">
        <?php 
echo $form->field($searchModel, 'name')->label(false)->textInput(['placeholder' => 'Название книги']);
?>
    </div>
    <div style="clear: both"></div>
    <div>
        <div style="width: 30%; float: left">
            <?php 
echo $form->field($searchModel, 'dateFrom')->widget(DatePicker::classname(), ['language' => 'ru'])->label(false)->textInput(['placeholder' => 'Дата выхода c']);
?>
        </div>
        <div style="width: 30%; float: left">
            <?php 
echo $form->field($searchModel, 'dateTo')->widget(DatePicker::classname(), ['language' => 'ru'])->label(false)->textInput(['placeholder' => 'Дата выхода по']);
?>
        </div>
        <div style="clear: both"></div>
    </div>
</div>
<?php 
echo Button::widget(['label' => 'search', 'options' => ['class' => 'btn-lg btn-primary']]);
ActiveForm::end();
?>


<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id', 'name', ['attribute' => 'preview', 'format' => 'html', 'value' => function ($data) {
    return Html::img(Yii::getAlias('@web') . '/images/' . $data['preview'], ['width' => '30px', 'class' => 'scalable']);
}], 'fullName', 'date:date', 'date_create:date', 'actions' => ['format' => 'raw', 'value' => function ($data) {
Exemplo n.º 20
0
?>
</h1>

    <p>
        <?php 
echo Html::a('Создать Проект', ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <div class="row">
        <div class="col-xs-3">
            <div class="alert alert-warning" role="alert">В обработке</div>
        </div>
        <div class="col-xs-3">
            <div class="alert alert-success">Одобрена/завершена</div>
        </div>
    </div>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'summary' => '', 'rowOptions' => function ($model, $index, $widget, $grid) {
    return ['style' => 'background-color:' . $model->getColor() . ';'];
}, 'columns' => [['attribute' => 'id', 'value' => 'id', 'contentOptions' => ['style' => 'width: 50px;']], 'name', ['attribute' => 'status', 'format' => 'raw', 'value' => function ($data) {
    return $data->getStatus();
}, 'filter' => R::PROJECT_STATUSES()], ['attribute' => 'deadline', 'value' => 'deadline', 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'deadline', 'language' => 'ru', 'dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control']]), 'format' => 'html'], ['attribute' => 'stages', 'format' => 'raw', 'value' => function ($data) {
    return $data->getStagesName();
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update} {done}', 'buttons' => ['done' => function ($url, $model, $key) {
    $options = ['data-confirm' => Yii::t('yii', 'Вы действительно желаете завершить проект?'), 'data-method' => 'post', 'data-pjax' => '0'];
    return Html::a('<span class="glyphicon glyphicon-ok"></span>', $url, $options);
}]]]]);
?>

</div>
Exemplo n.º 21
0
?>

<?php 
echo $this->render('_menu');
?>

<?php 
Pjax::begin();
?>

<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "{items}\n{pager}", 'columns' => ['username', 'email:email', ['attribute' => 'registration_ip', 'value' => function ($model) {
    return $model->registration_ip == null ? '<span class="not-set">' . Yii::t('user', '(not set)') . '</span>' : $model->registration_ip;
}, 'format' => 'html'], ['attribute' => 'created_at', 'value' => function ($model) {
    return Yii::t('user', '{0, date, MMMM dd, YYYY HH:mm}', [$model->created_at]);
}, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'dateFormat' => 'php:Y-m-d', 'options' => ['class' => 'form-control']])], ['header' => Yii::t('user', 'Confirmation'), 'value' => function ($model) {
    if ($model->isConfirmed) {
        return '<div class="text-center"><span class="text-success">' . Yii::t('user', 'Confirmed') . '</span></div>';
    } else {
        return Html::a(Yii::t('user', 'Confirm'), ['confirm', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to confirm this user?')]);
    }
}, 'format' => 'raw', 'visible' => Yii::$app->getModule('user')->enableConfirmation], ['header' => Yii::t('user', 'Block status'), 'value' => function ($model) {
    if ($model->isBlocked) {
        return Html::a(Yii::t('user', 'Unblock'), ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to unblock this user?')]);
    } else {
        return Html::a(Yii::t('user', 'Block'), ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-danger btn-block', 'data-method' => 'post', 'data-confirm' => Yii::t('user', 'Are you sure you want to block this user?')]);
    }
}, 'format' => 'raw'], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
?>

<?php 
Exemplo n.º 22
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);
Exemplo n.º 23
0
SecondWidget::begin();
?>
        Этот текст сделаем красным.
    <?php 
SecondWidget::end();
?>

    <?php 
Modal::begin(['header' => '<h2>Привет МИР !!!</h2>', 'toggleButton' => ['label' => 'нажми']]);
echo 'это контент модального окна...';
Modal::end();
?>

    <?php 
$value = date('d.m.Y');
echo DatePicker::widget(['language' => 'ru', 'name' => 'from_date', 'clientOptions' => ['dateFormat' => 'd.m.Y', 'dateDefault' => '21.06.1977']]);
?>


    <h1><?php 
echo $this->context->action->uniqueId;
?>
</h1>
    <p>
        This is the view content for action "<?php 
echo $this->context->action->id;
?>
".
        The action belongs to the controller "<?php 
echo get_class($this->context);
?>
Exemplo n.º 24
0
    <?php 
echo Html::hiddenInput('id', $employee_id);
?>

    <div class="col-xs-4">
        <?php 
$from_date = isset($_GET['from_date']) ? $_GET['from_date'] : '';
echo 'From ' . \yii\jui\DatePicker::widget(['name' => 'from_date', 'dateFormat' => 'yyyy-MM-dd', 'options' => ['style' => 'width:200px', 'class' => 'form-control', ' value' => $from_date]]);
?>
    </div>

    <div class="col-xs-4">
        <?php 
$to_date = isset($_GET['to_date']) ? $_GET['to_date'] : '';
echo 'To ' . \yii\jui\DatePicker::widget(['name' => 'to_date', 'dateFormat' => 'yyyy-MM-dd', 'options' => ['style' => 'width:200px', 'class' => 'form-control', ' value' => $to_date]]);
?>
    </div>


    <div class="form-group float-left" style="margin-top:20px">
        <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('Reset', ['job', 'id' => $employee_id], ['class' => 'btn btn-default']);
?>
    </div>

    <?php 
ActiveForm::end();
Exemplo n.º 25
0
?>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false" data-pause="false">
    <div class="container">
        <div class="tour-form">
            <?php 
NavBar::begin();
$form = ActiveForm::begin(['method' => 'post', 'action' => ['/tour/index'], 'options' => ['class' => 'form-inline']]);
?>

            <?php 
echo $form->field($model, 'search_data', ['options' => ['class' => 'search-data form-group']])->widget(Select2::classname(), ['data' => $data, 'options' => ['placeholder' => 'Введите ключевые слова...'], 'pluginOptions' => ['allowClear' => true]]);
?>

            <!-- /.search-data -->
            <?php 
echo $form->field($model, 'date_begin')->widget(\yii\jui\DatePicker::classname(), ['language' => 'ru', 'dateFormat' => 'yyyy-MM-dd']);
?>
            <div class="form-group btn-search">
                <?php 
echo Html::submitButton('Вперед!', ['class' => 'btn btn-success']);
?>
            </div>
            <?php 
ActiveForm::end();
NavBar::end();
?>
            <div class="slider-value">
                Filter by price interval: <b>€ 10</b> <input id="ex2" type="text" class="span2" value=""
                                                             data-slider-min="10"
                                                             data-slider-max="1000" data-slider-step="5"
                                                             data-slider-value="[250,450]"/> <b>€ 1000</b>
Exemplo n.º 26
0
<?php

use yii\helpers\Url;
$id = \Yii::$app->controller->action->id;
$search_date = Yii::$app->request->get("search_date");
if (empty($url)) {
    $url = '/visit/api.html?fc=totalvisit';
}
?>
<div class="panel-heading">
    <div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
        <div class="btn-group pull-left">
            <?php 
echo \yii\jui\DatePicker::widget(['options' => ['class' => 'form-control datepicker', 'readonly' => true], 'attribute' => 'start_date', 'language' => 'zh-CN', 'dateFormat' => 'yyyy-MM-dd', 'value' => empty($search_date) ? date('Y-m-d') : $search_date, 'clientOptions' => ['minDate' => '2015-01-01', 'maxDate' => date("Y-m-d"), 'onSelect' => new \yii\web\JsExpression("function (dateText, inst) {\n                                            var url = '" . $url . "&search_date='+ dateText;\n                                            location.href = url;\n                                        }")]]);
?>
        </div>
    </div>
</div>
Exemplo n.º 27
0
?>

    <?php 
echo $form->field($model, 'sport_id')->dropDownList(ArrayHelper::map(Sport::find()->all(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'events_set_id')->dropDownList(ArrayHelper::map(EventsSet::find()->all(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'date_start')->widget(DatePicker::classname(), ['dateFormat' => 'yyyy-MM-dd']);
?>

    <?php 
echo $form->field($model, 'date_finish')->widget(DatePicker::classname(), ['dateFormat' => 'yyyy-MM-dd']);
?>

    <?php 
echo $form->field($model, 'location')->textInput(['maxlength' => 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']);
?>
    </div>

    <?php 
ActiveForm::end();
?>
Exemplo n.º 28
0
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use yii\jui\DatePicker;
use johnitvn\userplus\models\User;
return [['class' => 'kartik\\grid\\CheckboxColumn', 'width' => '20px'], ['class' => 'kartik\\grid\\SerialColumn', 'width' => '30px'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'id', 'width' => '40px'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'login'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'created_at', 'value' => function ($model) {
    return date('d/m/Y', $model->created_at);
}, 'filter' => DatePicker::widget(['model' => $searchModel, 'attribute' => 'created_at', 'dateFormat' => 'php:Y-m-d', 'options' => ['class' => 'form-control']])], ['class' => '\\kartik\\grid\\DataColumn', 'width' => '50px', 'attribute' => 'status', 'value' => function ($model) {
    if ($model->status == User::STATUS_BLOCKED) {
        return Html::a(Yii::t('user', 'Unblock'), ['toggle-block', 'id' => $model->id], ['class' => 'btn btn-xs btn-default btn-block', 'role' => 'modal-remote', 'data-confirm' => false, 'data-method' => false, 'data-request-method' => 'post', 'data-confirm-title' => Yii::t('user', 'Are you sure?'), 'data-confirm-message' => Yii::t('user', 'Are you sure you want to unblock this user?')]);
    } else {
        return Html::a(Yii::t('user', 'Block'), ['toggle-block', 'id' => $model->id], ['class' => 'btn btn-xs btn-default btn-block', 'role' => 'modal-remote', 'data-confirm' => false, 'data-method' => false, 'data-request-method' => 'post', 'data-confirm-title' => Yii::t('user', 'Are you sure?'), 'data-confirm-message' => Yii::t('user', 'Are you sure you want to unblock this user?')]);
    }
}, 'format' => 'raw', 'filter' => [null => 'All', User::STATUS_BLOCKED => 'Blocked', User::STATUS_ACTIVED => 'Unblocked']], ['class' => '\\kartik\\grid\\DataColumn', 'width' => '100px', 'attribute' => 'superuser', 'value' => function ($model) {
    if ($model->superuser == User::IS_NOT_SUPER_USER) {
        return Html::a(Yii::t('user', 'Set SU'), ['toggle-superuser', 'id' => $model->id], ['class' => 'btn btn-xs btn-default btn-block', 'role' => 'modal-remote', 'data-confirm' => false, 'data-method' => false, 'data-request-method' => 'post', 'data-confirm-title' => Yii::t('user', 'Are you sure?'), 'data-confirm-message' => Yii::t('user', 'Are you sure you want to unblock this user?')]);
    } else {
        return Html::a(Yii::t('user', 'Remove SU'), ['toggle-superuser', 'id' => $model->id], ['class' => 'btn btn-xs btn-default btn-block', 'role' => 'modal-remote', 'data-confirm' => false, 'data-method' => false, 'data-request-method' => 'post', 'data-confirm-title' => Yii::t('user', 'Are you sure?'), 'data-confirm-message' => Yii::t('user', 'Are you sure you want to unblock this user?')]);
    }
}, 'format' => 'raw', 'filter' => [User::IS_NOT_SUPER_USER => 'Not Superuser', User::IS_SUPER_USER => 'IS Superuser']], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'vAlign' => 'middle', 'urlCreator' => function ($action, $model, $key, $index) {
    return Url::to([$action, 'id' => $key]);
}, 'viewOptions' => ['role' => 'modal-remote', 'title' => 'View', 'data-toggle' => 'tooltip'], 'updateOptions' => ['role' => 'modal-remote', 'title' => 'Update', 'data-toggle' => 'tooltip'], 'deleteOptions' => ['role' => 'modal-remote', 'title' => 'Delete', 'data-confirm' => false, 'data-method' => false, 'data-request-method' => 'post', 'data-toggle' => 'tooltip', 'data-confirm-title' => 'Are you sure?', 'data-confirm-message' => 'Are you sure want to delete this item']]];
Exemplo n.º 29
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\grid\ActionColumn;
/**
 * @var yii\web\View $this
 * @var yii\data\ActiveDataProvider $dataProvider
 * @var app\modules\user\models\SearchUser $searchModel
 */
$this->title = 'Список страниц';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="">
   <?php 
echo GridView::widget(['id' => 'pages-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => array('width' => '50px')], ['attribute' => 'title', 'format' => 'html', 'value' => function ($model) {
    return Html::a($model['title'], ['update', 'id' => $model['id']]);
}], ['attribute' => 'alias', 'format' => 'url', 'value' => function ($model) {
    return \yii\helpers\Url::To('@web/page/' . $model->alias, true);
}], ['attribute' => 'created_at', 'format' => ['date', 'dd.MM.yyyy'], 'options' => array('width' => '225px'), 'filter' => \yii\jui\DatePicker::widget(['dateFormat' => 'dd.MM.yyyy', 'model' => $searchModel, 'attribute' => 'created_at', 'options' => ['class' => 'form-control'], 'clientOptions' => ['dateFormat' => 'dd.mm.yy']])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
</div>

Exemplo n.º 30
0
?>

    <?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>