Author: Antonio Ramirez (amigo.cobos@gmail.com)
Inheritance: extends yii\widgets\InputWidget, use trait DatePickerTrait
示例#1
0
use dosamigos\datepicker\DateRangePicker;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model app\models\SearchCommitsFiles */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="commits-files-search">

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>

    <?php 
echo $form->field($model, 'date_from')->widget(DateRangePicker::className(), ['attributeTo' => 'date_to', 'form' => $form, 'language' => 'ru', 'size' => 'lg', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton('Поиск', ['class' => 'btn btn-primary']);
?>
    </div>

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

</div>
示例#2
0
文件: create.php 项目: fnoorman/dev
                <fieldset>
                    <?php 
echo Html::errorSummary($model);
?>
                    <?php 
echo $form->field($model, 'codeBank_code')->dropDownList($codes, ['prompt' => 'Please select Hybrizy Code']);
?>
                    <?php 
echo $form->field($model, 'name');
?>
                    <?php 
echo $form->field($model, 'modelClass')->dropDownList(Yii::$app->params['campaignOptions'], ['prompt' => 'Please select Campaign Type']);
?>
                    <?php 
echo $form->field($model, 'dateFrom')->widget(DateRangePicker::className(), ['attributeTo' => 'dateTo', 'form' => $form, 'clientOptions' => ['autoclose' => true, 'format' => 'dd-M-yyyy']]);
?>
                </fieldset>
                <footer>
                    <div class="form-group">
                        <?php 
echo Html::submitButton('Next Step', ['class' => 'btn btn-primary']);
?>
                    </div>
                </footer>




            <?php 
ActiveForm::end();
示例#3
0
$form = ActiveForm::begin();
?>
    <?php 
echo $form->errorSummary($model);
?>
    <?php 
echo $form->field($model, 'reason', ['options' => ['class' => 'form-inline']])->dropDownList(ArrayHelper::map($reason, 'id', 'name'), array('prompt' => '--Select a reason--', 'style' => 'width:414px;margin-left:20px;'));
?>
    <?php 
echo $form->field($model, 'hours_off', ['options' => ['class' => 'form-inline']])->textInput(['style' => 'width:200px;margin-left:30px;']);
?>


    <?php 
// code nay giu lai de lam vi du cho range date.
echo $form->field($model, 'from_date', ['options' => ['class' => 'form-inline']])->widget(DateRangePicker::className(), ['attributeTo' => 'to_date', 'form' => $form, 'language' => 'en', 'size' => 'ms', 'clientOptions' => ['minView' => 0, 'autoclose' => true, 'daysOfWeekDisabled' => false, 'format' => 'dd/mm/yyyy'], 'options' => []]);
//
?>



    <?php 
//= $form->field($model, 'from_date')->widget(DateTimePicker::className(), [
//        //'language' => 'en',
//        'size' => 'ms',
//        'template' => '{input}{reset}',
//        'pickButtonIcon' => 'glyphicon glyphicon-time',
//        'inline' => false,
//        'clientOptions' => [
//            'startView' => 2,
//            //'daysOfWeekDisabled'=>'0,6',
示例#4
0
use dosamigos\datepicker\DateRangePicker;
$this->title = 'Days annual leave of employees';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="panel panel-default">
    <div class="panel-heading"><?php 
echo Html::encode($this->title);
?>
</div>
    <div class="panel-body">
        <div class="application-form form-inline">
        <?php 
$form = ActiveForm::begin();
?>
        <?php 
echo $form->field($model, 'from_date')->widget(DateRangePicker::className(), ['attributeTo' => 'to_date', 'form' => $form, 'language' => 'en', 'size' => 'ms', 'clientOptions' => ['minView' => 0, 'autoclose' => true, 'daysOfWeekDisabled' => '0,6', 'format' => 'yyyy-mm-dd']])->label('Date');
?>

        <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary', 'style' => 'margin-bottom:10px;']);
?>
        <a id="print" href="<?php 
echo Yii::$app->urlManager->createUrl(['report/vacation-of-staff', 'param' => 'print', 'from_date' => $model->from_date, 'to_date' => $model->to_date]);
?>
" target="_blank"><span style="font-size:30px;vertical-align: top;margin: 0px 0px 0px 30px;" class="glyphicon glyphicon-print"></span></a>
        <?php 
ActiveForm::end();
?>
        </div>

        <?php 
示例#5
0
//echo $grid->renderItems();
?>

<div class="row panel panel-default" >
    <!-- Default panel contents -->
    <div class="panel-heading">Report</div>

    <div class="col-lg-12 ">
        <?php 
$form = ActiveForm::begin(['method' => 'get']);
?>
        <div class="row">
            <div class="report-one-form form-inline col-lg-8">

                <?php 
echo $form->field($searchModel, 'from_date')->widget(\dosamigos\datepicker\DateRangePicker::className(), ['attributeTo' => 'to_date', 'form' => $form, 'language' => 'en', 'size' => 'ms', 'clientOptions' => ['minView' => 0, 'autoclose' => true, 'format' => 'dd/mm/yyyy']])->label('Date');
echo Html::submitButton('Find', ['class' => 'btn btn-primary btn-find', 'style' => 'margin-bottom:10px;']);
?>
                <a id="export-excel" href="#"><span style="font-size:35px;vertical-align: top;margin: 2px 0px 0px 30px;" class="fa fa-file-excel-o"></span></a>
            </div>

            <div class="col-lg-4 " style="margin-top: 10px;">
                <div class="row">
                    <div class="col-sm-8" style="text-align: right">

                    </div>
                    <div class="col-sm-4">
                        <?php 
echo Html::dropDownList('pageSize', Yii::$app->request->get('per-page'), array(20 => 20, 30 => 30, 50 => 50, 70 => 70, 100 => 100), array('class' => "form-control page-size", 'style' => ''));
?>
                    </div>